| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |