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/shell_browser_main_parts.h" | 25 #include "content/shell/shell_browser_main_parts.h" |
26 #include "content/shell/shell_content_browser_client.h" | 26 #include "content/shell/shell_content_browser_client.h" |
27 #include "content/shell/shell_devtools_frontend.h" | 27 #include "content/shell/shell_devtools_frontend.h" |
28 #include "content/shell/shell_javascript_dialog_creator.h" | 28 #include "content/shell/shell_javascript_dialog_manager.h" |
29 #include "content/shell/shell_messages.h" | 29 #include "content/shell/shell_messages.h" |
30 #include "content/shell/shell_switches.h" | 30 #include "content/shell/shell_switches.h" |
31 #include "content/shell/webkit_test_controller.h" | 31 #include "content/shell/webkit_test_controller.h" |
32 | 32 |
33 // Content area size for newly created windows. | 33 // Content area size for newly created windows. |
34 static const int kTestWindowWidth = 800; | 34 static const int kTestWindowWidth = 800; |
35 static const int kTestWindowHeight = 600; | 35 static const int kTestWindowHeight = 600; |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 | 38 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 int64 source_frame_id, | 258 int64 source_frame_id, |
259 const GURL& target_url, | 259 const GURL& target_url, |
260 WebContents* new_contents) { | 260 WebContents* new_contents) { |
261 CreateShell(new_contents); | 261 CreateShell(new_contents); |
262 } | 262 } |
263 | 263 |
264 void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) { | 264 void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) { |
265 PlatformSetAddressBarURL(web_contents->GetURL()); | 265 PlatformSetAddressBarURL(web_contents->GetURL()); |
266 } | 266 } |
267 | 267 |
268 JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() { | 268 JavaScriptDialogManager* Shell::GetJavaScriptDialogManager() { |
269 if (!dialog_creator_.get()) | 269 if (!dialog_manager_.get()) |
270 dialog_creator_.reset(new ShellJavaScriptDialogCreator()); | 270 dialog_manager_.reset(new ShellJavaScriptDialogManager()); |
271 return dialog_creator_.get(); | 271 return dialog_manager_.get(); |
272 } | 272 } |
273 | 273 |
274 bool Shell::AddMessageToConsole(WebContents* source, | 274 bool Shell::AddMessageToConsole(WebContents* source, |
275 int32 level, | 275 int32 level, |
276 const string16& message, | 276 const string16& message, |
277 int32 line_no, | 277 int32 line_no, |
278 const string16& source_id) { | 278 const string16& source_id) { |
279 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree); | 279 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree); |
280 } | 280 } |
281 | 281 |
(...skipping 11 matching lines...) Expand all Loading... |
293 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 293 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
294 | 294 |
295 if (title->first) { | 295 if (title->first) { |
296 string16 text = title->first->GetTitle(); | 296 string16 text = title->first->GetTitle(); |
297 PlatformSetTitle(text); | 297 PlatformSetTitle(text); |
298 } | 298 } |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 } // namespace content | 302 } // namespace content |
OLD | NEW |