| 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.
|
| {
|
|
|