Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: content/public/common/context_menu_params.cc

Issue 9382037: Move ContextMenuParams struct from webkit/glue to content/public/common. The reasons are: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/public/common/context_menu_params.h"
6
7 #include "content/common/ssl_status_serialization.h"
6 #include "webkit/glue/glue_serialize.h" 8 #include "webkit/glue/glue_serialize.h"
7 9
8 namespace webkit_glue { 10 namespace content {
9 11
10 const int32 CustomContextMenuContext::kCurrentRenderWidget = kint32max; 12 const int32 CustomContextMenuContext::kCurrentRenderWidget = kint32max;
11 13
12 CustomContextMenuContext::CustomContextMenuContext() 14 CustomContextMenuContext::CustomContextMenuContext()
13 : is_pepper_menu(false), 15 : is_pepper_menu(false),
14 request_id(0), 16 request_id(0),
15 render_widget_id(kCurrentRenderWidget) { 17 render_widget_id(kCurrentRenderWidget) {
16 } 18 }
17 19
18 } // namespace webkit_glue
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 speech_input_enabled(false), 27 speech_input_enabled(false),
28 spellcheck_enabled(false), 28 spellcheck_enabled(false),
29 is_editable(false), 29 is_editable(false),
30 edit_flags(0), 30 edit_flags(0),
31 referrer_policy(WebKit::WebReferrerPolicyDefault) { 31 referrer_policy(WebKit::WebReferrerPolicyDefault) {
32 } 32 }
33 33
34 ContextMenuParams::~ContextMenuParams() {
35 }
36
34 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data) 37 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data)
35 : media_type(data.mediaType), 38 : media_type(data.mediaType),
36 x(data.mousePosition.x), 39 x(data.mousePosition.x),
37 y(data.mousePosition.y), 40 y(data.mousePosition.y),
38 link_url(data.linkURL), 41 link_url(data.linkURL),
39 unfiltered_link_url(data.linkURL), 42 unfiltered_link_url(data.linkURL),
40 src_url(data.srcURL), 43 src_url(data.srcURL),
41 is_image_blocked(data.isImageBlocked), 44 is_image_blocked(data.isImageBlocked),
42 page_url(data.pageURL), 45 page_url(data.pageURL),
43 keyword_url(data.keywordURL), 46 keyword_url(data.keywordURL),
44 frame_url(data.frameURL), 47 frame_url(data.frameURL),
45 frame_id(0), 48 frame_id(0),
46 media_flags(data.mediaFlags), 49 media_flags(data.mediaFlags),
47 selection_text(data.selectedText), 50 selection_text(data.selectedText),
48 misspelled_word(data.misspelledWord), 51 misspelled_word(data.misspelledWord),
49 speech_input_enabled(data.isSpeechInputEnabled), 52 speech_input_enabled(data.isSpeechInputEnabled),
50 spellcheck_enabled(data.isSpellCheckingEnabled), 53 spellcheck_enabled(data.isSpellCheckingEnabled),
51 is_editable(data.isEditable), 54 is_editable(data.isEditable),
52 #if defined(OS_MACOSX) 55 #if defined(OS_MACOSX)
53 writing_direction_default(data.writingDirectionDefault), 56 writing_direction_default(data.writingDirectionDefault),
54 writing_direction_left_to_right(data.writingDirectionLeftToRight), 57 writing_direction_left_to_right(data.writingDirectionLeftToRight),
55 writing_direction_right_to_left(data.writingDirectionRightToLeft), 58 writing_direction_right_to_left(data.writingDirectionRightToLeft),
56 #endif // OS_MACOSX 59 #endif // OS_MACOSX
57 edit_flags(data.editFlags), 60 edit_flags(data.editFlags),
58 security_info(data.securityInfo),
59 frame_charset(data.frameEncoding.utf8()), 61 frame_charset(data.frameEncoding.utf8()),
60 referrer_policy(data.referrerPolicy) { 62 referrer_policy(data.referrerPolicy) {
61 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) 63 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i)
62 dictionary_suggestions.push_back(data.dictionarySuggestions[i]); 64 dictionary_suggestions.push_back(data.dictionarySuggestions[i]);
63 65
64 custom_context.is_pepper_menu = false; 66 custom_context.is_pepper_menu = false;
65 for (size_t i = 0; i < data.customItems.size(); ++i) 67 for (size_t i = 0; i < data.customItems.size(); ++i)
66 custom_items.push_back(WebMenuItem(data.customItems[i])); 68 custom_items.push_back(WebMenuItem(data.customItems[i]));
67 69
68 if (!data.frameHistoryItem.isNull()) { 70 if (!data.frameHistoryItem.isNull()) {
69 frame_content_state = 71 frame_content_state =
70 webkit_glue::HistoryItemToString(data.frameHistoryItem); 72 webkit_glue::HistoryItemToString(data.frameHistoryItem);
71 } 73 }
74
75 // Deserialize the SSL info.
76 if (!data.securityInfo.isEmpty()) {
77 DeserializeSecurityInfo(data.securityInfo,
78 &security_info.cert_id,
79 &security_info.cert_status,
80 &security_info.security_bits,
81 &security_info.connection_status);
82 }
72 } 83 }
73 84
74 ContextMenuParams::~ContextMenuParams() { 85 } // namespace content
75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698