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

Unified Diff: content/shell/shell_browser_main.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_browser_main.cc
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
index 311b6a0d813df1cab64e86fbd7d4611809fd8484..8357915c6a1001bcb8f5c8f0b8895e4b65efee81 100644
--- a/content/shell/shell_browser_main.cc
+++ b/content/shell/shell_browser_main.cc
@@ -13,9 +13,11 @@
#include "content/browser/download/download_file_manager.h"
#include "content/browser/download/save_file_manager.h"
#include "content/browser/plugin_service_impl.h"
+#include "content/public/common/main_function_params.h"
#include "content/shell/shell.h"
#include "content/shell/shell_browser_context.h"
#include "content/shell/shell_content_browser_client.h"
+#include "content/shell/shell_switches.h"
#include "net/base/net_module.h"
#include "ui/base/clipboard/clipboard.h"
@@ -32,7 +34,8 @@ static GURL GetStartupURL() {
ShellBrowserMainParts::ShellBrowserMainParts(
const content::MainFunctionParams& parameters)
- : BrowserMainParts() {
+ : BrowserMainParts(),
+ dump_as_text_(parameters.command_line.HasSwitch(switches::kTree)) {
ShellContentBrowserClient* shell_browser_client =
static_cast<ShellContentBrowserClient*>(
content::GetContentClient()->browser());
@@ -48,11 +51,12 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
Shell::PlatformInitialize();
net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider);
- Shell::CreateNewWindow(browser_context_.get(),
- GetStartupURL(),
- NULL,
- MSG_ROUTING_NONE,
- NULL);
+ Shell* shell = Shell::CreateNewWindow(browser_context_.get(),
+ GetStartupURL(),
+ NULL,
+ MSG_ROUTING_NONE,
+ NULL);
+ shell->SetDumpAsText(dump_as_text_);
}
void ShellBrowserMainParts::PostMainMessageLoopRun() {

Powered by Google App Engine
This is Rietveld 408576698