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

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: updates 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
« no previous file with comments | « content/shell/shell.h ('k') | content/shell/shell_content_browser_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell.cc
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index fcf684ce5e5d825b054f0f8a805e6decb3c1fb10..34e0e4477f8b475a75561e3d090bac26c90b1d3b 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -4,11 +4,15 @@
#include "content/shell/shell.h"
+#include "base/command_line.h"
#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 "content/shell/shell_switches.h"
#include "ui/gfx/size.h"
// Content area size for newly created windows.
@@ -19,8 +23,9 @@ namespace content {
std::vector<Shell*> Shell::windows_;
-Shell::Shell()
- : window_(NULL),
+Shell::Shell(TabContents* tab_contents)
+ : WebContentsObserver(tab_contents),
+ window_(NULL),
url_edit_view_(NULL)
#if defined(OS_WIN)
, default_edit_wnd_proc_(0)
@@ -41,7 +46,7 @@ Shell::~Shell() {
}
Shell* Shell::CreateShell(TabContents* tab_contents) {
- Shell* shell = new Shell();
+ Shell* shell = new Shell(tab_contents);
shell->PlatformCreateWindow(kTestWindowWidth, kTestWindowHeight);
shell->tab_contents_.reset(tab_contents);
@@ -130,4 +135,16 @@ void Shell::UpdatePreferredSize(WebContents* source,
PlatformSizeTo(pref_size.width(), pref_size.height());
}
+void Shell::DidFinishLoad(int64 frame_id,
+ const GURL& validated_url,
+ bool is_main_frame) {
+ if (!is_main_frame)
+ return;
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ return;
+ RenderViewHost* render_view_host = tab_contents_->GetRenderViewHost();
+ render_view_host->Send(
+ new ShellViewMsg_CaptureTextDump(render_view_host->routing_id(), false));
+}
+
} // namespace content
« no previous file with comments | « content/shell/shell.h ('k') | content/shell/shell_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698