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 scoped_refptr<DevToolsAgentHost> agent( |
pfeldman
2013/03/29 14:59:23
You no longer need this.
Vladislav Kaznacheev
2013/03/29 15:15:35
Done.
| |
159 DevToolsAgentHost::GetOrCreateFor(inspected_rvh_)); | 158 DevToolsAgentHost::GetOrCreateFor(inspected_rvh_)); |
160 devtools_manager->UnregisterDevToolsClientHostFor(agent); | 159 devtools_manager->CloseAllClientHosts(); |
161 | 160 |
162 // Wait only when DevToolsWindow has a browser. For docked DevTools, this | 161 // Wait only when DevToolsWindow has a browser. For docked DevTools, this |
163 // is NULL and we skip the wait. | 162 // is NULL and we skip the wait. |
164 if (browser) | 163 if (browser) |
165 BrowserClosedObserver close_observer(browser); | 164 BrowserClosedObserver close_observer(browser); |
166 } | 165 } |
167 | 166 |
168 DevToolsWindow* window_; | 167 DevToolsWindow* window_; |
169 RenderViewHost* inspected_rvh_; | 168 RenderViewHost* inspected_rvh_; |
170 }; | 169 }; |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
698 devtools_http_handler_->Stop(); | 697 devtools_http_handler_->Stop(); |
699 return result; | 698 return result; |
700 } | 699 } |
701 }; | 700 }; |
702 | 701 |
703 IN_PROC_BROWSER_TEST_F(DISABLED_RemoteDebuggingTest, TargetList) { | 702 IN_PROC_BROWSER_TEST_F(DISABLED_RemoteDebuggingTest, TargetList) { |
704 ASSERT_TRUE(RunExtensionTest("target_list")); | 703 ASSERT_TRUE(RunExtensionTest("target_list")); |
705 } | 704 } |
706 | 705 |
707 } // namespace | 706 } // namespace |
OLD | NEW |