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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/prefs/browser_prefs.h" 5 #include "chrome/browser/prefs/browser_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 #endif 254 #endif
255 255
256 #if defined(USE_ASH) 256 #if defined(USE_ASH)
257 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" 257 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
258 #endif 258 #endif
259 259
260 #if !defined(OS_ANDROID) && !defined(OS_IOS) 260 #if !defined(OS_ANDROID) && !defined(OS_IOS)
261 #include "chrome/browser/ui/webui/md_history_ui.h" 261 #include "chrome/browser/ui/webui/md_history_ui.h"
262 #endif 262 #endif
263 263
264 #if BUILDFLAG(ENABLE_EXTENSIONS) && defined(ENABLE_MEDIA_ROUTER)
265 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
266 #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
267
264 namespace { 268 namespace {
265 269
266 #if BUILDFLAG(ENABLE_GOOGLE_NOW) 270 #if BUILDFLAG(ENABLE_GOOGLE_NOW)
267 // Deprecated 3/2016 271 // Deprecated 3/2016
268 constexpr char kGoogleGeolocationAccessEnabled[] = 272 constexpr char kGoogleGeolocationAccessEnabled[] =
269 "googlegeolocationaccess.enabled"; 273 "googlegeolocationaccess.enabled";
270 #endif 274 #endif
271 275
272 // Deprecated 4/2016. 276 // Deprecated 4/2016.
273 constexpr char kCheckDefaultBrowser[] = "browser.check_default_browser"; 277 constexpr char kCheckDefaultBrowser[] = "browser.check_default_browser";
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 // Added 8/2016. 748 // Added 8/2016.
745 profile_prefs->ClearPref(kStaticEncodings); 749 profile_prefs->ClearPref(kStaticEncodings);
746 profile_prefs->ClearPref(kRecentlySelectedEncoding); 750 profile_prefs->ClearPref(kRecentlySelectedEncoding);
747 751
748 // Added 9/2016. 752 // Added 9/2016.
749 profile_prefs->ClearPref(kWebKitUsesUniversalDetector); 753 profile_prefs->ClearPref(kWebKitUsesUniversalDetector);
750 profile_prefs->ClearPref(kWebKitAllowDisplayingInsecureContent); 754 profile_prefs->ClearPref(kWebKitAllowDisplayingInsecureContent);
751 755
752 #if BUILDFLAG(ENABLE_EXTENSIONS) 756 #if BUILDFLAG(ENABLE_EXTENSIONS)
753 // Added 2/2017. 757 // Added 2/2017.
754 profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus); 758 // NOTE(takumif): When removing this code, also remove the following tests:
755 #endif 759 // - MediaRouterUIBrowserTest.MigrateToolbarIconShownPref
760 // - MediaRouterUIBrowserTest.MigrateToolbarIconUnshownPref
761 {
762 #if defined(ENABLE_MEDIA_ROUTER)
763 bool show_cast_icon = false;
764 const base::DictionaryValue* action_migration_dict =
765 profile_prefs->GetDictionary(kToolbarMigratedComponentActionStatus);
766 if (action_migration_dict &&
767 action_migration_dict->GetBoolean(
768 ComponentToolbarActionsFactory::kMediaRouterActionId,
769 &show_cast_icon)) {
770 profile_prefs->SetBoolean(prefs::kShowCastIconInToolbar, show_cast_icon);
771 }
772 #endif // defined(ENABLE_MEDIA_ROUTER)
773 profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus);
774 }
775 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
756 776
757 // Added 2/2017. 777 // Added 2/2017.
758 { 778 {
759 #if BUILDFLAG(ENABLE_RLZ) 779 #if BUILDFLAG(ENABLE_RLZ)
760 const base::DictionaryValue* distro_dict = 780 const base::DictionaryValue* distro_dict =
761 profile_prefs->GetDictionary(kDistroDict); 781 profile_prefs->GetDictionary(kDistroDict);
762 int rlz_ping_delay = 0; 782 int rlz_ping_delay = 0;
763 if (distro_dict && 783 if (distro_dict &&
764 distro_dict->GetInteger(kDistroRlzPingDelay, &rlz_ping_delay)) { 784 distro_dict->GetInteger(kDistroRlzPingDelay, &rlz_ping_delay)) {
765 profile_prefs->SetInteger(prefs::kRlzPingDelaySeconds, rlz_ping_delay); 785 profile_prefs->SetInteger(prefs::kRlzPingDelaySeconds, rlz_ping_delay);
766 } 786 }
767 #endif // BUILDFLAG(ENABLE_RLZ) 787 #endif // BUILDFLAG(ENABLE_RLZ)
768 profile_prefs->ClearPref(kDistroDict); 788 profile_prefs->ClearPref(kDistroDict);
769 } 789 }
770 } 790 }
771 791
772 } // namespace chrome 792 } // namespace chrome
OLDNEW
« 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