OLD | NEW |
1 // Copyright (c) 2011 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 // Implements the Chrome Extensions Debugger API. | 5 // Implements the Chrome Extensions Debugger API. |
6 | 6 |
7 #include "chrome/browser/extensions/extension_debugger_api.h" | 7 #include "chrome/browser/extensions/extension_debugger_api.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 | 11 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 ExtensionDevToolsClientHost* Lookup(WebContents* contents) { | 143 ExtensionDevToolsClientHost* Lookup(WebContents* contents) { |
144 for (std::set<DevToolsClientHost*>::iterator it = client_hosts_.begin(); | 144 for (std::set<DevToolsClientHost*>::iterator it = client_hosts_.begin(); |
145 it != client_hosts_.end(); ++it) { | 145 it != client_hosts_.end(); ++it) { |
146 DevToolsAgentHost* agent_host = | 146 DevToolsAgentHost* agent_host = |
147 DevToolsManager::GetInstance()->GetDevToolsAgentHostFor(*it); | 147 DevToolsManager::GetInstance()->GetDevToolsAgentHostFor(*it); |
148 if (!agent_host) | 148 if (!agent_host) |
149 continue; | 149 continue; |
150 RenderViewHost* rvh = | 150 RenderViewHost* rvh = |
151 DevToolsAgentHostRegistry::GetRenderViewHost(agent_host); | 151 DevToolsAgentHostRegistry::GetRenderViewHost(agent_host); |
152 if (rvh && rvh->delegate() && | 152 if (rvh && rvh->GetDelegate() && |
153 rvh->delegate()->GetAsWebContents() == contents) | 153 rvh->GetDelegate()->GetAsWebContents() == contents) |
154 return static_cast<ExtensionDevToolsClientHost*>(*it); | 154 return static_cast<ExtensionDevToolsClientHost*>(*it); |
155 } | 155 } |
156 return NULL; | 156 return NULL; |
157 } | 157 } |
158 | 158 |
159 private: | 159 private: |
160 std::set<DevToolsClientHost*> client_hosts_; | 160 std::set<DevToolsClientHost*> client_hosts_; |
161 }; | 161 }; |
162 | 162 |
163 } // namespace | 163 } // namespace |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 return; | 486 return; |
487 } | 487 } |
488 | 488 |
489 Value* result_body; | 489 Value* result_body; |
490 if (dictionary->Get("result", &result_body)) | 490 if (dictionary->Get("result", &result_body)) |
491 result_.reset(result_body->DeepCopy()); | 491 result_.reset(result_body->DeepCopy()); |
492 else | 492 else |
493 result_.reset(new DictionaryValue()); | 493 result_.reset(new DictionaryValue()); |
494 SendResponse(true); | 494 SendResponse(true); |
495 } | 495 } |
OLD | NEW |