OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/debugger/devtools_manager.h" | 5 #include "content/browser/debugger/devtools_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return; | 116 return; |
117 | 117 |
118 DevToolsWindow* window = client_host->AsDevToolsWindow(); | 118 DevToolsWindow* window = client_host->AsDevToolsWindow(); |
119 DCHECK(window); | 119 DCHECK(window); |
120 window->Activate(); | 120 window->Activate(); |
121 } | 121 } |
122 | 122 |
123 void DevToolsManager::CloseWindow(RenderViewHost* client_rvh) { | 123 void DevToolsManager::CloseWindow(RenderViewHost* client_rvh) { |
124 DevToolsClientHost* client_host = FindOwnerDevToolsClientHost(client_rvh); | 124 DevToolsClientHost* client_host = FindOwnerDevToolsClientHost(client_rvh); |
125 if (client_host) { | 125 if (client_host) { |
126 RenderViewHost* inspected_rvh = GetInspectedRenderViewHost(client_host); | 126 DevToolsWindow* window = client_host->AsDevToolsWindow(); |
127 DCHECK(inspected_rvh); | 127 DCHECK(window); |
128 UnregisterDevToolsClientHostFor(inspected_rvh); | 128 window->Close(); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 void DevToolsManager::RequestDockWindow(RenderViewHost* client_rvh) { | 132 void DevToolsManager::RequestDockWindow(RenderViewHost* client_rvh) { |
133 ReopenWindow(client_rvh, true); | 133 ReopenWindow(client_rvh, true); |
134 } | 134 } |
135 | 135 |
136 void DevToolsManager::RequestUndockWindow(RenderViewHost* client_rvh) { | 136 void DevToolsManager::RequestUndockWindow(RenderViewHost* client_rvh) { |
137 ReopenWindow(client_rvh, false); | 137 ReopenWindow(client_rvh, false); |
138 } | 138 } |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 for (InspectedRvhToClientHostMap::iterator it = | 457 for (InspectedRvhToClientHostMap::iterator it = |
458 inspected_rvh_to_client_host_.begin(); | 458 inspected_rvh_to_client_host_.begin(); |
459 it != inspected_rvh_to_client_host_.end(); ++it) { | 459 it != inspected_rvh_to_client_host_.end(); ++it) { |
460 rhvs.push_back(it->first); | 460 rhvs.push_back(it->first); |
461 } | 461 } |
462 for (std::vector<RenderViewHost*>::iterator it = rhvs.begin(); | 462 for (std::vector<RenderViewHost*>::iterator it = rhvs.begin(); |
463 it != rhvs.end(); ++it) { | 463 it != rhvs.end(); ++it) { |
464 UnregisterDevToolsClientHostFor(*it); | 464 UnregisterDevToolsClientHostFor(*it); |
465 } | 465 } |
466 } | 466 } |
OLD | NEW |