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

Side by Side Diff: chrome/browser/prefs/browser_prefs.cc

Issue 2736863002: Migrate the pref to always show the Cast icon (Closed)
Patch Set: Group ifdefs Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698