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