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

Unified Diff: chrome/browser/prefs/browser_prefs.cc

Issue 2736863002: Migrate the pref to always show the Cast icon (Closed)
Patch Set: . 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/browser_prefs.cc
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 318b76c80d666b49ffcd5c5812370f99e651f458..2cc58937eba3511d4afbf94f5e206b8f7b99edb3 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -261,6 +261,10 @@
#include "chrome/browser/ui/webui/md_history_ui.h"
#endif
+#if BUILDFLAG(ENABLE_EXTENSIONS) && defined(ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
+#endif
Bernhard Bauer 2017/03/08 14:05:24 Can you move this before the OS_CHROMEOS #ifdefs?
takumif 2017/03/08 19:09:43 Putting this with other ENABLE_EXTENSIONS includes
+
namespace {
#if BUILDFLAG(ENABLE_GOOGLE_NOW)
@@ -751,8 +755,24 @@ void MigrateObsoleteProfilePrefs(Profile* profile) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Added 2/2017.
- profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus);
-#endif
+ // NOTE(takumif): When removing this code, also remove the following tests:
+ // - MediaRouterUIBrowserTest.MigrateToolbarIconShownPref
+ // - MediaRouterUIBrowserTest.MigrateToolbarIconUnshownPref
+ {
+#if defined(ENABLE_MEDIA_ROUTER)
+ bool show_cast_icon = false;
+ const base::DictionaryValue* action_migration_dict =
+ profile_prefs->GetDictionary(kToolbarMigratedComponentActionStatus);
+ if (action_migration_dict &&
+ action_migration_dict->GetBoolean(
+ ComponentToolbarActionsFactory::kMediaRouterActionId,
+ &show_cast_icon)) {
+ profile_prefs->SetBoolean(prefs::kShowCastIconInToolbar, show_cast_icon);
+ }
+#endif // defined(ENABLE_MEDIA_ROUTER)
+ profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus);
+ }
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
// Added 2/2017.
{
« 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