Index: headless/app/headless_shell.cc |
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc |
index f8145054054325e9a5ccaa029622485a36f86b0f..f596ae2a7e707a4d7ea8852d467bedbb9cc4b097 100644 |
--- a/headless/app/headless_shell.cc |
+++ b/headless/app/headless_shell.cc |
@@ -56,17 +56,14 @@ class HeadlessShell : public HeadlessWebContents::Observer, page::Observer { |
void OnStart(HeadlessBrowser* browser) { |
browser_ = browser; |
+ HeadlessWebContents::Builder builder(browser_->CreateWebContentsBuilder()); |
base::CommandLine::StringVector args = |
base::CommandLine::ForCurrentProcess()->GetArgs(); |
- const char kDefaultUrl[] = "about:blank"; |
- if (args.empty() || args[0].empty()) { |
- url_ = GURL(kDefaultUrl); |
- } else { |
- url_ = GURL(args[0]); |
- } |
+ if (!args.empty() && !args[0].empty()) |
+ builder.SetInitialURL(GURL(args[0])); |
- web_contents_ = browser->CreateWebContents(url_, gfx::Size(800, 600)); |
+ web_contents_ = builder.Build(); |
if (!web_contents_) { |
LOG(ERROR) << "Navigation failed"; |
browser_->Shutdown(); |