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/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
16 #include "content/public/browser/devtools_agent_host.h" | 16 #include "content/public/browser/devtools_agent_host.h" |
17 #include "content/public/browser/navigation_controller.h" | 17 #include "content/public/browser/navigation_controller.h" |
18 #include "content/public/browser/navigation_entry.h" | 18 #include "content/public/browser/navigation_entry.h" |
19 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
20 #include "content/public/browser/render_widget_host.h" | 20 #include "content/public/browser/render_widget_host.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
| 23 #include "content/public/browser/web_contents_source.h" |
23 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
24 #include "content/public/common/renderer_preferences.h" | 25 #include "content/public/common/renderer_preferences.h" |
25 #include "content/public/common/webrtc_ip_handling_policy.h" | 26 #include "content/public/common/webrtc_ip_handling_policy.h" |
26 #include "content/shell/browser/blink_test_controller.h" | 27 #include "content/shell/browser/blink_test_controller.h" |
27 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor
y.h" | 28 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor
y.h" |
28 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 29 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
29 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage
r.h" | 30 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage
r.h" |
30 #include "content/shell/browser/notify_done_forwarder.h" | 31 #include "content/shell/browser/notify_done_forwarder.h" |
31 #include "content/shell/browser/shell_browser_main_parts.h" | 32 #include "content/shell/browser/shell_browser_main_parts.h" |
32 #include "content/shell/browser/shell_content_browser_client.h" | 33 #include "content/shell/browser/shell_content_browser_client.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 return GetShellDefaultSize(); | 167 return GetShellDefaultSize(); |
167 } | 168 } |
168 | 169 |
169 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, | 170 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, |
170 const GURL& url, | 171 const GURL& url, |
171 SiteInstance* site_instance, | 172 SiteInstance* site_instance, |
172 const gfx::Size& initial_size) { | 173 const gfx::Size& initial_size) { |
173 WebContents::CreateParams create_params(browser_context, site_instance); | 174 WebContents::CreateParams create_params(browser_context, site_instance); |
174 create_params.initial_size = AdjustWindowSize(initial_size); | 175 create_params.initial_size = AdjustWindowSize(initial_size); |
175 WebContents* web_contents = WebContents::Create(create_params); | 176 WebContents* web_contents = WebContents::Create(create_params); |
| 177 WebContentsSource::CreateForWebContentsAndLocation(web_contents, FROM_HERE); |
176 Shell* shell = CreateShell(web_contents, create_params.initial_size); | 178 Shell* shell = CreateShell(web_contents, create_params.initial_size); |
177 if (!url.is_empty()) | 179 if (!url.is_empty()) |
178 shell->LoadURL(url); | 180 shell->LoadURL(url); |
179 return shell; | 181 return shell; |
180 } | 182 } |
181 | 183 |
182 void Shell::LoadURL(const GURL& url) { | 184 void Shell::LoadURL(const GURL& url) { |
183 LoadURLForFrame(url, std::string()); | 185 LoadURLForFrame(url, std::string()); |
184 } | 186 } |
185 | 187 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 devtools_frontend_->Activate(); | 442 devtools_frontend_->Activate(); |
441 devtools_frontend_->Focus(); | 443 devtools_frontend_->Focus(); |
442 } | 444 } |
443 | 445 |
444 void Shell::OnDevToolsWebContentsDestroyed() { | 446 void Shell::OnDevToolsWebContentsDestroyed() { |
445 devtools_observer_.reset(); | 447 devtools_observer_.reset(); |
446 devtools_frontend_ = NULL; | 448 devtools_frontend_ = NULL; |
447 } | 449 } |
448 | 450 |
449 } // namespace content | 451 } // namespace content |
OLD | NEW |