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

Unified Diff: content/shell/shell_browser_main.cc

Issue 8636019: Make it possible to launch content_shell.exe with an URL on the command line. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_browser_main.cc
===================================================================
--- content/shell/shell_browser_main.cc (revision 110974)
+++ content/shell/shell_browser_main.cc (working copy)
@@ -5,6 +5,7 @@
#include "content/shell/shell_browser_main.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
@@ -20,6 +21,15 @@
namespace content {
+static GURL GetStartupURL() {
+ const CommandLine::StringVector& args =
+ CommandLine::ForCurrentProcess()->GetArgs();
+ if (args.empty())
+ return GURL("http://www.google.com/");
+
+ return GURL(args[0]);
+}
+
ShellBrowserMainParts::ShellBrowserMainParts(
const content::MainFunctionParams& parameters)
: BrowserMainParts() {
@@ -71,7 +81,7 @@
net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider);
Shell::CreateNewWindow(browser_context_.get(),
- GURL("http://www.google.com"),
+ GetStartupURL(),
NULL,
MSG_ROUTING_NONE,
NULL);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698