| 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 <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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // It might be in the list of orphan client hosts, remove it from there. | 164 // It might be in the list of orphan client hosts, remove it from there. |
| 165 for (OrphanClientHosts::iterator it = orphan_client_hosts_.begin(); | 165 for (OrphanClientHosts::iterator it = orphan_client_hosts_.begin(); |
| 166 it != orphan_client_hosts_.end(); ++it) { | 166 it != orphan_client_hosts_.end(); ++it) { |
| 167 if (it->second.first == host) { | 167 if (it->second.first == host) { |
| 168 orphan_client_hosts_.erase(it->first); | 168 orphan_client_hosts_.erase(it->first); |
| 169 return; | 169 return; |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 return; | 172 return; |
| 173 } | 173 } |
| 174 |
| 175 NotificationService::current()->Notify( |
| 176 NotificationType::DEVTOOLS_WINDOW_CLOSING, |
| 177 Source<Profile>(inspected_rvh->site_instance()->GetProcess()->profile()), |
| 178 Details<RenderViewHost>(inspected_rvh)); |
| 179 |
| 174 SendDetachToAgent(inspected_rvh); | 180 SendDetachToAgent(inspected_rvh); |
| 175 | 181 |
| 176 inspected_rvh_to_client_host_.erase(inspected_rvh); | 182 inspected_rvh_to_client_host_.erase(inspected_rvh); |
| 177 runtime_features_.erase(inspected_rvh); | 183 runtime_features_.erase(inspected_rvh); |
| 178 client_host_to_inspected_rvh_.erase(host); | 184 client_host_to_inspected_rvh_.erase(host); |
| 179 } | 185 } |
| 180 | 186 |
| 181 RenderViewHost* DevToolsManager::GetInspectedRenderViewHost( | 187 RenderViewHost* DevToolsManager::GetInspectedRenderViewHost( |
| 182 DevToolsClientHost* client_host) { | 188 DevToolsClientHost* client_host) { |
| 183 ClientHostToInspectedRvhMap::iterator it = | 189 ClientHostToInspectedRvhMap::iterator it = |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 371 } |
| 366 } | 372 } |
| 367 | 373 |
| 368 void DevToolsManager::CloseWindow(DevToolsClientHost* client_host) { | 374 void DevToolsManager::CloseWindow(DevToolsClientHost* client_host) { |
| 369 RenderViewHost* inspected_rvh = GetInspectedRenderViewHost(client_host); | 375 RenderViewHost* inspected_rvh = GetInspectedRenderViewHost(client_host); |
| 370 DCHECK(inspected_rvh); | 376 DCHECK(inspected_rvh); |
| 371 SendDetachToAgent(inspected_rvh); | 377 SendDetachToAgent(inspected_rvh); |
| 372 | 378 |
| 373 UnregisterDevToolsClientHostFor(inspected_rvh); | 379 UnregisterDevToolsClientHostFor(inspected_rvh); |
| 374 } | 380 } |
| OLD | NEW |