Commit 5066ed5f authored by darin@chromium.org's avatar darin@chromium.org

Make it possible to launch content_shell.exe with an URL on the command line.

R=jam@chromium.org

Review URL: http://codereview.chromium.org/8636019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111292 0039d316-1c4b-4281-b951-d872f2087c98
parent 03f5c757
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "content/shell/shell_browser_main.h" #include "content/shell/shell_browser_main.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
...@@ -20,6 +21,15 @@ ...@@ -20,6 +21,15 @@
namespace content { 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( ShellBrowserMainParts::ShellBrowserMainParts(
const content::MainFunctionParams& parameters) const content::MainFunctionParams& parameters)
: BrowserMainParts() { : BrowserMainParts() {
...@@ -71,7 +81,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() { ...@@ -71,7 +81,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider);
Shell::CreateNewWindow(browser_context_.get(), Shell::CreateNewWindow(browser_context_.get(),
GURL("http://www.google.com"), GetStartupURL(),
NULL, NULL,
MSG_ROUTING_NONE, MSG_ROUTING_NONE,
NULL); NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment