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

Unified Diff: chrome/renderer/chrome_render_frame_observer.cc

Issue 1672073003: Shunt string-dumping functions from WebFrame to a side class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added/updated TODOs. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/test_runner/layout_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_frame_observer.cc
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc
index 9fd19893f6daa9b2a071ad61e512ce34570c44f0..9085354b62277683f37401cad42a8e059733af42 100644
--- a/chrome/renderer/chrome_render_frame_observer.cc
+++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -32,6 +32,7 @@
#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
+#include "third_party/WebKit/public/web/WebFrameContentDumper.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebNode.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
@@ -47,6 +48,7 @@
using blink::WebDataSource;
using blink::WebElement;
+using blink::WebFrameContentDumper;
using blink::WebLocalFrame;
using blink::WebNode;
using blink::WebString;
@@ -354,7 +356,10 @@ void ChromeRenderFrameObserver::CapturePageText(TextCaptureType capture_type) {
// Retrieve the frame's full text (up to kMaxIndexChars), and pass it to the
// translate helper for language detection and possible translation.
- base::string16 contents = frame->contentAsText(kMaxIndexChars);
+ // TODO(dglazkov): WebFrameContentDumper should only be used for
+ // testing purposes. See http://crbug.com/585164.
+ base::string16 contents =
+ WebFrameContentDumper::dumpFrameTreeAsText(frame, kMaxIndexChars);
UMA_HISTOGRAM_TIMES(kTranslateCaptureText,
base::TimeTicks::Now() - capture_begin_time);
« no previous file with comments | « no previous file | components/test_runner/layout_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698