| 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/api/preference/preference_api.h" | 5 #include "chrome/browser/extensions/api/preference/preference_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 } | 658 } |
| 659 result->Set(keys::kValue, transformed_value); | 659 result->Set(keys::kValue, transformed_value); |
| 660 | 660 |
| 661 // Retrieve incognito status. | 661 // Retrieve incognito status. |
| 662 if (incognito) { | 662 if (incognito) { |
| 663 ExtensionPrefs* ep = ExtensionPrefs::Get(GetProfile()); | 663 ExtensionPrefs* ep = ExtensionPrefs::Get(GetProfile()); |
| 664 result->SetBoolean(keys::kIncognitoSpecific, | 664 result->SetBoolean(keys::kIncognitoSpecific, |
| 665 ep->HasIncognitoPrefValue(browser_pref)); | 665 ep->HasIncognitoPrefValue(browser_pref)); |
| 666 } | 666 } |
| 667 | 667 |
| 668 SetResult(result.release()); | 668 SetResult(std::move(result)); |
| 669 return true; | 669 return true; |
| 670 } | 670 } |
| 671 | 671 |
| 672 SetPreferenceFunction::~SetPreferenceFunction() { } | 672 SetPreferenceFunction::~SetPreferenceFunction() { } |
| 673 | 673 |
| 674 bool SetPreferenceFunction::RunSync() { | 674 bool SetPreferenceFunction::RunSync() { |
| 675 std::string pref_key; | 675 std::string pref_key; |
| 676 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); | 676 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &pref_key)); |
| 677 base::DictionaryValue* details = NULL; | 677 base::DictionaryValue* details = NULL; |
| 678 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); | 678 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details)); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) { | 793 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) { |
| 794 return false; | 794 return false; |
| 795 } | 795 } |
| 796 | 796 |
| 797 PreferenceAPI::Get(GetProfile()) | 797 PreferenceAPI::Get(GetProfile()) |
| 798 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); | 798 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); |
| 799 return true; | 799 return true; |
| 800 } | 800 } |
| 801 | 801 |
| 802 } // namespace extensions | 802 } // namespace extensions |
| OLD | NEW |