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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/cancelable_callback.h" | 6 #include "base/cancelable_callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 window_ = DevToolsWindow::OpenDevToolsWindow(inspected_rvh_); | 145 window_ = DevToolsWindow::OpenDevToolsWindow(inspected_rvh_); |
146 observer.Wait(); | 146 observer.Wait(); |
147 } | 147 } |
148 | 148 |
149 WebContents* GetInspectedTab() { | 149 WebContents* GetInspectedTab() { |
150 return browser()->tab_strip_model()->GetWebContentsAt(0); | 150 return browser()->tab_strip_model()->GetWebContentsAt(0); |
151 } | 151 } |
152 | 152 |
153 void CloseDevToolsWindow() { | 153 void CloseDevToolsWindow() { |
154 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); | 154 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); |
155 // UnregisterDevToolsClientHostFor may destroy window_ so store the browser | 155 // CloseAllClientHosts may destroy window_ so store the browser first. |
156 // first. | |
157 Browser* browser = window_->browser(); | 156 Browser* browser = window_->browser(); |
158 scoped_refptr<DevToolsAgentHost> agent( | 157 devtools_manager->CloseAllClientHosts(); |
159 DevToolsAgentHost::GetOrCreateFor(inspected_rvh_)); | |
160 devtools_manager->UnregisterDevToolsClientHostFor(agent); | |
161 | |
162 // Wait only when DevToolsWindow has a browser. For docked DevTools, this | 158 // Wait only when DevToolsWindow has a browser. For docked DevTools, this |
163 // is NULL and we skip the wait. | 159 // is NULL and we skip the wait. |
164 if (browser) | 160 if (browser) |
165 BrowserClosedObserver close_observer(browser); | 161 BrowserClosedObserver close_observer(browser); |
166 } | 162 } |
167 | 163 |
168 DevToolsWindow* window_; | 164 DevToolsWindow* window_; |
169 RenderViewHost* inspected_rvh_; | 165 RenderViewHost* inspected_rvh_; |
170 }; | 166 }; |
171 | 167 |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 devtools_http_handler_->Stop(); | 694 devtools_http_handler_->Stop(); |
699 return result; | 695 return result; |
700 } | 696 } |
701 }; | 697 }; |
702 | 698 |
703 IN_PROC_BROWSER_TEST_F(DISABLED_RemoteDebuggingTest, TargetList) { | 699 IN_PROC_BROWSER_TEST_F(DISABLED_RemoteDebuggingTest, TargetList) { |
704 ASSERT_TRUE(RunExtensionTest("target_list")); | 700 ASSERT_TRUE(RunExtensionTest("target_list")); |
705 } | 701 } |
706 | 702 |
707 } // namespace | 703 } // namespace |
OLD | NEW |