| 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/renderer/history_serialization.h" | 10 #include "content/renderer/history_serialization.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 params.frame_charset = data.frameEncoding.utf8(); | 42 params.frame_charset = data.frameEncoding.utf8(); |
| 43 params.referrer_policy = data.referrerPolicy; | 43 params.referrer_policy = data.referrerPolicy; |
| 44 | 44 |
| 45 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) | 45 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) |
| 46 params.dictionary_suggestions.push_back(data.dictionarySuggestions[i]); | 46 params.dictionary_suggestions.push_back(data.dictionarySuggestions[i]); |
| 47 | 47 |
| 48 params.custom_context.is_pepper_menu = false; | 48 params.custom_context.is_pepper_menu = false; |
| 49 for (size_t i = 0; i < data.customItems.size(); ++i) | 49 for (size_t i = 0; i < data.customItems.size(); ++i) |
| 50 params.custom_items.push_back(MenuItemBuilder::Build(data.customItems[i])); | 50 params.custom_items.push_back(MenuItemBuilder::Build(data.customItems[i])); |
| 51 | 51 |
| 52 if (!data.frameHistoryItem.isNull()) | 52 if (!data.frameHistoryItem.isNull()) { |
| 53 params.frame_page_state = HistoryItemToPageState(data.frameHistoryItem); | 53 params.frame_page_state = |
| 54 SingleHistoryItemToPageState(data.frameHistoryItem); |
| 55 } |
| 54 | 56 |
| 55 if (!params.link_url.is_empty()) { | 57 if (!params.link_url.is_empty()) { |
| 56 blink::WebNode selectedNode = data.node; | 58 blink::WebNode selectedNode = data.node; |
| 57 | 59 |
| 58 // If there are other embedded tags (like <a ..>Some <b>text</b></a>) | 60 // If there are other embedded tags (like <a ..>Some <b>text</b></a>) |
| 59 // we need to extract the parent <a/> node. | 61 // we need to extract the parent <a/> node. |
| 60 while (!selectedNode.isLink() && !selectedNode.parentNode().isNull()) { | 62 while (!selectedNode.isLink() && !selectedNode.parentNode().isNull()) { |
| 61 selectedNode = selectedNode.parentNode(); | 63 selectedNode = selectedNode.parentNode(); |
| 62 } | 64 } |
| 63 | 65 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 77 ¶ms.security_info.cert_id, ¶ms.security_info.cert_status, | 79 ¶ms.security_info.cert_id, ¶ms.security_info.cert_status, |
| 78 ¶ms.security_info.security_bits, | 80 ¶ms.security_info.security_bits, |
| 79 ¶ms.security_info.connection_status, | 81 ¶ms.security_info.connection_status, |
| 80 ¶ms.security_info.signed_certificate_timestamp_ids); | 82 ¶ms.security_info.signed_certificate_timestamp_ids); |
| 81 } | 83 } |
| 82 | 84 |
| 83 return params; | 85 return params; |
| 84 } | 86 } |
| 85 | 87 |
| 86 } // namespace content | 88 } // namespace content |
| OLD | NEW |