OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 gfx::Size Shell::AdjustWindowSize(const gfx::Size& initial_size) { | 148 gfx::Size Shell::AdjustWindowSize(const gfx::Size& initial_size) { |
149 if (!initial_size.IsEmpty()) | 149 if (!initial_size.IsEmpty()) |
150 return initial_size; | 150 return initial_size; |
151 return gfx::Size(kDefaultTestWindowWidthDip, kDefaultTestWindowHeightDip); | 151 return gfx::Size(kDefaultTestWindowWidthDip, kDefaultTestWindowHeightDip); |
152 } | 152 } |
153 | 153 |
154 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, | 154 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, |
155 const GURL& url, | 155 const GURL& url, |
156 SiteInstance* site_instance, | 156 SiteInstance* site_instance, |
157 int routing_id, | |
158 const gfx::Size& initial_size) { | 157 const gfx::Size& initial_size) { |
159 WebContents::CreateParams create_params(browser_context, site_instance); | 158 WebContents::CreateParams create_params(browser_context, site_instance); |
160 create_params.routing_id = routing_id; | |
161 create_params.initial_size = AdjustWindowSize(initial_size); | 159 create_params.initial_size = AdjustWindowSize(initial_size); |
162 WebContents* web_contents = WebContents::Create(create_params); | 160 WebContents* web_contents = WebContents::Create(create_params); |
163 Shell* shell = CreateShell(web_contents, create_params.initial_size); | 161 Shell* shell = CreateShell(web_contents, create_params.initial_size); |
164 if (!url.is_empty()) | 162 if (!url.is_empty()) |
165 shell->LoadURL(url); | 163 shell->LoadURL(url); |
166 return shell; | 164 return shell; |
167 } | 165 } |
168 | 166 |
169 void Shell::LoadURL(const GURL& url) { | 167 void Shell::LoadURL(const GURL& url) { |
170 LoadURLForFrame(url, std::string()); | 168 LoadURLForFrame(url, std::string()); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 devtools_frontend_->Activate(); | 398 devtools_frontend_->Activate(); |
401 devtools_frontend_->Focus(); | 399 devtools_frontend_->Focus(); |
402 } | 400 } |
403 | 401 |
404 void Shell::OnDevToolsWebContentsDestroyed() { | 402 void Shell::OnDevToolsWebContentsDestroyed() { |
405 devtools_observer_.reset(); | 403 devtools_observer_.reset(); |
406 devtools_frontend_ = NULL; | 404 devtools_frontend_ = NULL; |
407 } | 405 } |
408 | 406 |
409 } // namespace content | 407 } // namespace content |
OLD | NEW |