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_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 Loading... |
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 Loading... |
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 } |
OLD | NEW |