Chromium Code Reviews| 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. |
| { |