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 // 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> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 bool MatchesContentsAndExtensionId(WebContents* web_contents, | 84 bool MatchesContentsAndExtensionId(WebContents* web_contents, |
85 const std::string& extension_id); | 85 const std::string& extension_id); |
86 void Close(); | 86 void Close(); |
87 void InfoBarDestroyed(); | 87 void InfoBarDestroyed(); |
88 void SendMessageToBackend(SendCommandDebuggerFunction* function, | 88 void SendMessageToBackend(SendCommandDebuggerFunction* function, |
89 const std::string& method, | 89 const std::string& method, |
90 Value* params); | 90 Value* params); |
91 | 91 |
92 // DevToolsClientHost interface | 92 // DevToolsClientHost interface |
93 virtual void InspectedTabClosing(); | 93 virtual void InspectedContentsClosing() OVERRIDE; |
94 virtual void DispatchOnInspectorFrontend(const std::string& message); | 94 virtual void DispatchOnInspectorFrontend(const std::string& message) OVERRIDE; |
95 virtual void TabReplaced(WebContents* web_contents); | 95 virtual void ContentsReplaced(WebContents* web_contents) OVERRIDE; |
96 virtual void FrameNavigating(const std::string& url) {} | 96 virtual void FrameNavigating(const std::string& url) OVERRIDE {} |
97 | 97 |
98 private: | 98 private: |
99 void SendDetachedEvent(); | 99 void SendDetachedEvent(); |
100 | 100 |
101 // content::NotificationObserver implementation. | 101 // content::NotificationObserver implementation. |
102 virtual void Observe(int type, | 102 virtual void Observe(int type, |
103 const content::NotificationSource& source, | 103 const content::NotificationSource& source, |
104 const content::NotificationDetails& details); | 104 const content::NotificationDetails& details); |
105 | 105 |
106 WebContents* web_contents_; | 106 WebContents* web_contents_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 AttachedClientHosts::GetInstance()->Remove(this); | 205 AttachedClientHosts::GetInstance()->Remove(this); |
206 } | 206 } |
207 | 207 |
208 bool ExtensionDevToolsClientHost::MatchesContentsAndExtensionId( | 208 bool ExtensionDevToolsClientHost::MatchesContentsAndExtensionId( |
209 WebContents* web_contents, | 209 WebContents* web_contents, |
210 const std::string& extension_id) { | 210 const std::string& extension_id) { |
211 return web_contents == web_contents_ && extension_id_ == extension_id; | 211 return web_contents == web_contents_ && extension_id_ == extension_id; |
212 } | 212 } |
213 | 213 |
214 // DevToolsClientHost interface | 214 // DevToolsClientHost interface |
215 void ExtensionDevToolsClientHost::InspectedTabClosing() { | 215 void ExtensionDevToolsClientHost::InspectedContentsClosing() { |
216 SendDetachedEvent(); | 216 SendDetachedEvent(); |
217 delete this; | 217 delete this; |
218 } | 218 } |
219 | 219 |
220 void ExtensionDevToolsClientHost::TabReplaced( | 220 void ExtensionDevToolsClientHost::ContentsReplaced(WebContents* web_contents) { |
221 WebContents* web_contents) { | |
222 web_contents_ = web_contents; | 221 web_contents_ = web_contents; |
223 } | 222 } |
224 | 223 |
225 void ExtensionDevToolsClientHost::Close() { | 224 void ExtensionDevToolsClientHost::Close() { |
226 DevToolsManager::GetInstance()->ClientHostClosing(this); | 225 DevToolsManager::GetInstance()->ClientHostClosing(this); |
227 delete this; | 226 delete this; |
228 } | 227 } |
229 | 228 |
230 void ExtensionDevToolsClientHost::InfoBarDestroyed() { | 229 void ExtensionDevToolsClientHost::InfoBarDestroyed() { |
231 infobar_delegate_ = NULL; | 230 infobar_delegate_ = NULL; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 return; | 486 return; |
488 } | 487 } |
489 | 488 |
490 Value* result_body; | 489 Value* result_body; |
491 if (dictionary->Get("result", &result_body)) | 490 if (dictionary->Get("result", &result_body)) |
492 result_.reset(result_body->DeepCopy()); | 491 result_.reset(result_body->DeepCopy()); |
493 else | 492 else |
494 result_.reset(new DictionaryValue()); | 493 result_.reset(new DictionaryValue()); |
495 SendResponse(true); | 494 SendResponse(true); |
496 } | 495 } |
OLD | NEW |