| 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 <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 APIPermission::kPrivacy | 104 APIPermission::kPrivacy |
| 105 }, | 105 }, |
| 106 { "thirdPartyCookiesAllowed", | 106 { "thirdPartyCookiesAllowed", |
| 107 prefs::kBlockThirdPartyCookies, | 107 prefs::kBlockThirdPartyCookies, |
| 108 APIPermission::kPrivacy | 108 APIPermission::kPrivacy |
| 109 }, | 109 }, |
| 110 { "translationServiceEnabled", | 110 { "translationServiceEnabled", |
| 111 prefs::kEnableTranslate, | 111 prefs::kEnableTranslate, |
| 112 APIPermission::kPrivacy | 112 APIPermission::kPrivacy |
| 113 }, | 113 }, |
| 114 #if defined(ENABLE_GOOGLE_NOW) | |
| 115 { "googlegeolocationaccessEnabled", | |
| 116 prefs::kGoogleGeolocationAccessEnabled, | |
| 117 APIPermission::kPreferencesPrivate | |
| 118 }, | |
| 119 #endif | |
| 120 }; | 114 }; |
| 121 | 115 |
| 122 class IdentityPrefTransformer : public PrefTransformerInterface { | 116 class IdentityPrefTransformer : public PrefTransformerInterface { |
| 123 public: | 117 public: |
| 124 virtual Value* ExtensionToBrowserPref(const Value* extension_pref, | 118 virtual Value* ExtensionToBrowserPref(const Value* extension_pref, |
| 125 std::string* error, | 119 std::string* error, |
| 126 bool* bad_message) OVERRIDE { | 120 bool* bad_message) OVERRIDE { |
| 127 return extension_pref->DeepCopy(); | 121 return extension_pref->DeepCopy(); |
| 128 } | 122 } |
| 129 | 123 |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 std::string browser_pref; | 736 std::string browser_pref; |
| 743 if (!ValidateBrowserPref(pref_key, &browser_pref)) | 737 if (!ValidateBrowserPref(pref_key, &browser_pref)) |
| 744 return false; | 738 return false; |
| 745 | 739 |
| 746 PreferenceAPI::Get(profile())->RemoveExtensionControlledPref( | 740 PreferenceAPI::Get(profile())->RemoveExtensionControlledPref( |
| 747 extension_id(), browser_pref, scope); | 741 extension_id(), browser_pref, scope); |
| 748 return true; | 742 return true; |
| 749 } | 743 } |
| 750 | 744 |
| 751 } // namespace extensions | 745 } // namespace extensions |
| OLD | NEW |