1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "third_party/blink/public/common/context_menu_data/untrustworthy_context_menu_params.h"
7 #include "third_party/blink/public/common/context_menu_data/context_menu_data.h"
8 #include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h"
12 UntrustworthyContextMenuParams::UntrustworthyContextMenuParams()
13 : media_type(blink::mojom::ContextMenuDataMediaType::kNone),
16 has_image_contents(false),
18 spellcheck_enabled(false),
20 writing_direction_default(
21 blink::ContextMenuData::kCheckableMenuItemDisabled),
22 writing_direction_left_to_right(
23 blink::ContextMenuData::kCheckableMenuItemEnabled),
24 writing_direction_right_to_left(
25 blink::ContextMenuData::kCheckableMenuItemEnabled),
27 referrer_policy(network::mojom::ReferrerPolicy::kDefault),
28 source_type(ui::MENU_SOURCE_NONE),
29 input_field_type(blink::mojom::ContextMenuDataInputFieldType::kNone),
30 selection_start_offset(0) {}
32 UntrustworthyContextMenuParams::UntrustworthyContextMenuParams(
33 const UntrustworthyContextMenuParams& other) {
37 UntrustworthyContextMenuParams& UntrustworthyContextMenuParams::operator=(
38 const UntrustworthyContextMenuParams& other) {
45 void UntrustworthyContextMenuParams::Assign(
46 const UntrustworthyContextMenuParams& other) {
47 media_type = other.media_type;
50 link_url = other.link_url;
51 link_text = other.link_text;
52 impression = other.impression;
53 unfiltered_link_url = other.unfiltered_link_url;
54 src_url = other.src_url;
55 has_image_contents = other.has_image_contents;
56 media_flags = other.media_flags;
57 selection_text = other.selection_text;
58 title_text = other.title_text;
59 alt_text = other.alt_text;
60 suggested_filename = other.suggested_filename;
61 misspelled_word = other.misspelled_word;
62 dictionary_suggestions = other.dictionary_suggestions;
63 spellcheck_enabled = other.spellcheck_enabled;
64 is_editable = other.is_editable;
66 is_text_node = other.is_text_node;
68 writing_direction_default = other.writing_direction_default;
69 writing_direction_left_to_right = other.writing_direction_left_to_right;
70 writing_direction_right_to_left = other.writing_direction_right_to_left;
71 edit_flags = other.edit_flags;
72 frame_charset = other.frame_charset;
73 referrer_policy = other.referrer_policy;
74 link_followed = other.link_followed;
75 for (auto& item : other.custom_items)
76 custom_items.push_back(item.Clone());
77 source_type = other.source_type;
78 input_field_type = other.input_field_type;
79 selection_rect = other.selection_rect;
80 selection_start_offset = other.selection_start_offset;
81 opened_from_highlight = other.opened_from_highlight;
82 form_renderer_id = other.form_renderer_id;
83 field_renderer_id = other.field_renderer_id;
86 UntrustworthyContextMenuParams::~UntrustworthyContextMenuParams() = default;