Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/browser/extensions/extension_management_api.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/extension_proxy_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698