| 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" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 return shell; | 115 return shell; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void Shell::CloseAllWindows() { | 118 void Shell::CloseAllWindows() { |
| 119 base::AutoReset<bool> auto_reset(&quit_message_loop_, false); | 119 base::AutoReset<bool> auto_reset(&quit_message_loop_, false); |
| 120 DevToolsAgentHost::DetachAllClients(); | 120 DevToolsAgentHost::DetachAllClients(); |
| 121 std::vector<Shell*> open_windows(windows_); | 121 std::vector<Shell*> open_windows(windows_); |
| 122 for (size_t i = 0; i < open_windows.size(); ++i) | 122 for (size_t i = 0; i < open_windows.size(); ++i) |
| 123 open_windows[i]->Close(); | 123 open_windows[i]->Close(); |
| 124 base::MessageLoop::current()->RunUntilIdle(); |
| 124 PlatformExit(); | 125 PlatformExit(); |
| 125 base::MessageLoop::current()->RunUntilIdle(); | |
| 126 } | 126 } |
| 127 | 127 |
| 128 void Shell::SetShellCreatedCallback( | 128 void Shell::SetShellCreatedCallback( |
| 129 base::Callback<void(Shell*)> shell_created_callback) { | 129 base::Callback<void(Shell*)> shell_created_callback) { |
| 130 DCHECK(shell_created_callback_.is_null()); | 130 DCHECK(shell_created_callback_.is_null()); |
| 131 shell_created_callback_ = shell_created_callback; | 131 shell_created_callback_ = shell_created_callback; |
| 132 } | 132 } |
| 133 | 133 |
| 134 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { | 134 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { |
| 135 for (size_t i = 0; i < windows_.size(); ++i) { | 135 for (size_t i = 0; i < windows_.size(); ++i) { |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |