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

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: Rebase Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/preference/preference_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // write permission should not be granted. 61 // write permission should not be granted.
62 APIPermission::ID write_permission; 62 APIPermission::ID write_permission;
63 }; 63 };
64 64
65 const char kOnPrefChangeFormat[] = "types.ChromeSetting.%s.onChange"; 65 const char kOnPrefChangeFormat[] = "types.ChromeSetting.%s.onChange";
66 const char kConversionErrorMessage[] = 66 const char kConversionErrorMessage[] =
67 "Internal error: Stored value for preference '*' cannot be converted " 67 "Internal error: Stored value for preference '*' cannot be converted "
68 "properly."; 68 "properly.";
69 69
70 PrefMappingEntry kPrefMapping[] = { 70 PrefMappingEntry kPrefMapping[] = {
71 {"protectedContentEnabled", prefs::kEnableDRM, APIPermission::kPrivacy,
72 APIPermission::kPrivacy},
73 {"alternateErrorPagesEnabled", prefs::kAlternateErrorPagesEnabled, 71 {"alternateErrorPagesEnabled", prefs::kAlternateErrorPagesEnabled,
74 APIPermission::kPrivacy, APIPermission::kPrivacy}, 72 APIPermission::kPrivacy, APIPermission::kPrivacy},
75 {"autofillEnabled", autofill::prefs::kAutofillEnabled, 73 {"autofillEnabled", autofill::prefs::kAutofillEnabled,
76 APIPermission::kPrivacy, APIPermission::kPrivacy}, 74 APIPermission::kPrivacy, APIPermission::kPrivacy},
77 {"hyperlinkAuditingEnabled", prefs::kEnableHyperlinkAuditing, 75 {"hyperlinkAuditingEnabled", prefs::kEnableHyperlinkAuditing,
78 APIPermission::kPrivacy, APIPermission::kPrivacy}, 76 APIPermission::kPrivacy, APIPermission::kPrivacy},
79 {"networkPredictionEnabled", prefs::kNetworkPredictionEnabled, 77 {"networkPredictionEnabled", prefs::kNetworkPredictionEnabled,
80 APIPermission::kPrivacy, APIPermission::kPrivacy}, 78 APIPermission::kPrivacy, APIPermission::kPrivacy},
79 {"passwordSavingEnabled", password_manager::prefs::kPasswordManagerEnabled,
80 APIPermission::kPrivacy, APIPermission::kPrivacy},
81 {"protectedContentEnabled", prefs::kEnableDRM, APIPermission::kPrivacy,
82 APIPermission::kPrivacy},
81 {"proxy", prefs::kProxy, APIPermission::kProxy, APIPermission::kProxy}, 83 {"proxy", prefs::kProxy, APIPermission::kProxy, APIPermission::kProxy},
82 {"referrersEnabled", prefs::kEnableReferrers, APIPermission::kPrivacy, 84 {"referrersEnabled", prefs::kEnableReferrers, APIPermission::kPrivacy,
83 APIPermission::kPrivacy}, 85 APIPermission::kPrivacy},
84 {"safeBrowsingEnabled", prefs::kSafeBrowsingEnabled, 86 {"safeBrowsingEnabled", prefs::kSafeBrowsingEnabled,
85 APIPermission::kPrivacy, APIPermission::kPrivacy}, 87 APIPermission::kPrivacy, APIPermission::kPrivacy},
86 {"searchSuggestEnabled", prefs::kSearchSuggestEnabled, 88 {"searchSuggestEnabled", prefs::kSearchSuggestEnabled,
87 APIPermission::kPrivacy, APIPermission::kPrivacy}, 89 APIPermission::kPrivacy, APIPermission::kPrivacy},
88 {"spellingServiceEnabled", prefs::kSpellCheckUseSpellingService, 90 {"spellingServiceEnabled", prefs::kSpellCheckUseSpellingService,
89 APIPermission::kPrivacy, APIPermission::kPrivacy}, 91 APIPermission::kPrivacy, APIPermission::kPrivacy},
90 {"thirdPartyCookiesAllowed", prefs::kBlockThirdPartyCookies, 92 {"thirdPartyCookiesAllowed", prefs::kBlockThirdPartyCookies,
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) { 709 pref_key, PreferenceFunction::PERMISSION_TYPE_WRITE, &browser_pref)) {
708 return false; 710 return false;
709 } 711 }
710 712
711 PreferenceAPI::Get(GetProfile()) 713 PreferenceAPI::Get(GetProfile())
712 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); 714 ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope);
713 return true; 715 return true;
714 } 716 }
715 717
716 } // namespace extensions 718 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/preference/preference_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698