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" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "content/public/browser/devtools_agent_host.h" | 14 #include "content/public/browser/devtools_agent_host.h" |
15 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
16 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
17 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
19 #include "content/public/browser/web_contents_observer.h" | 19 #include "content/public/browser/web_contents_observer.h" |
20 #include "content/public/common/renderer_preferences.h" | 20 #include "content/public/common/renderer_preferences.h" |
| 21 #include "content/shell/browser/blink_test_controller.h" |
21 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 22 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
22 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage
r.h" | 23 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage
r.h" |
23 #include "content/shell/browser/notify_done_forwarder.h" | 24 #include "content/shell/browser/notify_done_forwarder.h" |
24 #include "content/shell/browser/shell_browser_main_parts.h" | 25 #include "content/shell/browser/shell_browser_main_parts.h" |
25 #include "content/shell/browser/shell_content_browser_client.h" | 26 #include "content/shell/browser/shell_content_browser_client.h" |
26 #include "content/shell/browser/shell_devtools_frontend.h" | 27 #include "content/shell/browser/shell_devtools_frontend.h" |
27 #include "content/shell/browser/shell_javascript_dialog_manager.h" | 28 #include "content/shell/browser/shell_javascript_dialog_manager.h" |
28 #include "content/shell/browser/webkit_test_controller.h" | |
29 #include "content/shell/common/shell_messages.h" | 29 #include "content/shell/common/shell_messages.h" |
30 #include "content/shell/common/shell_switches.h" | 30 #include "content/shell/common/shell_switches.h" |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 const int kDefaultTestWindowWidthDip = 800; | 34 const int kDefaultTestWindowWidthDip = 800; |
35 const int kDefaultTestWindowHeightDip = 600; | 35 const int kDefaultTestWindowHeightDip = 600; |
36 | 36 |
37 std::vector<Shell*> Shell::windows_; | 37 std::vector<Shell*> Shell::windows_; |
38 base::Callback<void(Shell*)> Shell::shell_created_callback_; | 38 base::Callback<void(Shell*)> Shell::shell_created_callback_; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 int32 line_no, | 362 int32 line_no, |
363 const base::string16& source_id) { | 363 const base::string16& source_id) { |
364 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 364 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
365 switches::kRunLayoutTest); | 365 switches::kRunLayoutTest); |
366 } | 366 } |
367 | 367 |
368 void Shell::RendererUnresponsive(WebContents* source) { | 368 void Shell::RendererUnresponsive(WebContents* source) { |
369 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 369 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
370 switches::kRunLayoutTest)) | 370 switches::kRunLayoutTest)) |
371 return; | 371 return; |
372 WebKitTestController::Get()->RendererUnresponsive(); | 372 BlinkTestController::Get()->RendererUnresponsive(); |
373 } | 373 } |
374 | 374 |
375 void Shell::ActivateContents(WebContents* contents) { | 375 void Shell::ActivateContents(WebContents* contents) { |
376 contents->GetRenderViewHost()->Focus(); | 376 contents->GetRenderViewHost()->Focus(); |
377 } | 377 } |
378 | 378 |
379 void Shell::DeactivateContents(WebContents* contents) { | 379 void Shell::DeactivateContents(WebContents* contents) { |
380 contents->GetRenderViewHost()->Blur(); | 380 contents->GetRenderViewHost()->Blur(); |
381 } | 381 } |
382 | 382 |
383 void Shell::WorkerCrashed(WebContents* source) { | 383 void Shell::WorkerCrashed(WebContents* source) { |
384 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 384 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
385 switches::kRunLayoutTest)) | 385 switches::kRunLayoutTest)) |
386 return; | 386 return; |
387 WebKitTestController::Get()->WorkerCrashed(); | 387 BlinkTestController::Get()->WorkerCrashed(); |
388 } | 388 } |
389 | 389 |
390 bool Shell::HandleContextMenu(const content::ContextMenuParams& params) { | 390 bool Shell::HandleContextMenu(const content::ContextMenuParams& params) { |
391 return PlatformHandleContextMenu(params); | 391 return PlatformHandleContextMenu(params); |
392 } | 392 } |
393 | 393 |
394 gfx::Size Shell::GetShellDefaultSize() { | 394 gfx::Size Shell::GetShellDefaultSize() { |
395 static gfx::Size default_shell_size; | 395 static gfx::Size default_shell_size; |
396 if (!default_shell_size.IsEmpty()) | 396 if (!default_shell_size.IsEmpty()) |
397 return default_shell_size; | 397 return default_shell_size; |
(...skipping 26 matching lines...) Expand all Loading... |
424 devtools_frontend_->Activate(); | 424 devtools_frontend_->Activate(); |
425 devtools_frontend_->Focus(); | 425 devtools_frontend_->Focus(); |
426 } | 426 } |
427 | 427 |
428 void Shell::OnDevToolsWebContentsDestroyed() { | 428 void Shell::OnDevToolsWebContentsDestroyed() { |
429 devtools_observer_.reset(); | 429 devtools_observer_.reset(); |
430 devtools_frontend_ = NULL; | 430 devtools_frontend_ = NULL; |
431 } | 431 } |
432 | 432 |
433 } // namespace content | 433 } // namespace content |
OLD | NEW |