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

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: Indentation fixes and comment. 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 result->Set(keys::kValue, 360 result->Set(keys::kValue,
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 ExtensionPrefs* ep = profile_->GetExtensionService()->extension_prefs(); 365 ExtensionPrefs* ep = profile_->GetExtensionService()->extension_prefs();
366 result->SetBoolean(keys::kIncognitoSpecific, 366 result->SetBoolean(keys::kIncognitoSpecific,
367 ep->HasIncognitoPrefValue(browser_pref)); 367 ep->HasIncognitoPrefValue(browser_pref));
368 } 368 }
369 369
370 result_.reset(result.release()); 370 SetSingleResult(result.release());
371 return true; 371 return true;
372 } 372 }
373 373
374 SetPreferenceFunction::~SetPreferenceFunction() { } 374 SetPreferenceFunction::~SetPreferenceFunction() { }
375 375
376 bool SetPreferenceFunction::RunImpl() { 376 bool SetPreferenceFunction::RunImpl() {
377 std::string pref_key; 377 std::string pref_key;
378 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); 378 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key));
379 DictionaryValue* details = NULL; 379 DictionaryValue* details = NULL;
380 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); 380 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 478 }
479 479
480 std::string browser_pref; 480 std::string browser_pref;
481 if (!ValidateBrowserPref(pref_key, &browser_pref)) 481 if (!ValidateBrowserPref(pref_key, &browser_pref))
482 return false; 482 return false;
483 483
484 ExtensionPrefs* prefs = profile_->GetExtensionService()->extension_prefs(); 484 ExtensionPrefs* prefs = profile_->GetExtensionService()->extension_prefs();
485 prefs->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); 485 prefs->RemoveExtensionControlledPref(extension_id(), browser_pref, scope);
486 return true; 486 return true;
487 } 487 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698