OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/glue/context_menu.h" | 5 #include "webkit/glue/context_menu.h" |
6 #include "webkit/glue/glue_serialize.h" | 6 #include "webkit/glue/glue_serialize.h" |
7 | 7 |
8 namespace webkit_glue { | 8 namespace webkit_glue { |
9 | 9 |
10 const int32 CustomContextMenuContext::kCurrentRenderWidget = kint32max; | 10 const int32 CustomContextMenuContext::kCurrentRenderWidget = kint32max; |
11 | 11 |
12 CustomContextMenuContext::CustomContextMenuContext() | 12 CustomContextMenuContext::CustomContextMenuContext() |
13 : is_pepper_menu(false), | 13 : is_pepper_menu(false), |
14 request_id(0), | 14 request_id(0), |
15 render_widget_id(kCurrentRenderWidget) { | 15 render_widget_id(kCurrentRenderWidget) { |
16 } | 16 } |
17 | 17 |
18 } // namespace webkit_glue | 18 } // namespace webkit_glue |
19 | 19 |
20 ContextMenuParams::ContextMenuParams() | 20 ContextMenuParams::ContextMenuParams() |
21 : media_type(WebKit::WebContextMenuData::MediaTypeNone), | 21 : media_type(WebKit::WebContextMenuData::MediaTypeNone), |
22 x(0), | 22 x(0), |
23 y(0), | 23 y(0), |
24 is_image_blocked(false), | 24 is_image_blocked(false), |
25 frame_id(0), | 25 frame_id(0), |
26 media_flags(0), | 26 media_flags(0), |
27 spellcheck_enabled(false), | 27 spellcheck_enabled(false), |
28 is_editable(false), | 28 is_editable(false), |
29 edit_flags(0) { | 29 edit_flags(0), |
| 30 referrer_policy(WebKit::WebReferrerPolicyDefault) { |
30 } | 31 } |
31 | 32 |
32 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data) | 33 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data) |
33 : media_type(data.mediaType), | 34 : media_type(data.mediaType), |
34 x(data.mousePosition.x), | 35 x(data.mousePosition.x), |
35 y(data.mousePosition.y), | 36 y(data.mousePosition.y), |
36 link_url(data.linkURL), | 37 link_url(data.linkURL), |
37 unfiltered_link_url(data.linkURL), | 38 unfiltered_link_url(data.linkURL), |
38 src_url(data.srcURL), | 39 src_url(data.srcURL), |
39 is_image_blocked(data.isImageBlocked), | 40 is_image_blocked(data.isImageBlocked), |
40 page_url(data.pageURL), | 41 page_url(data.pageURL), |
41 keyword_url(data.keywordURL), | 42 keyword_url(data.keywordURL), |
42 frame_url(data.frameURL), | 43 frame_url(data.frameURL), |
43 frame_id(0), | 44 frame_id(0), |
44 media_flags(data.mediaFlags), | 45 media_flags(data.mediaFlags), |
45 selection_text(data.selectedText), | 46 selection_text(data.selectedText), |
46 misspelled_word(data.misspelledWord), | 47 misspelled_word(data.misspelledWord), |
47 speech_input_enabled(data.isSpeechInputEnabled), | 48 speech_input_enabled(data.isSpeechInputEnabled), |
48 spellcheck_enabled(data.isSpellCheckingEnabled), | 49 spellcheck_enabled(data.isSpellCheckingEnabled), |
49 is_editable(data.isEditable), | 50 is_editable(data.isEditable), |
50 #if defined(OS_MACOSX) | 51 #if defined(OS_MACOSX) |
51 writing_direction_default(data.writingDirectionDefault), | 52 writing_direction_default(data.writingDirectionDefault), |
52 writing_direction_left_to_right(data.writingDirectionLeftToRight), | 53 writing_direction_left_to_right(data.writingDirectionLeftToRight), |
53 writing_direction_right_to_left(data.writingDirectionRightToLeft), | 54 writing_direction_right_to_left(data.writingDirectionRightToLeft), |
54 #endif // OS_MACOSX | 55 #endif // OS_MACOSX |
55 edit_flags(data.editFlags), | 56 edit_flags(data.editFlags), |
56 security_info(data.securityInfo), | 57 security_info(data.securityInfo), |
57 frame_charset(data.frameEncoding.utf8()) { | 58 frame_charset(data.frameEncoding.utf8()), |
| 59 referrer_policy(data.referrerPolicy) { |
58 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) | 60 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) |
59 dictionary_suggestions.push_back(data.dictionarySuggestions[i]); | 61 dictionary_suggestions.push_back(data.dictionarySuggestions[i]); |
60 | 62 |
61 custom_context.is_pepper_menu = false; | 63 custom_context.is_pepper_menu = false; |
62 for (size_t i = 0; i < data.customItems.size(); ++i) | 64 for (size_t i = 0; i < data.customItems.size(); ++i) |
63 custom_items.push_back(WebMenuItem(data.customItems[i])); | 65 custom_items.push_back(WebMenuItem(data.customItems[i])); |
64 | 66 |
65 if (!data.frameHistoryItem.isNull()) { | 67 if (!data.frameHistoryItem.isNull()) { |
66 frame_content_state = | 68 frame_content_state = |
67 webkit_glue::HistoryItemToString(data.frameHistoryItem); | 69 webkit_glue::HistoryItemToString(data.frameHistoryItem); |
68 } | 70 } |
69 } | 71 } |
70 | 72 |
71 ContextMenuParams::~ContextMenuParams() { | 73 ContextMenuParams::~ContextMenuParams() { |
72 } | 74 } |
OLD | NEW |