Index: chrome/browser/android/dev_tools_server.cc |
diff --git a/chrome/browser/android/dev_tools_server.cc b/chrome/browser/android/dev_tools_server.cc |
index 158ef749189f9478be6b63e4a37277e2d9c323a7..0dbeb637119995b8311f3d41632337bad95fd224 100644 |
--- a/chrome/browser/android/dev_tools_server.cc |
+++ b/chrome/browser/android/dev_tools_server.cc |
@@ -110,10 +110,10 @@ class TargetBase : public content::DevToolsTarget { |
last_activity_time_(web_contents->GetLastActiveTime()) { |
} |
- TargetBase(const base::string16& title, const GURL& url) |
- : title_(base::UTF16ToUTF8(title)), |
- url_(url) |
- {} |
+ TargetBase(const std::string& title, const GURL& url) |
+ : title_(title), |
+ url_(url) { |
+ } |
private: |
const std::string title_; |
@@ -195,7 +195,7 @@ class TabTarget : public TargetBase { |
} |
TabTarget(int tab_id, const base::string16& title, const GURL& url) |
- : TargetBase(title, url), |
+ : TargetBase(base::UTF16ToUTF8(title), url), |
tab_id_(tab_id) { |
} |
@@ -220,9 +220,9 @@ class TabTarget : public TargetBase { |
class NonTabTarget : public TargetBase { |
public: |
- explicit NonTabTarget(WebContents* web_contents) |
- : TargetBase(web_contents), |
- agent_host_(DevToolsAgentHost::GetOrCreateFor(web_contents)) { |
+ explicit NonTabTarget(scoped_refptr<DevToolsAgentHost> agent_host) |
+ : TargetBase("", agent_host->GetURL()), |
+ agent_host_(agent_host) { |
} |
// content::DevToolsTarget implementation: |
@@ -351,13 +351,14 @@ class DevToolsServerDelegate : public content::DevToolsHttpHandlerDelegate { |
} |
// Add targets for WebContents not associated with any tabs. |
- std::vector<WebContents*> wc_list = |
- DevToolsAgentHost::GetInspectableWebContents(); |
- for (std::vector<WebContents*>::iterator it = wc_list.begin(); |
- it != wc_list.end(); |
- ++it) { |
- if (tab_web_contents.find(*it) != tab_web_contents.end()) |
- continue; |
+ DevToolsAgentHost::List agents = |
+ DevToolsAgentHost::GetOrCreateAll(); |
+ for (DevToolsAgentHost::List::iterator it = agents.begin(); |
+ it != agents.end(); ++it) { |
+ if (WebContents* web_contents = (*it)->GetWebContents()) { |
+ if (tab_web_contents.find(web_contents) != tab_web_contents.end()) |
+ continue; |
+ } |
targets.push_back(new NonTabTarget(*it)); |
} |