| 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 plugin_flags(0), |
| 27 spellcheck_enabled(false), | 28 spellcheck_enabled(false), |
| 28 is_editable(false), | 29 is_editable(false), |
| 29 edit_flags(0), | 30 edit_flags(0), |
| 30 referrer_policy(WebKit::WebReferrerPolicyDefault) { | 31 referrer_policy(WebKit::WebReferrerPolicyDefault) { |
| 31 } | 32 } |
| 32 | 33 |
| 33 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data) | 34 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data) |
| 34 : media_type(data.mediaType), | 35 : media_type(data.mediaType), |
| 35 x(data.mousePosition.x), | 36 x(data.mousePosition.x), |
| 36 y(data.mousePosition.y), | 37 y(data.mousePosition.y), |
| 37 link_url(data.linkURL), | 38 link_url(data.linkURL), |
| 38 unfiltered_link_url(data.linkURL), | 39 unfiltered_link_url(data.linkURL), |
| 39 src_url(data.srcURL), | 40 src_url(data.srcURL), |
| 40 is_image_blocked(data.isImageBlocked), | 41 is_image_blocked(data.isImageBlocked), |
| 41 page_url(data.pageURL), | 42 page_url(data.pageURL), |
| 42 keyword_url(data.keywordURL), | 43 keyword_url(data.keywordURL), |
| 43 frame_url(data.frameURL), | 44 frame_url(data.frameURL), |
| 44 frame_id(0), | 45 frame_id(0), |
| 45 media_flags(data.mediaFlags), | 46 media_flags(data.mediaFlags), |
| 47 plugin_flags(data.pluginFlags), |
| 46 selection_text(data.selectedText), | 48 selection_text(data.selectedText), |
| 47 misspelled_word(data.misspelledWord), | 49 misspelled_word(data.misspelledWord), |
| 48 speech_input_enabled(data.isSpeechInputEnabled), | 50 speech_input_enabled(data.isSpeechInputEnabled), |
| 49 spellcheck_enabled(data.isSpellCheckingEnabled), | 51 spellcheck_enabled(data.isSpellCheckingEnabled), |
| 50 is_editable(data.isEditable), | 52 is_editable(data.isEditable), |
| 51 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
| 52 writing_direction_default(data.writingDirectionDefault), | 54 writing_direction_default(data.writingDirectionDefault), |
| 53 writing_direction_left_to_right(data.writingDirectionLeftToRight), | 55 writing_direction_left_to_right(data.writingDirectionLeftToRight), |
| 54 writing_direction_right_to_left(data.writingDirectionRightToLeft), | 56 writing_direction_right_to_left(data.writingDirectionRightToLeft), |
| 55 #endif // OS_MACOSX | 57 #endif // OS_MACOSX |
| 56 edit_flags(data.editFlags), | 58 edit_flags(data.editFlags), |
| 57 security_info(data.securityInfo), | 59 security_info(data.securityInfo), |
| 58 frame_charset(data.frameEncoding.utf8()), | 60 frame_charset(data.frameEncoding.utf8()), |
| 59 referrer_policy(data.referrerPolicy) { | 61 referrer_policy(data.referrerPolicy) { |
| 60 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) | 62 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) |
| 61 dictionary_suggestions.push_back(data.dictionarySuggestions[i]); | 63 dictionary_suggestions.push_back(data.dictionarySuggestions[i]); |
| 62 | 64 |
| 63 custom_context.is_pepper_menu = false; | 65 custom_context.is_pepper_menu = false; |
| 64 for (size_t i = 0; i < data.customItems.size(); ++i) | 66 for (size_t i = 0; i < data.customItems.size(); ++i) |
| 65 custom_items.push_back(WebMenuItem(data.customItems[i])); | 67 custom_items.push_back(WebMenuItem(data.customItems[i])); |
| 66 | 68 |
| 67 if (!data.frameHistoryItem.isNull()) { | 69 if (!data.frameHistoryItem.isNull()) { |
| 68 frame_content_state = | 70 frame_content_state = |
| 69 webkit_glue::HistoryItemToString(data.frameHistoryItem); | 71 webkit_glue::HistoryItemToString(data.frameHistoryItem); |
| 70 } | 72 } |
| 71 } | 73 } |
| 72 | 74 |
| 73 ContextMenuParams::~ContextMenuParams() { | 75 ContextMenuParams::~ContextMenuParams() { |
| 74 } | 76 } |
| OLD | NEW |