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

Side by Side Diff: content/renderer/context_menu_params_builder.cc

Issue 1131993009: Remove the usage of WebElement::innerText in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed serializer test. Created 5 years, 7 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
« no previous file with comments | « no previous file | content/renderer/dom_serializer_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/dom_utils.h" 10 #include "content/renderer/dom_utils.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 if (!data.frameHistoryItem.isNull()) { 53 if (!data.frameHistoryItem.isNull()) {
54 params.frame_page_state = 54 params.frame_page_state =
55 SingleHistoryItemToPageState(data.frameHistoryItem); 55 SingleHistoryItemToPageState(data.frameHistoryItem);
56 } 56 }
57 57
58 if (!params.link_url.is_empty()) { 58 if (!params.link_url.is_empty()) {
59 blink::WebNode selectedNode = DomUtils::ExtractParentAnchorNode(data.node); 59 blink::WebNode selectedNode = DomUtils::ExtractParentAnchorNode(data.node);
60 blink::WebElement selectedElement = selectedNode.to<blink::WebElement>(); 60 blink::WebElement selectedElement = selectedNode.to<blink::WebElement>();
61 if (!selectedElement.isNull() && selectedNode.isLink()) { 61 if (!selectedElement.isNull() && selectedNode.isLink()) {
62 params.link_text = selectedElement.innerText(); 62 params.link_text = selectedElement.textContent();
63 } else { 63 } else {
64 LOG(ERROR) << "Creating a ContextMenuParams for a node that has a link" 64 LOG(ERROR) << "Creating a ContextMenuParams for a node that has a link"
65 << "url but is not an ElementNode or does not have an" 65 << "url but is not an ElementNode or does not have an"
66 << "ancestor that is a link."; 66 << "ancestor that is a link.";
67 } 67 }
68 } 68 }
69 69
70 // Deserialize the SSL info. 70 // Deserialize the SSL info.
71 if (!data.securityInfo.isEmpty()) { 71 if (!data.securityInfo.isEmpty()) {
72 DeserializeSecurityInfo(data.securityInfo, 72 DeserializeSecurityInfo(data.securityInfo,
73 &params.security_info.cert_id, &params.security_info.cert_status, 73 &params.security_info.cert_id, &params.security_info.cert_status,
74 &params.security_info.security_bits, 74 &params.security_info.security_bits,
75 &params.security_info.connection_status, 75 &params.security_info.connection_status,
76 &params.security_info.signed_certificate_timestamp_ids); 76 &params.security_info.signed_certificate_timestamp_ids);
77 } 77 }
78 78
79 return params; 79 return params;
80 } 80 }
81 81
82 } // namespace content 82 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/dom_serializer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698