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