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

Unified Diff: content/shell/shell.cc

Issue 9289045: Add option --dump-render-tree to content_shell to dump the render tree as text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
Index: content/shell/shell.cc
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index fcf684ce5e5d825b054f0f8a805e6decb3c1fb10..8677ae47a7a0de4555d6b2e15da1914199f5f7ab 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -7,8 +7,10 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/navigation_controller_impl.h"
#include "content/browser/tab_contents/tab_contents.h"
+#include "content/shell/shell_messages.h"
#include "ui/gfx/size.h"
// Content area size for newly created windows.
@@ -103,6 +105,10 @@ void Shell::UpdateNavigationControls() {
PlatformEnableUIControl(STOP_BUTTON, tab_contents_->IsLoading());
}
+void Shell::SetDumpAsText(bool dump_as_text) {
+ dump_as_text_ = dump_as_text;
+}
+
gfx::NativeView Shell::GetContentView() {
if (!tab_contents_.get())
return NULL;
@@ -114,6 +120,14 @@ void Shell::LoadingStateChanged(WebContents* source) {
PlatformSetIsLoading(source->IsLoading());
}
+void Shell::DidFinishLoad(WebContents* source) {
+ if (!dump_as_text_)
+ return;
+ RenderViewHost* render_view_host = source->GetRenderViewHost();
+ render_view_host->Send(
+ new ShellViewMsg_CaptureTextDump(render_view_host->routing_id(), false));
+}
+
void Shell::WebContentsCreated(WebContents* source_contents,
int64 source_frame_id,
const GURL& target_url,

Powered by Google App Engine
This is Rietveld 408576698