OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell.h" | 5 #include "content/shell/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.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "content/public/browser/devtools_manager.h" | 15 #include "content/public/browser/devtools_manager.h" |
16 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
17 #include "content/public/browser/navigation_controller.h" | 17 #include "content/public/browser/navigation_controller.h" |
18 #include "content/public/browser/notification_details.h" | 18 #include "content/public/browser/notification_details.h" |
19 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
20 #include "content/public/browser/notification_types.h" | 20 #include "content/public/browser/notification_types.h" |
21 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
23 #include "content/public/browser/web_contents_view.h" | 23 #include "content/public/browser/web_contents_view.h" |
24 #include "content/public/common/renderer_preferences.h" | 24 #include "content/public/common/renderer_preferences.h" |
25 #include "content/shell/notify_done_forwarder.h" | |
25 #include "content/shell/shell_browser_main_parts.h" | 26 #include "content/shell/shell_browser_main_parts.h" |
26 #include "content/shell/shell_content_browser_client.h" | 27 #include "content/shell/shell_content_browser_client.h" |
27 #include "content/shell/shell_devtools_frontend.h" | 28 #include "content/shell/shell_devtools_frontend.h" |
28 #include "content/shell/shell_javascript_dialog_manager.h" | 29 #include "content/shell/shell_javascript_dialog_manager.h" |
29 #include "content/shell/shell_messages.h" | 30 #include "content/shell/shell_messages.h" |
30 #include "content/shell/shell_switches.h" | 31 #include "content/shell/shell_switches.h" |
31 #include "content/shell/webkit_test_controller.h" | 32 #include "content/shell/webkit_test_controller.h" |
32 | 33 |
33 // Content area size for newly created windows. | 34 // Content area size for newly created windows. |
34 static const int kTestWindowWidth = 800; | 35 static const int kTestWindowWidth = 800; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 return false; | 257 return false; |
257 #endif | 258 #endif |
258 } | 259 } |
259 | 260 |
260 void Shell::WebContentsCreated(WebContents* source_contents, | 261 void Shell::WebContentsCreated(WebContents* source_contents, |
261 int64 source_frame_id, | 262 int64 source_frame_id, |
262 const string16& frame_name, | 263 const string16& frame_name, |
263 const GURL& target_url, | 264 const GURL& target_url, |
264 WebContents* new_contents) { | 265 WebContents* new_contents) { |
265 CreateShell(new_contents); | 266 CreateShell(new_contents); |
267 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | |
Mike West
2013/04/08 13:50:50
Nit: I assume it's intentional that we're using kD
| |
268 NotifyDoneForwarder::CreateForWebContents(new_contents); | |
266 } | 269 } |
267 | 270 |
268 void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) { | 271 void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) { |
269 PlatformSetAddressBarURL(web_contents->GetURL()); | 272 PlatformSetAddressBarURL(web_contents->GetURL()); |
270 } | 273 } |
271 | 274 |
272 JavaScriptDialogManager* Shell::GetJavaScriptDialogManager() { | 275 JavaScriptDialogManager* Shell::GetJavaScriptDialogManager() { |
273 if (!dialog_manager_.get()) | 276 if (!dialog_manager_.get()) |
274 dialog_manager_.reset(new ShellJavaScriptDialogManager()); | 277 dialog_manager_.reset(new ShellJavaScriptDialogManager()); |
275 return dialog_manager_.get(); | 278 return dialog_manager_.get(); |
(...skipping 29 matching lines...) Expand all Loading... | |
305 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 308 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
306 | 309 |
307 if (title->first) { | 310 if (title->first) { |
308 string16 text = title->first->GetTitle(); | 311 string16 text = title->first->GetTitle(); |
309 PlatformSetTitle(text); | 312 PlatformSetTitle(text); |
310 } | 313 } |
311 } | 314 } |
312 } | 315 } |
313 | 316 |
314 } // namespace content | 317 } // namespace content |
OLD | NEW |