Index: chrome/browser/extensions/api/debugger/debugger_api.cc |
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc |
index bd5b98fc88312fc8057d9bf70103e6278b3809cf..c5a4f982624e2b0423fb4cad81755d178c15bcbc 100644 |
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc |
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc |
@@ -101,14 +101,14 @@ class ExtensionDevToolsClientHost : public DevToolsClientHost, |
const std::string& method, |
SendCommand::Params::CommandParams* command_params); |
- // Mark methods below determine the connection termination reason. |
- void MarkAsReplaced(); |
+ // Marks connection as to-be-terminated by the user. |
void MarkAsDismissed(); |
// DevToolsClientHost interface |
virtual void InspectedContentsClosing() OVERRIDE; |
virtual void DispatchOnInspectorFrontend(const std::string& message) OVERRIDE; |
virtual void ContentsReplaced(WebContents* web_contents) OVERRIDE; |
+ virtual void ReplacedWithAnotherClient() OVERRIDE; |
virtual void FrameNavigating(const std::string& url) OVERRIDE {} |
private: |
@@ -152,16 +152,6 @@ class AttachedClientHosts { |
client_hosts_.erase(client_host); |
} |
- ExtensionDevToolsClientHost* AsExtensionDevToolsClientHost( |
- DevToolsClientHost* client_host) { |
- for (std::set<DevToolsClientHost*>::iterator it = client_hosts_.begin(); |
- it != client_hosts_.end(); ++it) { |
- if (client_host == *it) |
- return static_cast<ExtensionDevToolsClientHost*>(*it); |
- } |
- return NULL; |
- } |
- |
ExtensionDevToolsClientHost* Lookup(WebContents* contents) { |
for (std::set<DevToolsClientHost*>::iterator it = client_hosts_.begin(); |
it != client_hosts_.end(); ++it) { |
@@ -251,6 +241,10 @@ void ExtensionDevToolsClientHost::ContentsReplaced(WebContents* web_contents) { |
web_contents_ = web_contents; |
} |
+void ExtensionDevToolsClientHost::ReplacedWithAnotherClient() { |
+ detach_reason_ = OnDetach::REASON_REPLACED_WITH_DEVTOOLS; |
+} |
+ |
void ExtensionDevToolsClientHost::Close() { |
DevToolsManager::GetInstance()->ClientHostClosing(this); |
delete this; |
@@ -275,10 +269,6 @@ void ExtensionDevToolsClientHost::SendMessageToBackend( |
DevToolsManager::GetInstance()->DispatchOnInspectorBackend(this, json_args); |
} |
-void ExtensionDevToolsClientHost::MarkAsReplaced() { |
- detach_reason_ = OnDetach::REASON_REPLACED_WITH_DEVTOOLS; |
-} |
- |
void ExtensionDevToolsClientHost::MarkAsDismissed() { |
detach_reason_ = OnDetach::REASON_CANCELED_BY_USER; |
} |
@@ -545,12 +535,3 @@ void SendCommandDebuggerFunction::SendResponseBody( |
results_ = SendCommand::Results::Create(result); |
SendResponse(true); |
} |
- |
-// static |
-void DebuggerApi::MarkDevToolsClientHostAsReplaced( |
- DevToolsClientHost* client_host) { |
- ExtensionDevToolsClientHost* host = AttachedClientHosts::GetInstance()-> |
- AsExtensionDevToolsClientHost(client_host); |
- if (host) |
- host->MarkAsReplaced(); |
-} |