| 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 13 matching lines...) Expand all Loading... |
| 24 #include "extensions/browser/guest_view/guest_view_base.h" | 24 #include "extensions/browser/guest_view/guest_view_base.h" |
| 25 #include "extensions/browser/process_manager.h" | 25 #include "extensions/browser/process_manager.h" |
| 26 #include "extensions/common/constants.h" | 26 #include "extensions/common/constants.h" |
| 27 | 27 |
| 28 using content::BrowserThread; | 28 using content::BrowserThread; |
| 29 using content::DevToolsAgentHost; | 29 using content::DevToolsAgentHost; |
| 30 using content::RenderViewHost; | 30 using content::RenderViewHost; |
| 31 using content::WebContents; | 31 using content::WebContents; |
| 32 using content::WorkerService; | 32 using content::WorkerService; |
| 33 | 33 |
| 34 const char DevToolsTargetImpl::kTargetTypeApp[] = "app"; |
| 35 const char DevToolsTargetImpl::kTargetTypeBackgroundPage[] = "background_page"; |
| 36 const char DevToolsTargetImpl::kTargetTypePage[] = "page"; |
| 37 const char DevToolsTargetImpl::kTargetTypeWorker[] = "worker"; |
| 38 const char DevToolsTargetImpl::kTargetTypeWebView[] = "webview"; |
| 39 const char DevToolsTargetImpl::kTargetTypeIFrame[] = "iframe"; |
| 40 const char DevToolsTargetImpl::kTargetTypeOther[] = "other"; |
| 41 const char DevToolsTargetImpl::kTargetTypeServiceWorker[] = "service_worker"; |
| 42 |
| 34 namespace { | 43 namespace { |
| 35 | 44 |
| 36 const char kTargetTypeApp[] = "app"; | |
| 37 const char kTargetTypeBackgroundPage[] = "background_page"; | |
| 38 const char kTargetTypePage[] = "page"; | |
| 39 const char kTargetTypeWorker[] = "worker"; | |
| 40 const char kTargetTypeWebView[] = "webview"; | |
| 41 const char kTargetTypeIFrame[] = "iframe"; | |
| 42 const char kTargetTypeOther[] = "other"; | |
| 43 const char kTargetTypeServiceWorker[] = "service_worker"; | |
| 44 | |
| 45 // WebContentsTarget -------------------------------------------------------- | 45 // WebContentsTarget -------------------------------------------------------- |
| 46 | 46 |
| 47 class WebContentsTarget : public DevToolsTargetImpl { | 47 class WebContentsTarget : public DevToolsTargetImpl { |
| 48 public: | 48 public: |
| 49 WebContentsTarget(WebContents* web_contents, bool is_tab); | 49 WebContentsTarget(WebContents* web_contents, bool is_tab); |
| 50 | 50 |
| 51 // DevToolsTargetImpl overrides: | 51 // DevToolsTargetImpl overrides: |
| 52 virtual WebContents* GetWebContents() const OVERRIDE; | 52 virtual WebContents* GetWebContents() const OVERRIDE; |
| 53 virtual int GetTabId() const OVERRIDE; | 53 virtual int GetTabId() const OVERRIDE; |
| 54 virtual std::string GetExtensionId() const OVERRIDE; | 54 virtual std::string GetExtensionId() const OVERRIDE; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 // static | 338 // static |
| 339 void DevToolsTargetImpl::EnumerateAllTargets(Callback callback) { | 339 void DevToolsTargetImpl::EnumerateAllTargets(Callback callback) { |
| 340 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 340 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 341 content::BrowserThread::PostTask( | 341 content::BrowserThread::PostTask( |
| 342 content::BrowserThread::IO, | 342 content::BrowserThread::IO, |
| 343 FROM_HERE, | 343 FROM_HERE, |
| 344 base::Bind(&DevToolsTargetImpl::EnumerateWorkerTargets, | 344 base::Bind(&DevToolsTargetImpl::EnumerateWorkerTargets, |
| 345 base::Bind(&CollectAllTargets, callback))); | 345 base::Bind(&CollectAllTargets, callback))); |
| 346 } | 346 } |
| OLD | NEW |