| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/context_menu_params_builder.h" | 5 #include "content/renderer/context_menu_params_builder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/common/ssl_status_serialization.h" | 8 #include "content/common/ssl_status_serialization.h" |
| 9 #include "content/public/common/context_menu_params.h" | 9 #include "content/public/common/context_menu_params.h" |
| 10 #include "content/public/renderer/content_renderer_client.h" | 10 #include "content/public/renderer/content_renderer_client.h" |
| 11 #include "content/renderer/dom_utils.h" | 11 #include "content/renderer/dom_utils.h" |
| 12 #include "content/renderer/history_serialization.h" | 12 #include "content/renderer/history_serialization.h" |
| 13 #include "content/renderer/menu_item_builder.h" | 13 #include "content/renderer/menu_item_builder.h" |
| 14 #include "third_party/WebKit/public/web/WebElement.h" | 14 #include "third_party/WebKit/public/web/WebElement.h" |
| 15 #include "third_party/WebKit/public/web/WebInputElement.h" |
| 15 #include "third_party/WebKit/public/web/WebNode.h" | 16 #include "third_party/WebKit/public/web/WebNode.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 // static | 20 // static |
| 20 ContextMenuParams ContextMenuParamsBuilder::Build( | 21 ContextMenuParams ContextMenuParamsBuilder::Build( |
| 21 const blink::WebContextMenuData& data) { | 22 const blink::WebContextMenuData& data) { |
| 22 ContextMenuParams params; | 23 ContextMenuParams params; |
| 23 params.media_type = data.mediaType; | 24 params.media_type = data.mediaType; |
| 24 params.x = data.mousePosition.x; | 25 params.x = data.mousePosition.x; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 params.misspelling_hash = data.misspellingHash; | 38 params.misspelling_hash = data.misspellingHash; |
| 38 params.spellcheck_enabled = data.isSpellCheckingEnabled; | 39 params.spellcheck_enabled = data.isSpellCheckingEnabled; |
| 39 params.is_editable = data.isEditable; | 40 params.is_editable = data.isEditable; |
| 40 params.writing_direction_default = data.writingDirectionDefault; | 41 params.writing_direction_default = data.writingDirectionDefault; |
| 41 params.writing_direction_left_to_right = data.writingDirectionLeftToRight; | 42 params.writing_direction_left_to_right = data.writingDirectionLeftToRight; |
| 42 params.writing_direction_right_to_left = data.writingDirectionRightToLeft; | 43 params.writing_direction_right_to_left = data.writingDirectionRightToLeft; |
| 43 params.edit_flags = data.editFlags; | 44 params.edit_flags = data.editFlags; |
| 44 params.frame_charset = data.frameEncoding.utf8(); | 45 params.frame_charset = data.frameEncoding.utf8(); |
| 45 params.referrer_policy = data.referrerPolicy; | 46 params.referrer_policy = data.referrerPolicy; |
| 46 params.suggested_filename = data.suggestedFilename; | 47 params.suggested_filename = data.suggestedFilename; |
| 48 params.input_field_type = data.inputFieldType; |
| 47 | 49 |
| 48 if (!data.imageResponse.isNull()) { | 50 if (!data.imageResponse.isNull()) { |
| 49 GetContentClient()->renderer()->AddImageContextMenuProperties( | 51 GetContentClient()->renderer()->AddImageContextMenuProperties( |
| 50 data.imageResponse, ¶ms.properties); | 52 data.imageResponse, ¶ms.properties); |
| 51 } | 53 } |
| 52 | 54 |
| 53 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) | 55 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) |
| 54 params.dictionary_suggestions.push_back(data.dictionarySuggestions[i]); | 56 params.dictionary_suggestions.push_back(data.dictionarySuggestions[i]); |
| 55 | 57 |
| 56 params.custom_context.is_pepper_menu = false; | 58 params.custom_context.is_pepper_menu = false; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 80 ¶ms.security_info.cert_id, ¶ms.security_info.cert_status, | 82 ¶ms.security_info.cert_id, ¶ms.security_info.cert_status, |
| 81 ¶ms.security_info.security_bits, | 83 ¶ms.security_info.security_bits, |
| 82 ¶ms.security_info.connection_status, | 84 ¶ms.security_info.connection_status, |
| 83 ¶ms.security_info.signed_certificate_timestamp_ids); | 85 ¶ms.security_info.signed_certificate_timestamp_ids); |
| 84 } | 86 } |
| 85 | 87 |
| 86 return params; | 88 return params; |
| 87 } | 89 } |
| 88 | 90 |
| 89 } // namespace content | 91 } // namespace content |
| OLD | NEW |