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