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

Side by Side Diff: chrome/browser/extensions/api/preference/preference_api.cc

Issue 290123003: Exposes passwordSavingEnabled API from chrome privacy preference extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update code as per Bernhard's review comments. Created 6 years, 7 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/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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // write permission should not be granted. 59 // write permission should not be granted.
60 APIPermission::ID write_permission; 60 APIPermission::ID write_permission;
61 }; 61 };
62 62
63 const char kOnPrefChangeFormat[] = "types.ChromeSetting.%s.onChange"; 63 const char kOnPrefChangeFormat[] = "types.ChromeSetting.%s.onChange";
64 const char kConversionErrorMessage[] = 64 const char kConversionErrorMessage[] =
65 "Internal error: Stored value for preference '*' cannot be converted " 65 "Internal error: Stored value for preference '*' cannot be converted "
66 "properly."; 66 "properly.";
67 67
68 PrefMappingEntry kPrefMapping[] = { 68 PrefMappingEntry kPrefMapping[] = {
69 {"protectedContentEnabled", prefs::kEnableDRM, APIPermission::kPrivacy,
70 APIPermission::kPrivacy},
71 {"alternateErrorPagesEnabled", prefs::kAlternateErrorPagesEnabled, 69 {"alternateErrorPagesEnabled", prefs::kAlternateErrorPagesEnabled,
72 APIPermission::kPrivacy, APIPermission::kPrivacy}, 70 APIPermission::kPrivacy, APIPermission::kPrivacy},
73 {"autofillEnabled", autofill::prefs::kAutofillEnabled, 71 {"autofillEnabled", autofill::prefs::kAutofillEnabled,
74 APIPermission::kPrivacy, APIPermission::kPrivacy}, 72 APIPermission::kPrivacy, APIPermission::kPrivacy},
75 {"hyperlinkAuditingEnabled", prefs::kEnableHyperlinkAuditing, 73 {"hyperlinkAuditingEnabled", prefs::kEnableHyperlinkAuditing,
76 APIPermission::kPrivacy, APIPermission::kPrivacy}, 74 APIPermission::kPrivacy, APIPermission::kPrivacy},
77 {"networkPredictionEnabled", prefs::kNetworkPredictionEnabled, 75 {"networkPredictionEnabled", prefs::kNetworkPredictionEnabled,
78 APIPermission::kPrivacy, APIPermission::kPrivacy}, 76 APIPermission::kPrivacy, APIPermission::kPrivacy},
77 {"passwordManagerEnabled", password_manager::prefs::kPasswordManagerEnabled,
78 APIPermission::kPrivacy, APIPermission::kPrivacy},
79 {"protectedContentEnabled", prefs::kEnableDRM, APIPermission::kPrivacy,
80 APIPermission::kPrivacy},
79 {"proxy", prefs::kProxy, APIPermission::kProxy, APIPermission::kProxy}, 81 {"proxy", prefs::kProxy, APIPermission::kProxy, APIPermission::kProxy},
80 {"referrersEnabled", prefs::kEnableReferrers, APIPermission::kPrivacy, 82 {"referrersEnabled", prefs::kEnableReferrers, APIPermission::kPrivacy,
81 APIPermission::kPrivacy}, 83 APIPermission::kPrivacy},
82 {"safeBrowsingEnabled", prefs::kSafeBrowsingEnabled, 84 {"safeBrowsingEnabled", prefs::kSafeBrowsingEnabled,
83 APIPermission::kPrivacy, APIPermission::kPrivacy}, 85 APIPermission::kPrivacy, APIPermission::kPrivacy},
84 {"searchSuggestEnabled", prefs::kSearchSuggestEnabled, 86 {"searchSuggestEnabled", prefs::kSearchSuggestEnabled,
85 APIPermission::kPrivacy, APIPermission::kPrivacy}, 87 APIPermission::kPrivacy, APIPermission::kPrivacy},
86 {"spellingServiceEnabled", prefs::kSpellCheckUseSpellingService, 88 {"spellingServiceEnabled", prefs::kSpellCheckUseSpellingService,
87 APIPermission::kPrivacy, APIPermission::kPrivacy}, 89 APIPermission::kPrivacy, APIPermission::kPrivacy},
88 {"thirdPartyCookiesAllowed", prefs::kBlockThirdPartyCookies, 90 {"thirdPartyCookiesAllowed", prefs::kBlockThirdPartyCookies,
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) { 707 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) {
706 return false; 708 return false;
707 } 709 }
708 710
709 PreferenceAPI::Get(GetProfile()) 711 PreferenceAPI::Get(GetProfile())
710 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); 712 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope);
711 return true; 713 return true;
712 } 714 }
713 715
714 } // namespace extensions 716 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698