| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 207 } |
| 208 | 208 |
| 209 void ExtensionDevToolsClientHost::OnDispatchOnInspectorFrontend( | 209 void ExtensionDevToolsClientHost::OnDispatchOnInspectorFrontend( |
| 210 const std::string& data) { | 210 const std::string& data) { |
| 211 Profile* profile = | 211 Profile* profile = |
| 212 Profile::FromBrowserContext(tab_contents_->browser_context()); | 212 Profile::FromBrowserContext(tab_contents_->browser_context()); |
| 213 if (profile == NULL || !profile->GetExtensionEventRouter()) | 213 if (profile == NULL || !profile->GetExtensionEventRouter()) |
| 214 return; | 214 return; |
| 215 | 215 |
| 216 scoped_ptr<Value> result(base::JSONReader::Read(data, false)); | 216 scoped_ptr<Value> result(base::JSONReader::Read(data, false)); |
| 217 if (!result->IsType(Value::TYPE_DICTIONARY)) | 217 if (!result->IsDictionary()) |
| 218 return; | 218 return; |
| 219 DictionaryValue* dictionary = static_cast<DictionaryValue*>(result.get()); | 219 DictionaryValue* dictionary = static_cast<DictionaryValue*>(result.get()); |
| 220 | 220 |
| 221 int id; | 221 int id; |
| 222 if (!dictionary->GetInteger("id", &id)) { | 222 if (!dictionary->GetInteger("id", &id)) { |
| 223 std::string method_name; | 223 std::string method_name; |
| 224 if (!dictionary->GetString("method", &method_name)) | 224 if (!dictionary->GetString("method", &method_name)) |
| 225 return; | 225 return; |
| 226 | 226 |
| 227 ListValue args; | 227 ListValue args; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 return; | 358 return; |
| 359 } | 359 } |
| 360 | 360 |
| 361 Value* result_body; | 361 Value* result_body; |
| 362 if (dictionary->Get("result", &result_body)) | 362 if (dictionary->Get("result", &result_body)) |
| 363 result_.reset(result_body->DeepCopy()); | 363 result_.reset(result_body->DeepCopy()); |
| 364 else | 364 else |
| 365 result_.reset(new DictionaryValue()); | 365 result_.reset(new DictionaryValue()); |
| 366 SendResponse(true); | 366 SendResponse(true); |
| 367 } | 367 } |
| OLD | NEW |