OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/devtools/devtools_target_impl.h" | 5 #include "chrome/browser/devtools/devtools_target_impl.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/devtools_window.h" |
10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // static | 265 // static |
266 scoped_ptr<DevToolsTargetImpl> DevToolsTargetImpl::CreateForWebContents( | 266 scoped_ptr<DevToolsTargetImpl> DevToolsTargetImpl::CreateForWebContents( |
267 content::WebContents* web_contents, | 267 content::WebContents* web_contents, |
268 bool is_tab) { | 268 bool is_tab) { |
269 return scoped_ptr<DevToolsTargetImpl>( | 269 return scoped_ptr<DevToolsTargetImpl>( |
270 new WebContentsTarget(web_contents, is_tab)); | 270 new WebContentsTarget(web_contents, is_tab)); |
271 } | 271 } |
272 | 272 |
273 // static | 273 // static |
274 void DevToolsTargetImpl::EnumerateAllTargets(Callback callback) { | 274 void DevToolsTargetImpl::EnumerateAllTargets(Callback callback) { |
275 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
276 | 276 |
277 std::set<WebContents*> tab_web_contents; | 277 std::set<WebContents*> tab_web_contents; |
278 for (TabContentsIterator it; !it.done(); it.Next()) | 278 for (TabContentsIterator it; !it.done(); it.Next()) |
279 tab_web_contents.insert(*it); | 279 tab_web_contents.insert(*it); |
280 | 280 |
281 DevToolsTargetImpl::List result; | 281 DevToolsTargetImpl::List result; |
282 DevToolsAgentHost::List agents = DevToolsAgentHost::GetOrCreateAll(); | 282 DevToolsAgentHost::List agents = DevToolsAgentHost::GetOrCreateAll(); |
283 for (DevToolsAgentHost::List::iterator it = agents.begin(); | 283 for (DevToolsAgentHost::List::iterator it = agents.begin(); |
284 it != agents.end(); ++it) { | 284 it != agents.end(); ++it) { |
285 DevToolsAgentHost* agent_host = (*it).get(); | 285 DevToolsAgentHost* agent_host = (*it).get(); |
(...skipping 14 matching lines...) Expand all Loading... |
300 case DevToolsAgentHost::TYPE_SERVICE_WORKER: | 300 case DevToolsAgentHost::TYPE_SERVICE_WORKER: |
301 result.push_back(new WorkerTarget(agent_host)); | 301 result.push_back(new WorkerTarget(agent_host)); |
302 break; | 302 break; |
303 default: | 303 default: |
304 break; | 304 break; |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 callback.Run(result); | 308 callback.Run(result); |
309 } | 309 } |
OLD | NEW |