| 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 #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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Failed, OnJSONParseFailed) | 220 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Failed, OnJSONParseFailed) |
| 221 IPC_MESSAGE_UNHANDLED(handled = false) | 221 IPC_MESSAGE_UNHANDLED(handled = false) |
| 222 IPC_END_MESSAGE_MAP() | 222 IPC_END_MESSAGE_MAP() |
| 223 return handled; | 223 return handled; |
| 224 } | 224 } |
| 225 | 225 |
| 226 void OnJSONParseSucceeded(const ListValue& wrapper) { | 226 void OnJSONParseSucceeded(const ListValue& wrapper) { |
| 227 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 227 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 228 Value* value = NULL; | 228 Value* value = NULL; |
| 229 CHECK(wrapper.Get(0, &value)); | 229 CHECK(wrapper.Get(0, &value)); |
| 230 if (value->IsType(Value::TYPE_DICTIONARY)) | 230 if (value->IsDictionary()) |
| 231 parsed_manifest_.reset(static_cast<DictionaryValue*>(value)->DeepCopy()); | 231 parsed_manifest_.reset(static_cast<DictionaryValue*>(value)->DeepCopy()); |
| 232 else | 232 else |
| 233 error_ = kManifestParseError; | 233 error_ = kManifestParseError; |
| 234 | 234 |
| 235 utility_host_ = NULL; // has already deleted itself | 235 utility_host_ = NULL; // has already deleted itself |
| 236 BrowserThread::PostTask( | 236 BrowserThread::PostTask( |
| 237 BrowserThread::UI, | 237 BrowserThread::UI, |
| 238 FROM_HERE, | 238 FROM_HERE, |
| 239 NewRunnableMethod(this, | 239 NewRunnableMethod(this, |
| 240 &SafeManifestJSONParser::ReportResultFromUIThread)); | 240 &SafeManifestJSONParser::ReportResultFromUIThread)); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; | 473 bool enabled = service->GetExtensionById(extension->id(), false) != NULL; |
| 474 args.Append(CreateExtensionInfo(*extension, enabled)); | 474 args.Append(CreateExtensionInfo(*extension, enabled)); |
| 475 } | 475 } |
| 476 | 476 |
| 477 std::string args_json; | 477 std::string args_json; |
| 478 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); | 478 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); |
| 479 | 479 |
| 480 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 480 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 481 event_name, args_json, NULL, GURL()); | 481 event_name, args_json, NULL, GURL()); |
| 482 } | 482 } |
| OLD | NEW |