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

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

Issue 1351623008: MD Settings: Languages model for language pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SingletonPrefs
Patch Set: Created 5 years, 3 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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 settings_private::PrefType::PREF_TYPE_BOOLEAN; 66 settings_private::PrefType::PREF_TYPE_BOOLEAN;
67 (*s_whitelist)["download.default_directory"] = 67 (*s_whitelist)["download.default_directory"] =
68 settings_private::PrefType::PREF_TYPE_STRING; 68 settings_private::PrefType::PREF_TYPE_STRING;
69 (*s_whitelist)["download.prompt_for_download"] = 69 (*s_whitelist)["download.prompt_for_download"] =
70 settings_private::PrefType::PREF_TYPE_BOOLEAN; 70 settings_private::PrefType::PREF_TYPE_BOOLEAN;
71 (*s_whitelist)["enable_do_not_track"] = 71 (*s_whitelist)["enable_do_not_track"] =
72 settings_private::PrefType::PREF_TYPE_BOOLEAN; 72 settings_private::PrefType::PREF_TYPE_BOOLEAN;
73 (*s_whitelist)["homepage"] = settings_private::PrefType::PREF_TYPE_URL; 73 (*s_whitelist)["homepage"] = settings_private::PrefType::PREF_TYPE_URL;
74 (*s_whitelist)["homepage_is_newtabpage"] = 74 (*s_whitelist)["homepage_is_newtabpage"] =
75 settings_private::PrefType::PREF_TYPE_BOOLEAN; 75 settings_private::PrefType::PREF_TYPE_BOOLEAN;
76 (*s_whitelist)["intl.app_locale"] =
77 settings_private::PrefType::PREF_TYPE_STRING;
76 (*s_whitelist)["net.network_prediction_options"] = 78 (*s_whitelist)["net.network_prediction_options"] =
77 settings_private::PrefType::PREF_TYPE_NUMBER; 79 settings_private::PrefType::PREF_TYPE_NUMBER;
78 (*s_whitelist)["safebrowsing.enabled"] = 80 (*s_whitelist)["safebrowsing.enabled"] =
79 settings_private::PrefType::PREF_TYPE_BOOLEAN; 81 settings_private::PrefType::PREF_TYPE_BOOLEAN;
80 (*s_whitelist)["safebrowsing.extended_reporting_enabled"] = 82 (*s_whitelist)["safebrowsing.extended_reporting_enabled"] =
81 settings_private::PrefType::PREF_TYPE_BOOLEAN; 83 settings_private::PrefType::PREF_TYPE_BOOLEAN;
82 (*s_whitelist)["search.suggest_enabled"] = 84 (*s_whitelist)["search.suggest_enabled"] =
83 settings_private::PrefType::PREF_TYPE_BOOLEAN; 85 settings_private::PrefType::PREF_TYPE_BOOLEAN;
86 (*s_whitelist)["spellcheck.dictionaries"] =
87 settings_private::PrefType::PREF_TYPE_LIST;
84 (*s_whitelist)["spellcheck.use_spelling_service"] = 88 (*s_whitelist)["spellcheck.use_spelling_service"] =
85 settings_private::PrefType::PREF_TYPE_BOOLEAN; 89 settings_private::PrefType::PREF_TYPE_BOOLEAN;
86 (*s_whitelist)["session.restore_on_startup"] = 90 (*s_whitelist)["session.restore_on_startup"] =
87 settings_private::PrefType::PREF_TYPE_NUMBER; 91 settings_private::PrefType::PREF_TYPE_NUMBER;
88 (*s_whitelist)["session.startup_urls"] = 92 (*s_whitelist)["session.startup_urls"] =
89 settings_private::PrefType::PREF_TYPE_LIST; 93 settings_private::PrefType::PREF_TYPE_LIST;
90 94
91 #if defined(OS_CHROMEOS) 95 #if defined(OS_CHROMEOS)
92 (*s_whitelist)["cros.accounts.allowBWSI"] = 96 (*s_whitelist)["cros.accounts.allowBWSI"] =
93 settings_private::PrefType::PREF_TYPE_BOOLEAN; 97 settings_private::PrefType::PREF_TYPE_BOOLEAN;
(...skipping 18 matching lines...) Expand all
112 (*s_whitelist)["settings.a11y.large_cursor_enabled"] = 116 (*s_whitelist)["settings.a11y.large_cursor_enabled"] =
113 settings_private::PrefType::PREF_TYPE_BOOLEAN; 117 settings_private::PrefType::PREF_TYPE_BOOLEAN;
114 (*s_whitelist)["settings.a11y.screen_magnifier"] = 118 (*s_whitelist)["settings.a11y.screen_magnifier"] =
115 settings_private::PrefType::PREF_TYPE_BOOLEAN; 119 settings_private::PrefType::PREF_TYPE_BOOLEAN;
116 (*s_whitelist)["settings.a11y.sticky_keys_enabled"] = 120 (*s_whitelist)["settings.a11y.sticky_keys_enabled"] =
117 settings_private::PrefType::PREF_TYPE_BOOLEAN; 121 settings_private::PrefType::PREF_TYPE_BOOLEAN;
118 (*s_whitelist)["settings.a11y.virtual_keyboard"] = 122 (*s_whitelist)["settings.a11y.virtual_keyboard"] =
119 settings_private::PrefType::PREF_TYPE_BOOLEAN; 123 settings_private::PrefType::PREF_TYPE_BOOLEAN;
120 (*s_whitelist)["settings.clock.use_24hour_clock"] = 124 (*s_whitelist)["settings.clock.use_24hour_clock"] =
121 settings_private::PrefType::PREF_TYPE_BOOLEAN; 125 settings_private::PrefType::PREF_TYPE_BOOLEAN;
126 (*s_whitelist)["settings.language.preferred_languages"] =
127 settings_private::PrefType::PREF_TYPE_STRING;
122 (*s_whitelist)["settings.touchpad.enable_tap_dragging"] = 128 (*s_whitelist)["settings.touchpad.enable_tap_dragging"] =
123 settings_private::PrefType::PREF_TYPE_BOOLEAN; 129 settings_private::PrefType::PREF_TYPE_BOOLEAN;
124 (*s_whitelist)["cros.metrics.reportingEnabled"] = 130 (*s_whitelist)["cros.metrics.reportingEnabled"] =
125 settings_private::PrefType::PREF_TYPE_BOOLEAN; 131 settings_private::PrefType::PREF_TYPE_BOOLEAN;
126 (*s_whitelist)["cros.device.attestation_for_content_protection_enabled"] = 132 (*s_whitelist)["cros.device.attestation_for_content_protection_enabled"] =
127 settings_private::PrefType::PREF_TYPE_BOOLEAN; 133 settings_private::PrefType::PREF_TYPE_BOOLEAN;
128 (*s_whitelist)["settings.internet.wake_on_wifi_ssid"] = 134 (*s_whitelist)["settings.internet.wake_on_wifi_ssid"] =
129 settings_private::PrefType::PREF_TYPE_BOOLEAN; 135 settings_private::PrefType::PREF_TYPE_BOOLEAN;
136 #else
137 (*s_whitelist)["intl.accept_languages"] =
138 settings_private::PrefType::PREF_TYPE_STRING;
130 #endif 139 #endif
131 140
132 return *s_whitelist; 141 return *s_whitelist;
133 } 142 }
134 143
135 settings_private::PrefType PrefsUtil::GetType(const std::string& name, 144 settings_private::PrefType PrefsUtil::GetType(const std::string& name,
136 base::Value::Type type) { 145 base::Value::Type type) {
137 switch (type) { 146 switch (type) {
138 case base::Value::Type::TYPE_BOOLEAN: 147 case base::Value::Type::TYPE_BOOLEAN:
139 return settings_private::PrefType::PREF_TYPE_BOOLEAN; 148 return settings_private::PrefType::PREF_TYPE_BOOLEAN;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 462
454 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { 463 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) {
455 #if defined(OS_CHROMEOS) 464 #if defined(OS_CHROMEOS)
456 return CrosSettings::Get()->IsCrosSettings(pref_name); 465 return CrosSettings::Get()->IsCrosSettings(pref_name);
457 #else 466 #else
458 return false; 467 return false;
459 #endif 468 #endif
460 } 469 }
461 470
462 } // namespace extensions 471 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698