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/extension_management_api.h" | 5 #include "chrome/browser/extensions/extension_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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 OnJSONParseSucceeded) | 239 OnJSONParseSucceeded) |
240 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 240 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
241 OnJSONParseFailed) | 241 OnJSONParseFailed) |
242 IPC_MESSAGE_UNHANDLED(handled = false) | 242 IPC_MESSAGE_UNHANDLED(handled = false) |
243 IPC_END_MESSAGE_MAP() | 243 IPC_END_MESSAGE_MAP() |
244 return handled; | 244 return handled; |
245 } | 245 } |
246 | 246 |
247 void OnJSONParseSucceeded(const ListValue& wrapper) { | 247 void OnJSONParseSucceeded(const ListValue& wrapper) { |
248 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 248 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
249 Value* value = NULL; | 249 const Value* value = NULL; |
250 CHECK(wrapper.Get(0, &value)); | 250 CHECK(wrapper.Get(0, &value)); |
251 if (value->IsType(Value::TYPE_DICTIONARY)) | 251 if (value->IsType(Value::TYPE_DICTIONARY)) |
252 parsed_manifest_.reset(static_cast<DictionaryValue*>(value)->DeepCopy()); | 252 parsed_manifest_.reset( |
| 253 static_cast<const DictionaryValue*>(value)->DeepCopy()); |
253 else | 254 else |
254 error_ = keys::kManifestParseError; | 255 error_ = keys::kManifestParseError; |
255 | 256 |
256 BrowserThread::PostTask( | 257 BrowserThread::PostTask( |
257 BrowserThread::UI, | 258 BrowserThread::UI, |
258 FROM_HERE, | 259 FROM_HERE, |
259 base::Bind(&SafeManifestJSONParser::ReportResultFromUIThread, this)); | 260 base::Bind(&SafeManifestJSONParser::ReportResultFromUIThread, this)); |
260 } | 261 } |
261 | 262 |
262 void OnJSONParseFailed(const std::string& error) { | 263 void OnJSONParseFailed(const std::string& error) { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 ExtensionService* service = profile->GetExtensionService(); | 586 ExtensionService* service = profile->GetExtensionService(); |
586 args.Append(CreateExtensionInfo(*extension, service)); | 587 args.Append(CreateExtensionInfo(*extension, service)); |
587 } | 588 } |
588 | 589 |
589 std::string args_json; | 590 std::string args_json; |
590 base::JSONWriter::Write(&args, &args_json); | 591 base::JSONWriter::Write(&args, &args_json); |
591 | 592 |
592 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 593 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
593 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); | 594 event_name, args_json, NULL, GURL(), extensions::EventFilteringInfo()); |
594 } | 595 } |
OLD | NEW |