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

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: new approach without ditching the cancel button Created 4 years, 8 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/policy/core/browser/browser_policy_connector.h" 81 #include "components/policy/core/browser/browser_policy_connector.h"
81 #include "components/policy/core/browser/url_blacklist_manager.h" 82 #include "components/policy/core/browser/url_blacklist_manager.h"
82 #include "components/policy/core/common/policy_statistics_collector.h" 83 #include "components/policy/core/common/policy_statistics_collector.h"
83 #include "components/pref_registry/pref_registry_syncable.h" 84 #include "components/pref_registry/pref_registry_syncable.h"
84 #include "components/prefs/pref_registry_simple.h" 85 #include "components/prefs/pref_registry_simple.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 const char kOverscrollVerticalResistThreshold[] = 273 const char kOverscrollVerticalResistThreshold[] =
273 "overscroll.vertical_resist_threshold"; 274 "overscroll.vertical_resist_threshold";
274 #endif // defined(USE_AURA) 275 #endif // defined(USE_AURA)
275 276
276 #if BUILDFLAG(ENABLE_GOOGLE_NOW) 277 #if BUILDFLAG(ENABLE_GOOGLE_NOW)
277 // Deprecated 3/2016 278 // Deprecated 3/2016
278 const char kGoogleGeolocationAccessEnabled[] = 279 const char kGoogleGeolocationAccessEnabled[] =
279 "googlegeolocationaccess.enabled"; 280 "googlegeolocationaccess.enabled";
280 #endif 281 #endif
281 282
283 // Deprecated 4/2016.
284 const char kCheckDefaultBrowser[] = "browser.check_default_browser";
285
282 } // namespace 286 } // namespace
283 287
284 namespace chrome { 288 namespace chrome {
285 289
286 void RegisterLocalState(PrefRegistrySimple* registry) { 290 void RegisterLocalState(PrefRegistrySimple* registry) {
287 // Please keep this list alphabetized. 291 // Please keep this list alphabetized.
288 AppListService::RegisterPrefs(registry); 292 AppListService::RegisterPrefs(registry);
289 browser_shutdown::RegisterPrefs(registry); 293 browser_shutdown::RegisterPrefs(registry);
290 BrowserProcessImpl::RegisterPrefs(registry); 294 BrowserProcessImpl::RegisterPrefs(registry);
291 ChromeMetricsServiceClient::RegisterPrefs(registry); 295 ChromeMetricsServiceClient::RegisterPrefs(registry);
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 registry->RegisterDoublePref(kOverscrollVerticalResistThreshold, 0); 589 registry->RegisterDoublePref(kOverscrollVerticalResistThreshold, 0);
586 #endif // defined(USE_AURA) 590 #endif // defined(USE_AURA)
587 591
588 registry->RegisterListPref(kURLsToRestoreOnStartupOld); 592 registry->RegisterListPref(kURLsToRestoreOnStartupOld);
589 registry->RegisterInt64Pref(kRestoreStartupURLsMigrationTime, 0); 593 registry->RegisterInt64Pref(kRestoreStartupURLsMigrationTime, 0);
590 registry->RegisterBooleanPref(kRestoreOnStartupMigrated, false); 594 registry->RegisterBooleanPref(kRestoreOnStartupMigrated, false);
591 595
592 #if BUILDFLAG(ENABLE_GOOGLE_NOW) 596 #if BUILDFLAG(ENABLE_GOOGLE_NOW)
593 registry->RegisterBooleanPref(kGoogleGeolocationAccessEnabled, false); 597 registry->RegisterBooleanPref(kGoogleGeolocationAccessEnabled, false);
594 #endif 598 #endif
599
600 registry->RegisterBooleanPref(kCheckDefaultBrowser, true);
595 } 601 }
596 602
597 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 603 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
598 RegisterProfilePrefs(registry); 604 RegisterProfilePrefs(registry);
599 605
600 #if defined(OS_CHROMEOS) 606 #if defined(OS_CHROMEOS)
601 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry); 607 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry);
602 #endif 608 #endif
603 } 609 }
604 610
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 profile_prefs->ClearPref(kOverscrollMinimumThresholdStartTouchpad); 672 profile_prefs->ClearPref(kOverscrollMinimumThresholdStartTouchpad);
667 profile_prefs->ClearPref(kOverscrollVerticalThresholdStart); 673 profile_prefs->ClearPref(kOverscrollVerticalThresholdStart);
668 profile_prefs->ClearPref(kOverscrollHorizontalResistThreshold); 674 profile_prefs->ClearPref(kOverscrollHorizontalResistThreshold);
669 profile_prefs->ClearPref(kOverscrollVerticalResistThreshold); 675 profile_prefs->ClearPref(kOverscrollVerticalResistThreshold);
670 #endif // defined(USE_AURA) 676 #endif // defined(USE_AURA)
671 677
672 #if BUILDFLAG(ENABLE_GOOGLE_NOW) 678 #if BUILDFLAG(ENABLE_GOOGLE_NOW)
673 // Added 3/2016. 679 // Added 3/2016.
674 profile_prefs->ClearPref(kGoogleGeolocationAccessEnabled); 680 profile_prefs->ClearPref(kGoogleGeolocationAccessEnabled);
675 #endif 681 #endif
682
683 // Added 4/2016.
684 if (!profile_prefs->GetBoolean(kCheckDefaultBrowser)) {
685 // Seed kDefaultBrowserLastDeclined with the install date.
686 metrics::MetricsService* metrics_service =
687 g_browser_process->metrics_service();
688 base::Time install_time =
689 metrics_service
690 ? base::Time::FromTimeT(metrics_service->GetInstallDate())
691 : base::Time::Now();
692 profile_prefs->SetInt64(prefs::kDefaultBrowserLastDeclined,
693 install_time.ToInternalValue());
694 }
695 profile_prefs->ClearPref(kCheckDefaultBrowser);
676 } 696 }
677 697
678 } // namespace chrome 698 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698