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 #include "chrome/browser/extensions/api/management/management_api.h" | 5 #include "chrome/browser/extensions/api/management/management_api.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 OnJSONParseSucceeded) | 261 OnJSONParseSucceeded) |
262 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 262 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
263 OnJSONParseFailed) | 263 OnJSONParseFailed) |
264 IPC_MESSAGE_UNHANDLED(handled = false) | 264 IPC_MESSAGE_UNHANDLED(handled = false) |
265 IPC_END_MESSAGE_MAP() | 265 IPC_END_MESSAGE_MAP() |
266 return handled; | 266 return handled; |
267 } | 267 } |
268 | 268 |
269 void OnJSONParseSucceeded(const ListValue& wrapper) { | 269 void OnJSONParseSucceeded(const ListValue& wrapper) { |
270 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 270 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
271 Value* value = NULL; | 271 const Value* value = NULL; |
272 CHECK(wrapper.Get(0, &value)); | 272 CHECK(wrapper.Get(0, &value)); |
273 if (value->IsType(Value::TYPE_DICTIONARY)) | 273 if (value->IsType(Value::TYPE_DICTIONARY)) |
274 parsed_manifest_.reset(static_cast<DictionaryValue*>(value)->DeepCopy()); | 274 parsed_manifest_.reset( |
| 275 static_cast<const DictionaryValue*>(value)->DeepCopy()); |
275 else | 276 else |
276 error_ = keys::kManifestParseError; | 277 error_ = keys::kManifestParseError; |
277 | 278 |
278 BrowserThread::PostTask( | 279 BrowserThread::PostTask( |
279 BrowserThread::UI, | 280 BrowserThread::UI, |
280 FROM_HERE, | 281 FROM_HERE, |
281 base::Bind(&SafeManifestJSONParser::ReportResultFromUIThread, this)); | 282 base::Bind(&SafeManifestJSONParser::ReportResultFromUIThread, this)); |
282 } | 283 } |
283 | 284 |
284 void OnJSONParseFailed(const std::string& error) { | 285 void OnJSONParseFailed(const std::string& error) { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 ExtensionService* service = profile->GetExtensionService(); | 608 ExtensionService* service = profile->GetExtensionService(); |
608 args.Append(CreateExtensionInfo(*extension, service)); | 609 args.Append(CreateExtensionInfo(*extension, service)); |
609 } | 610 } |
610 | 611 |
611 std::string args_json; | 612 std::string args_json; |
612 base::JSONWriter::Write(&args, &args_json); | 613 base::JSONWriter::Write(&args, &args_json); |
613 | 614 |
614 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 615 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
615 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); | 616 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); |
616 } | 617 } |
OLD | NEW |