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

Unified 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 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..a0bfa6fae378f68ccfaaa4dd1d40290e799a6b47 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -137,6 +137,9 @@
#include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
#include "extensions/browser/api/runtime/runtime_api.h"
#include "extensions/browser/extension_prefs.h"
+#if defined(ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
+#endif // defined(ENABLE_MEDIA_ROUTER)
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION)
@@ -751,8 +754,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