[M108 Migration][Text Selection] Selection handles & Caret Selection
[platform/framework/web/chromium-efl.git] / third_party / blink / common / context_menu_data / untrustworthy_context_menu_params.cc
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.
4
5 #include "third_party/blink/public/common/context_menu_data/untrustworthy_context_menu_params.h"
6
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"
9
10 namespace blink {
11
12 UntrustworthyContextMenuParams::UntrustworthyContextMenuParams()
13     : media_type(blink::mojom::ContextMenuDataMediaType::kNone),
14       x(0),
15       y(0),
16       has_image_contents(false),
17       media_flags(0),
18       spellcheck_enabled(false),
19       is_editable(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),
26       edit_flags(0),
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) {}
31
32 UntrustworthyContextMenuParams::UntrustworthyContextMenuParams(
33     const UntrustworthyContextMenuParams& other) {
34   Assign(other);
35 }
36
37 UntrustworthyContextMenuParams& UntrustworthyContextMenuParams::operator=(
38     const UntrustworthyContextMenuParams& other) {
39   if (&other == this)
40     return *this;
41   Assign(other);
42   return *this;
43 }
44
45 void UntrustworthyContextMenuParams::Assign(
46     const UntrustworthyContextMenuParams& other) {
47   media_type = other.media_type;
48   x = other.x;
49   y = other.y;
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;
65 #if BUILDFLAG(IS_EFL)
66   is_text_node = other.is_text_node;
67 #endif
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;
84 }
85
86 UntrustworthyContextMenuParams::~UntrustworthyContextMenuParams() = default;
87
88 }  // namespace blink