| Index: content/shell/browser/shell.cc
|
| diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
|
| index c2967afd5997fd4e42fb3c52cb32a452b725aeac..efddc3e748f0c06d9367d4bd7ff20ceae8eb63b6 100644
|
| --- a/content/shell/browser/shell.cc
|
| +++ b/content/shell/browser/shell.cc
|
| @@ -39,6 +39,26 @@ base::Callback<void(Shell*)> Shell::shell_created_callback_;
|
|
|
| bool Shell::quit_message_loop_ = true;
|
|
|
| +namespace {
|
| +gfx::Size ShellDefaultSize() {
|
| + static gfx::Size default_shell_size;
|
| + if (!default_shell_size.IsEmpty())
|
| + return default_shell_size;
|
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| + if (command_line->HasSwitch(switches::kContentShellHostWindowSize)) {
|
| + const std::string size_str = command_line->GetSwitchValueASCII(
|
| + switches::kContentShellHostWindowSize);
|
| + int width, height;
|
| + CHECK_EQ(2, sscanf(size_str.c_str(), "%dx%d", &width, &height));
|
| + default_shell_size = gfx::Size(width, height);
|
| + } else {
|
| + default_shell_size = gfx::Size(
|
| + Shell::kDefaultTestWindowWidthDip, Shell::kDefaultTestWindowHeightDip);
|
| + }
|
| + return default_shell_size;
|
| +}
|
| +} // namespace
|
| +
|
| class Shell::DevToolsWebContentsObserver : public WebContentsObserver {
|
| public:
|
| DevToolsWebContentsObserver(Shell* shell, WebContents* web_contents)
|
| @@ -141,14 +161,13 @@ Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) {
|
|
|
| // static
|
| void Shell::Initialize() {
|
| - PlatformInitialize(
|
| - gfx::Size(kDefaultTestWindowWidthDip, kDefaultTestWindowHeightDip));
|
| + PlatformInitialize(ShellDefaultSize());
|
| }
|
|
|
| gfx::Size Shell::AdjustWindowSize(const gfx::Size& initial_size) {
|
| if (!initial_size.IsEmpty())
|
| return initial_size;
|
| - return gfx::Size(kDefaultTestWindowWidthDip, kDefaultTestWindowHeightDip);
|
| + return ShellDefaultSize();
|
| }
|
|
|
| Shell* Shell::CreateNewWindow(BrowserContext* browser_context,
|
|
|