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

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

Issue 2744883002: 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 c71e8947b44bfd7c0774b7a27c0dfa33370beb03..5333417a0e3bd9f3cf3fa6cc43b903c89f79ffa2 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)
@@ -748,8 +751,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