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

Side by Side Diff: chrome/browser/prefs/browser_prefs.cc

Issue 1748773002: Simplify the default browser infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync to position 379825 Created 4 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
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/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 65 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
66 #include "chrome/browser/ui/webui/plugins/plugins_ui.h" 66 #include "chrome/browser/ui/webui/plugins/plugins_ui.h"
67 #include "chrome/browser/ui/webui/print_preview/sticky_settings.h" 67 #include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
68 #include "chrome/common/features.h" 68 #include "chrome/common/features.h"
69 #include "chrome/common/pref_names.h" 69 #include "chrome/common/pref_names.h"
70 #include "components/autofill/core/browser/autofill_manager.h" 70 #include "components/autofill/core/browser/autofill_manager.h"
71 #include "components/content_settings/core/browser/host_content_settings_map.h" 71 #include "components/content_settings/core/browser/host_content_settings_map.h"
72 #include "components/dom_distiller/core/distilled_page_prefs.h" 72 #include "components/dom_distiller/core/distilled_page_prefs.h"
73 #include "components/flags_ui/pref_service_flags_storage.h" 73 #include "components/flags_ui/pref_service_flags_storage.h"
74 #include "components/gcm_driver/gcm_channel_status_syncer.h" 74 #include "components/gcm_driver/gcm_channel_status_syncer.h"
75 #include "components/metrics/metrics_service.h"
75 #include "components/network_time/network_time_tracker.h" 76 #include "components/network_time/network_time_tracker.h"
76 #include "components/ntp_snippets/ntp_snippets_service.h" 77 #include "components/ntp_snippets/ntp_snippets_service.h"
77 #include "components/omnibox/browser/zero_suggest_provider.h" 78 #include "components/omnibox/browser/zero_suggest_provider.h"
78 #include "components/password_manager/core/browser/password_bubble_experiment.h" 79 #include "components/password_manager/core/browser/password_bubble_experiment.h"
79 #include "components/password_manager/core/browser/password_manager.h" 80 #include "components/password_manager/core/browser/password_manager.h"
80 #include "components/pref_registry/pref_registry_syncable.h" 81 #include "components/pref_registry/pref_registry_syncable.h"
81 #include "components/prefs/pref_registry_simple.h" 82 #include "components/prefs/pref_registry_simple.h"
82 #include "components/prefs/pref_service.h" 83 #include "components/prefs/pref_service.h"
83 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" 84 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
84 #include "components/rappor/rappor_service.h" 85 #include "components/rappor/rappor_service.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // code was added and the timestamp of when the migration happened was tracked 243 // code was added and the timestamp of when the migration happened was tracked
243 // by "session.startup_urls_migration_time". Both are obsolete now (12/2015) and 244 // by "session.startup_urls_migration_time". Both are obsolete now (12/2015) and
244 // should be removed once a few releases have happened. 245 // should be removed once a few releases have happened.
245 const char kURLsToRestoreOnStartupOld[] = "session.urls_to_restore_on_startup"; 246 const char kURLsToRestoreOnStartupOld[] = "session.urls_to_restore_on_startup";
246 const char kRestoreStartupURLsMigrationTime[] = 247 const char kRestoreStartupURLsMigrationTime[] =
247 "session.startup_urls_migration_time"; 248 "session.startup_urls_migration_time";
248 249
249 // Deprecated 12/2015. 250 // Deprecated 12/2015.
250 const char kRestoreOnStartupMigrated[] = "session.restore_on_startup_migrated"; 251 const char kRestoreOnStartupMigrated[] = "session.restore_on_startup_migrated";
251 252
253 // Deprecated 3/2016.
254 const char kCheckDefaultBrowser[] = "browser.check_default_browser";
255
252 #if defined(USE_AURA) 256 #if defined(USE_AURA)
253 // Deprecated 1/2016. 257 // Deprecated 1/2016.
254 const char kMaxSeparationForGestureTouchesInPixels[] = 258 const char kMaxSeparationForGestureTouchesInPixels[] =
255 "gesture.max_separation_for_gesture_touches_in_pixels"; 259 "gesture.max_separation_for_gesture_touches_in_pixels";
256 const char kSemiLongPressTimeInMs[] = "gesture.semi_long_press_time_in_ms"; 260 const char kSemiLongPressTimeInMs[] = "gesture.semi_long_press_time_in_ms";
257 const char kTabScrubActivationDelayInMs[] = 261 const char kTabScrubActivationDelayInMs[] =
258 "gesture.tab_scrub_activation_delay_in_ms"; 262 "gesture.tab_scrub_activation_delay_in_ms";
259 const char kFlingMaxCancelToDownTimeInMs[] = 263 const char kFlingMaxCancelToDownTimeInMs[] =
260 "gesture.fling_max_cancel_to_down_time_in_ms"; 264 "gesture.fling_max_cancel_to_down_time_in_ms";
261 const char kFlingMaxTapGapTimeInMs[] = "gesture.fling_max_tap_gap_time_in_ms"; 265 const char kFlingMaxTapGapTimeInMs[] = "gesture.fling_max_tap_gap_time_in_ms";
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 registry->RegisterDoublePref(kOverscrollMinimumThresholdStart, 0); 584 registry->RegisterDoublePref(kOverscrollMinimumThresholdStart, 0);
581 registry->RegisterDoublePref(kOverscrollMinimumThresholdStartTouchpad, 0); 585 registry->RegisterDoublePref(kOverscrollMinimumThresholdStartTouchpad, 0);
582 registry->RegisterDoublePref(kOverscrollVerticalThresholdStart, 0); 586 registry->RegisterDoublePref(kOverscrollVerticalThresholdStart, 0);
583 registry->RegisterDoublePref(kOverscrollHorizontalResistThreshold, 0); 587 registry->RegisterDoublePref(kOverscrollHorizontalResistThreshold, 0);
584 registry->RegisterDoublePref(kOverscrollVerticalResistThreshold, 0); 588 registry->RegisterDoublePref(kOverscrollVerticalResistThreshold, 0);
585 #endif // defined(USE_AURA) 589 #endif // defined(USE_AURA)
586 590
587 registry->RegisterListPref(kURLsToRestoreOnStartupOld); 591 registry->RegisterListPref(kURLsToRestoreOnStartupOld);
588 registry->RegisterInt64Pref(kRestoreStartupURLsMigrationTime, 0); 592 registry->RegisterInt64Pref(kRestoreStartupURLsMigrationTime, 0);
589 registry->RegisterBooleanPref(kRestoreOnStartupMigrated, false); 593 registry->RegisterBooleanPref(kRestoreOnStartupMigrated, false);
594
595 registry->RegisterBooleanPref(kCheckDefaultBrowser, true);
590 } 596 }
591 597
592 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 598 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
593 RegisterProfilePrefs(registry); 599 RegisterProfilePrefs(registry);
594 600
595 #if defined(OS_CHROMEOS) 601 #if defined(OS_CHROMEOS)
596 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry); 602 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry);
597 #endif 603 #endif
598 } 604 }
599 605
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 profile_prefs->ClearPref(kMaxSeparationForGestureTouchesInPixels); 662 profile_prefs->ClearPref(kMaxSeparationForGestureTouchesInPixels);
657 profile_prefs->ClearPref(kSemiLongPressTimeInMs); 663 profile_prefs->ClearPref(kSemiLongPressTimeInMs);
658 profile_prefs->ClearPref(kOverscrollHorizontalThresholdComplete); 664 profile_prefs->ClearPref(kOverscrollHorizontalThresholdComplete);
659 profile_prefs->ClearPref(kOverscrollVerticalThresholdComplete); 665 profile_prefs->ClearPref(kOverscrollVerticalThresholdComplete);
660 profile_prefs->ClearPref(kOverscrollMinimumThresholdStart); 666 profile_prefs->ClearPref(kOverscrollMinimumThresholdStart);
661 profile_prefs->ClearPref(kOverscrollMinimumThresholdStartTouchpad); 667 profile_prefs->ClearPref(kOverscrollMinimumThresholdStartTouchpad);
662 profile_prefs->ClearPref(kOverscrollVerticalThresholdStart); 668 profile_prefs->ClearPref(kOverscrollVerticalThresholdStart);
663 profile_prefs->ClearPref(kOverscrollHorizontalResistThreshold); 669 profile_prefs->ClearPref(kOverscrollHorizontalResistThreshold);
664 profile_prefs->ClearPref(kOverscrollVerticalResistThreshold); 670 profile_prefs->ClearPref(kOverscrollVerticalResistThreshold);
665 #endif // defined(USE_AURA) 671 #endif // defined(USE_AURA)
672
673 // Added 3/2016.
674 if (!profile_prefs->GetBoolean(kCheckDefaultBrowser)) {
675 // Seed kDefaultBrowserLastDismissed with the install date.
676 metrics::MetricsService* metrics_service =
677 g_browser_process->metrics_service();
678 base::Time install_time =
679 metrics_service
680 ? base::Time::FromTimeT(metrics_service->GetInstallDate())
681 : base::Time::Now();
682 profile_prefs->SetInt64(prefs::kDefaultBrowserLastDismissed,
683 install_time.ToInternalValue());
684 }
685 profile_prefs->ClearPref(kCheckDefaultBrowser);
666 } 686 }
667 687
668 } // namespace chrome 688 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698