Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / content / public / common / context_menu_params.cc
blob3414cca070447c822955ad12e3efd3b3a0a4e370
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.
5 #include "content/public/common/context_menu_params.h"
7 #include "content/common/ssl_status_serialization.h"
8 #include "webkit/glue/glue_serialize.h"
10 namespace content {
12 const int32 CustomContextMenuContext::kCurrentRenderWidget = kint32max;
14 CustomContextMenuContext::CustomContextMenuContext()
15 : is_pepper_menu(false),
16 request_id(0),
17 render_widget_id(kCurrentRenderWidget) {
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) {
34 ContextMenuParams::~ContextMenuParams() {
37 ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data)
38 : media_type(data.mediaType),
39 x(data.mousePosition.x),
40 y(data.mousePosition.y),
41 link_url(data.linkURL),
42 unfiltered_link_url(data.linkURL),
43 src_url(data.srcURL),
44 is_image_blocked(data.isImageBlocked),
45 page_url(data.pageURL),
46 keyword_url(data.keywordURL),
47 frame_url(data.frameURL),
48 frame_id(0),
49 media_flags(data.mediaFlags),
50 selection_text(data.selectedText),
51 misspelled_word(data.misspelledWord),
52 speech_input_enabled(data.isSpeechInputEnabled),
53 spellcheck_enabled(data.isSpellCheckingEnabled),
54 is_editable(data.isEditable),
55 #if defined(OS_MACOSX)
56 writing_direction_default(data.writingDirectionDefault),
57 writing_direction_left_to_right(data.writingDirectionLeftToRight),
58 writing_direction_right_to_left(data.writingDirectionRightToLeft),
59 #endif // OS_MACOSX
60 edit_flags(data.editFlags),
61 frame_charset(data.frameEncoding.utf8()),
62 referrer_policy(data.referrerPolicy) {
63 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i)
64 dictionary_suggestions.push_back(data.dictionarySuggestions[i]);
66 custom_context.is_pepper_menu = false;
67 for (size_t i = 0; i < data.customItems.size(); ++i)
68 custom_items.push_back(WebMenuItem(data.customItems[i]));
70 if (!data.frameHistoryItem.isNull()) {
71 frame_content_state =
72 webkit_glue::HistoryItemToString(data.frameHistoryItem);
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);
85 } // namespace content