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/message_loop/message_loop.h" |
10 #include "base/single_thread_task_runner.h" | |
11 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
15 #include "base/thread_task_runner_handle.h" | |
16 #include "content/public/browser/devtools_agent_host.h" | 14 #include "content/public/browser/devtools_agent_host.h" |
17 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
18 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
19 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
20 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
21 #include "content/public/browser/web_contents_observer.h" | 19 #include "content/public/browser/web_contents_observer.h" |
22 #include "content/public/common/renderer_preferences.h" | 20 #include "content/public/common/renderer_preferences.h" |
23 #include "content/shell/browser/blink_test_controller.h" | 21 #include "content/shell/browser/blink_test_controller.h" |
24 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 22 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
25 #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" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 for (size_t i = 0; i < windows_.size(); ++i) { | 82 for (size_t i = 0; i < windows_.size(); ++i) { |
85 if (windows_[i] == this) { | 83 if (windows_[i] == this) { |
86 windows_.erase(windows_.begin() + i); | 84 windows_.erase(windows_.begin() + i); |
87 break; | 85 break; |
88 } | 86 } |
89 } | 87 } |
90 | 88 |
91 if (windows_.empty() && quit_message_loop_) { | 89 if (windows_.empty() && quit_message_loop_) { |
92 if (headless_) | 90 if (headless_) |
93 PlatformExit(); | 91 PlatformExit(); |
94 base::ThreadTaskRunnerHandle::Get()->PostTask( | 92 base::MessageLoop::current()->PostTask(FROM_HERE, |
95 FROM_HERE, base::MessageLoop::QuitClosure()); | 93 base::MessageLoop::QuitClosure()); |
96 } | 94 } |
97 } | 95 } |
98 | 96 |
99 Shell* Shell::CreateShell(WebContents* web_contents, | 97 Shell* Shell::CreateShell(WebContents* web_contents, |
100 const gfx::Size& initial_size) { | 98 const gfx::Size& initial_size) { |
101 Shell* shell = new Shell(web_contents); | 99 Shell* shell = new Shell(web_contents); |
102 shell->PlatformCreateWindow(initial_size.width(), initial_size.height()); | 100 shell->PlatformCreateWindow(initial_size.width(), initial_size.height()); |
103 | 101 |
104 shell->web_contents_.reset(web_contents); | 102 shell->web_contents_.reset(web_contents); |
105 web_contents->SetDelegate(shell); | 103 web_contents->SetDelegate(shell); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 devtools_frontend_->Activate(); | 424 devtools_frontend_->Activate(); |
427 devtools_frontend_->Focus(); | 425 devtools_frontend_->Focus(); |
428 } | 426 } |
429 | 427 |
430 void Shell::OnDevToolsWebContentsDestroyed() { | 428 void Shell::OnDevToolsWebContentsDestroyed() { |
431 devtools_observer_.reset(); | 429 devtools_observer_.reset(); |
432 devtools_frontend_ = NULL; | 430 devtools_frontend_ = NULL; |
433 } | 431 } |
434 | 432 |
435 } // namespace content | 433 } // namespace content |
OLD | NEW |