| 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/extension_debugger_api.h" | 7 #include "chrome/browser/extensions/extension_debugger_api.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 Close(); | 276 Close(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend( | 279 void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend( |
| 280 const std::string& message) { | 280 const std::string& message) { |
| 281 Profile* profile = | 281 Profile* profile = |
| 282 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 282 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 283 if (profile == NULL || !profile->GetExtensionEventRouter()) | 283 if (profile == NULL || !profile->GetExtensionEventRouter()) |
| 284 return; | 284 return; |
| 285 | 285 |
| 286 scoped_ptr<Value> result(base::JSONReader::Read(message, false)); | 286 scoped_ptr<Value> result(base::JSONReader::Read(message)); |
| 287 if (!result->IsType(Value::TYPE_DICTIONARY)) | 287 if (!result->IsType(Value::TYPE_DICTIONARY)) |
| 288 return; | 288 return; |
| 289 DictionaryValue* dictionary = static_cast<DictionaryValue*>(result.get()); | 289 DictionaryValue* dictionary = static_cast<DictionaryValue*>(result.get()); |
| 290 | 290 |
| 291 int id; | 291 int id; |
| 292 if (!dictionary->GetInteger("id", &id)) { | 292 if (!dictionary->GetInteger("id", &id)) { |
| 293 std::string method_name; | 293 std::string method_name; |
| 294 if (!dictionary->GetString("method", &method_name)) | 294 if (!dictionary->GetString("method", &method_name)) |
| 295 return; | 295 return; |
| 296 | 296 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 return; | 487 return; |
| 488 } | 488 } |
| 489 | 489 |
| 490 Value* result_body; | 490 Value* result_body; |
| 491 if (dictionary->Get("result", &result_body)) | 491 if (dictionary->Get("result", &result_body)) |
| 492 result_.reset(result_body->DeepCopy()); | 492 result_.reset(result_body->DeepCopy()); |
| 493 else | 493 else |
| 494 result_.reset(new DictionaryValue()); | 494 result_.reset(new DictionaryValue()); |
| 495 SendResponse(true); | 495 SendResponse(true); |
| 496 } | 496 } |
| OLD | NEW |