| 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/api/debugger/debugger_api.h" | 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 const char kTargetTypePage[] = "page"; | 271 const char kTargetTypePage[] = "page"; |
| 272 const char kTargetTypeBackgroundPage[] = "background_page"; | 272 const char kTargetTypeBackgroundPage[] = "background_page"; |
| 273 const char kTargetTypeWorker[] = "worker"; | 273 const char kTargetTypeWorker[] = "worker"; |
| 274 | 274 |
| 275 base::Value* SerializePageInfo(RenderViewHost* rvh) { | 275 base::Value* SerializePageInfo(RenderViewHost* rvh) { |
| 276 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); | 276 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
| 277 if (!web_contents) | 277 if (!web_contents) |
| 278 return NULL; | 278 return NULL; |
| 279 | 279 |
| 280 DevToolsAgentHost* agent_host = DevToolsAgentHost::GetOrCreateFor(rvh); | 280 DevToolsAgentHost* agent_host = DevToolsAgentHost::GetOrCreateFor(rvh).get(); |
| 281 | 281 |
| 282 base::DictionaryValue* dictionary = new base::DictionaryValue(); | 282 base::DictionaryValue* dictionary = new base::DictionaryValue(); |
| 283 | 283 |
| 284 dictionary->SetString(kTargetIdField, agent_host->GetId()); | 284 dictionary->SetString(kTargetIdField, agent_host->GetId()); |
| 285 dictionary->SetBoolean(kTargetAttachedField, agent_host->IsAttached()); | 285 dictionary->SetBoolean(kTargetAttachedField, agent_host->IsAttached()); |
| 286 dictionary->SetString(kTargetUrlField, web_contents->GetURL().spec()); | 286 dictionary->SetString(kTargetUrlField, web_contents->GetURL().spec()); |
| 287 | 287 |
| 288 extensions::ExtensionHost* extension_host = | 288 extensions::ExtensionHost* extension_host = |
| 289 GetExtensionBackgroundHost(web_contents); | 289 GetExtensionBackgroundHost(web_contents); |
| 290 if (extension_host) { | 290 if (extension_host) { |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 WorkerService::GetInstance()->GetWorkers(); | 768 WorkerService::GetInstance()->GetWorkers(); |
| 769 | 769 |
| 770 for (size_t i = 0; i < worker_info.size(); ++i) | 770 for (size_t i = 0; i < worker_info.size(); ++i) |
| 771 list->Append(SerializeWorkerInfo(worker_info[i])); | 771 list->Append(SerializeWorkerInfo(worker_info[i])); |
| 772 } | 772 } |
| 773 | 773 |
| 774 void DebuggerGetTargetsFunction::SendTargetList(base::ListValue* list) { | 774 void DebuggerGetTargetsFunction::SendTargetList(base::ListValue* list) { |
| 775 SetResult(list); | 775 SetResult(list); |
| 776 SendResponse(true); | 776 SendResponse(true); |
| 777 } | 777 } |
| OLD | NEW |