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

Side by Side Diff: chrome/browser/extensions/api/settings_private/prefs_util.cc

Issue 1457713007: Update the "Passwords and Forms" section so that they can be toggled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Big simplification! Created 5 years 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/resources/settings/passwords_and_forms_page/passwords_and_forms_page.css » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/settings_private/prefs_util.h" 5 #include "chrome/browser/extensions/api/settings_private/prefs_util.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h" 9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 using CrosSettings = chromeos::CrosSettings; 54 using CrosSettings = chromeos::CrosSettings;
55 #endif 55 #endif
56 56
57 const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() { 57 const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
58 static PrefsUtil::TypedPrefMap* s_whitelist = nullptr; 58 static PrefsUtil::TypedPrefMap* s_whitelist = nullptr;
59 if (s_whitelist) 59 if (s_whitelist)
60 return *s_whitelist; 60 return *s_whitelist;
61 s_whitelist = new PrefsUtil::TypedPrefMap(); 61 s_whitelist = new PrefsUtil::TypedPrefMap();
62 (*s_whitelist)["alternate_error_pages.enabled"] = 62 (*s_whitelist)["alternate_error_pages.enabled"] =
63 settings_private::PrefType::PREF_TYPE_BOOLEAN; 63 settings_private::PrefType::PREF_TYPE_BOOLEAN;
64 (*s_whitelist)["autofill.enabled"] =
65 settings_private::PrefType::PREF_TYPE_BOOLEAN;
64 (*s_whitelist)["bookmark_bar.show_on_all_tabs"] = 66 (*s_whitelist)["bookmark_bar.show_on_all_tabs"] =
65 settings_private::PrefType::PREF_TYPE_BOOLEAN; 67 settings_private::PrefType::PREF_TYPE_BOOLEAN;
66 (*s_whitelist)["browser.show_home_button"] = 68 (*s_whitelist)["browser.show_home_button"] =
67 settings_private::PrefType::PREF_TYPE_BOOLEAN; 69 settings_private::PrefType::PREF_TYPE_BOOLEAN;
68 (*s_whitelist)["download.default_directory"] = 70 (*s_whitelist)["download.default_directory"] =
69 settings_private::PrefType::PREF_TYPE_STRING; 71 settings_private::PrefType::PREF_TYPE_STRING;
70 (*s_whitelist)["download.prompt_for_download"] = 72 (*s_whitelist)["download.prompt_for_download"] =
71 settings_private::PrefType::PREF_TYPE_BOOLEAN; 73 settings_private::PrefType::PREF_TYPE_BOOLEAN;
72 (*s_whitelist)["enable_do_not_track"] = 74 (*s_whitelist)["enable_do_not_track"] =
73 settings_private::PrefType::PREF_TYPE_BOOLEAN; 75 settings_private::PrefType::PREF_TYPE_BOOLEAN;
74 (*s_whitelist)["homepage"] = settings_private::PrefType::PREF_TYPE_URL; 76 (*s_whitelist)["homepage"] = settings_private::PrefType::PREF_TYPE_URL;
75 (*s_whitelist)["homepage_is_newtabpage"] = 77 (*s_whitelist)["homepage_is_newtabpage"] =
76 settings_private::PrefType::PREF_TYPE_BOOLEAN; 78 settings_private::PrefType::PREF_TYPE_BOOLEAN;
77 (*s_whitelist)["intl.app_locale"] = 79 (*s_whitelist)["intl.app_locale"] =
78 settings_private::PrefType::PREF_TYPE_STRING; 80 settings_private::PrefType::PREF_TYPE_STRING;
79 (*s_whitelist)["net.network_prediction_options"] = 81 (*s_whitelist)["net.network_prediction_options"] =
80 settings_private::PrefType::PREF_TYPE_NUMBER; 82 settings_private::PrefType::PREF_TYPE_NUMBER;
83 (*s_whitelist)["profile.password_manager_enabled"] =
84 settings_private::PrefType::PREF_TYPE_BOOLEAN;
81 (*s_whitelist)["safebrowsing.enabled"] = 85 (*s_whitelist)["safebrowsing.enabled"] =
82 settings_private::PrefType::PREF_TYPE_BOOLEAN; 86 settings_private::PrefType::PREF_TYPE_BOOLEAN;
83 (*s_whitelist)["safebrowsing.extended_reporting_enabled"] = 87 (*s_whitelist)["safebrowsing.extended_reporting_enabled"] =
84 settings_private::PrefType::PREF_TYPE_BOOLEAN; 88 settings_private::PrefType::PREF_TYPE_BOOLEAN;
85 (*s_whitelist)["search.suggest_enabled"] = 89 (*s_whitelist)["search.suggest_enabled"] =
86 settings_private::PrefType::PREF_TYPE_BOOLEAN; 90 settings_private::PrefType::PREF_TYPE_BOOLEAN;
87 (*s_whitelist)["session.restore_on_startup"] = 91 (*s_whitelist)["session.restore_on_startup"] =
88 settings_private::PrefType::PREF_TYPE_NUMBER; 92 settings_private::PrefType::PREF_TYPE_NUMBER;
89 (*s_whitelist)["session.startup_urls"] = 93 (*s_whitelist)["session.startup_urls"] =
90 settings_private::PrefType::PREF_TYPE_LIST; 94 settings_private::PrefType::PREF_TYPE_LIST;
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 554
551 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { 555 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) {
552 #if defined(OS_CHROMEOS) 556 #if defined(OS_CHROMEOS)
553 return CrosSettings::Get()->IsCrosSettings(pref_name); 557 return CrosSettings::Get()->IsCrosSettings(pref_name);
554 #else 558 #else
555 return false; 559 return false;
556 #endif 560 #endif
557 } 561 }
558 562
559 } // namespace extensions 563 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698