OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/debugger/devtools_manager.h" | 5 #include "chrome/browser/debugger/devtools_manager.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/debugger/devtools_window.h" | 9 #include "chrome/browser/debugger/devtools_window.h" |
10 #include "chrome/browser/debugger/devtools_client_host.h" | 10 #include "chrome/browser/debugger/devtools_client_host.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 void DevToolsManager::UndockWindow(RenderViewHost* client_rvh) { | 122 void DevToolsManager::UndockWindow(RenderViewHost* client_rvh) { |
123 ReopenWindow(client_rvh, false); | 123 ReopenWindow(client_rvh, false); |
124 } | 124 } |
125 | 125 |
126 void DevToolsManager::OpenDevToolsWindow(RenderViewHost* inspected_rvh) { | 126 void DevToolsManager::OpenDevToolsWindow(RenderViewHost* inspected_rvh) { |
127 DevToolsClientHost* host = GetDevToolsClientHostFor(inspected_rvh); | 127 DevToolsClientHost* host = GetDevToolsClientHostFor(inspected_rvh); |
128 if (!host) { | 128 if (!host) { |
129 bool docked = inspected_rvh->process()->profile()->GetPrefs()-> | 129 bool docked = inspected_rvh->process()->profile()->GetPrefs()-> |
130 GetBoolean(prefs::kDevToolsOpenDocked); | 130 GetBoolean(prefs::kDevToolsOpenDocked); |
131 host = DevToolsWindow::CreateDevToolsWindow( | 131 host = new DevToolsWindow( |
132 inspected_rvh->site_instance()->browsing_instance()->profile(), | 132 inspected_rvh->site_instance()->browsing_instance()->profile(), |
133 inspected_rvh, | 133 inspected_rvh, |
134 docked); | 134 docked); |
135 RegisterDevToolsClientHostFor(inspected_rvh, host); | 135 RegisterDevToolsClientHostFor(inspected_rvh, host); |
136 } | 136 } |
137 DevToolsWindow* window = host->AsDevToolsWindow(); | 137 DevToolsWindow* window = host->AsDevToolsWindow(); |
138 if (window) { | 138 if (window) { |
139 in_initial_show_ = true; | 139 in_initial_show_ = true; |
140 window->Show(); | 140 window->Show(); |
141 in_initial_show_ = false; | 141 in_initial_show_ = false; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (!client_host) { | 270 if (!client_host) { |
271 return; | 271 return; |
272 } | 272 } |
273 RenderViewHost* inspected_rvh = GetInspectedRenderViewHost(client_host); | 273 RenderViewHost* inspected_rvh = GetInspectedRenderViewHost(client_host); |
274 DCHECK(inspected_rvh); | 274 DCHECK(inspected_rvh); |
275 inspected_rvh->process()->profile()->GetPrefs()->SetBoolean( | 275 inspected_rvh->process()->profile()->GetPrefs()->SetBoolean( |
276 prefs::kDevToolsOpenDocked, docked); | 276 prefs::kDevToolsOpenDocked, docked); |
277 | 277 |
278 DevToolsWindow* window = client_host->AsDevToolsWindow(); | 278 DevToolsWindow* window = client_host->AsDevToolsWindow(); |
279 DCHECK(window); | 279 DCHECK(window); |
280 if (window->is_docked() == docked) { | 280 window->SetDocked(docked); |
281 return; | |
282 } | |
283 | |
284 SendDetachToAgent(inspected_rvh); | |
285 UnregisterDevToolsClientHostFor(inspected_rvh); | |
286 OpenDevToolsWindow(inspected_rvh); | |
287 } | 281 } |
OLD | NEW |