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

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

Issue 10694106: Added support for multiple parameters to Extension API callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Synced. Created 8 years, 5 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
OLDNEW
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_preference_api.h" 5 #include "chrome/browser/extensions/extension_preference_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 transformer->BrowserToExtensionPref(pref->GetValue())); 361 transformer->BrowserToExtensionPref(pref->GetValue()));
362 362
363 // Retrieve incognito status. 363 // Retrieve incognito status.
364 if (incognito) { 364 if (incognito) {
365 extensions::ExtensionPrefs* ep = 365 extensions::ExtensionPrefs* ep =
366 profile_->GetExtensionService()->extension_prefs(); 366 profile_->GetExtensionService()->extension_prefs();
367 result->SetBoolean(keys::kIncognitoSpecific, 367 result->SetBoolean(keys::kIncognitoSpecific,
368 ep->HasIncognitoPrefValue(browser_pref)); 368 ep->HasIncognitoPrefValue(browser_pref));
369 } 369 }
370 370
371 result_.reset(result.release()); 371 SetResult(result.release());
372 return true; 372 return true;
373 } 373 }
374 374
375 SetPreferenceFunction::~SetPreferenceFunction() { } 375 SetPreferenceFunction::~SetPreferenceFunction() { }
376 376
377 bool SetPreferenceFunction::RunImpl() { 377 bool SetPreferenceFunction::RunImpl() {
378 std::string pref_key; 378 std::string pref_key;
379 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); 379 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key));
380 DictionaryValue* details = NULL; 380 DictionaryValue* details = NULL;
381 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); 381 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details));
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 std::string browser_pref; 486 std::string browser_pref;
487 if (!ValidateBrowserPref(pref_key, &browser_pref)) 487 if (!ValidateBrowserPref(pref_key, &browser_pref))
488 return false; 488 return false;
489 489
490 extensions::ExtensionPrefs* prefs = 490 extensions::ExtensionPrefs* prefs =
491 profile_->GetExtensionService()->extension_prefs(); 491 profile_->GetExtensionService()->extension_prefs();
492 prefs->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); 492 prefs->RemoveExtensionControlledPref(extension_id(), browser_pref, scope);
493 return true; 493 return true;
494 } 494 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698