OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/prefs/browser_prefs.h" | 5 #include "chrome/browser/prefs/browser_prefs.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 #if BUILDFLAG(ENABLE_EXTENSIONS) | 128 #if BUILDFLAG(ENABLE_EXTENSIONS) |
129 #include "chrome/browser/accessibility/animation_policy_prefs.h" | 129 #include "chrome/browser/accessibility/animation_policy_prefs.h" |
130 #include "chrome/browser/apps/shortcut_manager.h" | 130 #include "chrome/browser/apps/shortcut_manager.h" |
131 #include "chrome/browser/extensions/activity_log/activity_log.h" | 131 #include "chrome/browser/extensions/activity_log/activity_log.h" |
132 #include "chrome/browser/extensions/api/commands/command_service.h" | 132 #include "chrome/browser/extensions/api/commands/command_service.h" |
133 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 133 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
134 #include "chrome/browser/extensions/extension_web_ui.h" | 134 #include "chrome/browser/extensions/extension_web_ui.h" |
135 #include "chrome/browser/extensions/launch_util.h" | 135 #include "chrome/browser/extensions/launch_util.h" |
136 #include "chrome/browser/signin/easy_unlock_service.h" | 136 #include "chrome/browser/signin/easy_unlock_service.h" |
| 137 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" |
137 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" | 138 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" |
138 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" | 139 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
139 #include "extensions/browser/api/runtime/runtime_api.h" | 140 #include "extensions/browser/api/runtime/runtime_api.h" |
140 #include "extensions/browser/extension_prefs.h" | 141 #include "extensions/browser/extension_prefs.h" |
141 #if defined(ENABLE_MEDIA_ROUTER) | |
142 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" | |
143 #endif // defined(ENABLE_MEDIA_ROUTER) | |
144 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 142 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
145 | 143 |
146 #if BUILDFLAG(ENABLE_PLUGINS) | 144 #if BUILDFLAG(ENABLE_PLUGINS) |
147 #include "chrome/browser/plugins/plugins_resource_service.h" | 145 #include "chrome/browser/plugins/plugins_resource_service.h" |
148 #endif | 146 #endif |
149 | 147 |
150 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 148 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
151 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" | 149 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
152 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" | 150 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
153 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" | 151 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 // Added 9/2016. | 752 // Added 9/2016. |
755 profile_prefs->ClearPref(kWebKitUsesUniversalDetector); | 753 profile_prefs->ClearPref(kWebKitUsesUniversalDetector); |
756 profile_prefs->ClearPref(kWebKitAllowDisplayingInsecureContent); | 754 profile_prefs->ClearPref(kWebKitAllowDisplayingInsecureContent); |
757 | 755 |
758 #if BUILDFLAG(ENABLE_EXTENSIONS) | 756 #if BUILDFLAG(ENABLE_EXTENSIONS) |
759 // Added 2/2017. | 757 // Added 2/2017. |
760 // NOTE(takumif): When removing this code, also remove the following tests: | 758 // NOTE(takumif): When removing this code, also remove the following tests: |
761 // - MediaRouterUIBrowserTest.MigrateToolbarIconShownPref | 759 // - MediaRouterUIBrowserTest.MigrateToolbarIconShownPref |
762 // - MediaRouterUIBrowserTest.MigrateToolbarIconUnshownPref | 760 // - MediaRouterUIBrowserTest.MigrateToolbarIconUnshownPref |
763 { | 761 { |
764 #if defined(ENABLE_MEDIA_ROUTER) | |
765 bool show_cast_icon = false; | 762 bool show_cast_icon = false; |
766 const base::DictionaryValue* action_migration_dict = | 763 const base::DictionaryValue* action_migration_dict = |
767 profile_prefs->GetDictionary(kToolbarMigratedComponentActionStatus); | 764 profile_prefs->GetDictionary(kToolbarMigratedComponentActionStatus); |
768 if (action_migration_dict && | 765 if (action_migration_dict && |
769 action_migration_dict->GetBoolean( | 766 action_migration_dict->GetBoolean( |
770 ComponentToolbarActionsFactory::kMediaRouterActionId, | 767 ComponentToolbarActionsFactory::kMediaRouterActionId, |
771 &show_cast_icon)) { | 768 &show_cast_icon)) { |
772 profile_prefs->SetBoolean(prefs::kShowCastIconInToolbar, show_cast_icon); | 769 profile_prefs->SetBoolean(prefs::kShowCastIconInToolbar, show_cast_icon); |
773 } | 770 } |
774 #endif // defined(ENABLE_MEDIA_ROUTER) | |
775 profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus); | 771 profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus); |
776 } | 772 } |
777 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 773 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
778 | 774 |
779 // Added 2/2017. | 775 // Added 2/2017. |
780 { | 776 { |
781 #if BUILDFLAG(ENABLE_RLZ) | 777 #if BUILDFLAG(ENABLE_RLZ) |
782 const base::DictionaryValue* distro_dict = | 778 const base::DictionaryValue* distro_dict = |
783 profile_prefs->GetDictionary(kDistroDict); | 779 profile_prefs->GetDictionary(kDistroDict); |
784 int rlz_ping_delay = 0; | 780 int rlz_ping_delay = 0; |
785 if (distro_dict && | 781 if (distro_dict && |
786 distro_dict->GetInteger(kDistroRlzPingDelay, &rlz_ping_delay)) { | 782 distro_dict->GetInteger(kDistroRlzPingDelay, &rlz_ping_delay)) { |
787 profile_prefs->SetInteger(prefs::kRlzPingDelaySeconds, rlz_ping_delay); | 783 profile_prefs->SetInteger(prefs::kRlzPingDelaySeconds, rlz_ping_delay); |
788 } | 784 } |
789 #endif // BUILDFLAG(ENABLE_RLZ) | 785 #endif // BUILDFLAG(ENABLE_RLZ) |
790 profile_prefs->ClearPref(kDistroDict); | 786 profile_prefs->ClearPref(kDistroDict); |
791 } | 787 } |
792 } | 788 } |
793 | 789 |
794 } // namespace chrome | 790 } // namespace chrome |
OLD | NEW |