diff options
author | Justin Schuh <jschuh@chromium.org> | 2016-01-11 18:50:47 -0800 |
---|---|---|
committer | Justin Schuh <jschuh@chromium.org> | 2016-01-12 02:53:04 +0000 |
commit | 9bb0e9e12ef9e59c77b4191616fde58bf7fcbe94 (patch) | |
tree | 0ece1587a732aa08935b91f8cf15ec701c3c89ed | |
parent | 0465a5029d4e5c2f8056565b817411f1874bc1c5 (diff) | |
download | chromium_src-9bb0e9e12ef9e59c77b4191616fde58bf7fcbe94.zip chromium_src-9bb0e9e12ef9e59c77b4191616fde58bf7fcbe94.tar.gz chromium_src-9bb0e9e12ef9e59c77b4191616fde58bf7fcbe94.tar.bz2 |
Reset browser.check_default_browser on browser update.
BUG=576490
Review URL: https://codereview.chromium.org/1578013002
Cr-Commit-Position: refs/heads/master@{#368753}
(cherry picked from commit cff89e9b8eeabe4ab1ae204212eb893483a51636)
Review URL: https://codereview.chromium.org/1574143002 .
Cr-Commit-Position: refs/branch-heads/2526@{#543}
Cr-Branched-From: cb947c0153db0ec02a8abbcb3ca086d88bf6006f-refs/heads/master@{#352221}
-rw-r--r-- | chrome/browser/ui/browser_ui_prefs.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/startup/default_browser_prompt.cc | 10 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 4 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 1 |
4 files changed, 23 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc index 1b25184..f6be7d4 100644 --- a/chrome/browser/ui/browser_ui_prefs.cc +++ b/chrome/browser/ui/browser_ui_prefs.cc @@ -13,6 +13,10 @@ #include "components/pref_registry/pref_registry_syncable.h" #include "components/translate/core/common/translate_pref_names.h" +#if defined(OS_WIN) +#include "base/win/windows_version.h" +#endif + namespace chrome { void RegisterBrowserPrefs(PrefRegistrySimple* registry) { @@ -77,6 +81,12 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, 0); registry->RegisterIntegerPref(prefs::kModuleConflictBubbleShown, 0); registry->RegisterBooleanPref(prefs::kCheckDefaultBrowser, true); + bool reset_check_default = false; +#if defined(OS_WIN) + reset_check_default = base::win::GetVersion() >= base::win::VERSION_WIN10; +#endif + registry->RegisterBooleanPref(prefs::kResetCheckDefaultBrowser, + reset_check_default); registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true); registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true); registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true); diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc index d1c9143..ed9e0af 100644 --- a/chrome/browser/ui/startup/default_browser_prompt.cc +++ b/chrome/browser/ui/startup/default_browser_prompt.cc @@ -329,12 +329,18 @@ void ShowDefaultBrowserPrompt(Profile* profile, HostDesktopType desktop_type) { return; } + PrefService* prefs = profile->GetPrefs(); + // Reset preferences if kResetCheckDefaultBrowser is true. + if (prefs->GetBoolean(prefs::kResetCheckDefaultBrowser)) { + prefs->SetBoolean(prefs::kResetCheckDefaultBrowser, false); + prefs->SetBoolean(prefs::kCheckDefaultBrowser, true); + } + // Check if Chrome is the default browser but do not prompt if: // - The user said "don't ask me again" on the infobar earlier. // - The "suppress_default_browser_prompt_for_version" master preference is // set to the current version. - bool show_prompt = - profile->GetPrefs()->GetBoolean(prefs::kCheckDefaultBrowser); + bool show_prompt = prefs->GetBoolean(prefs::kCheckDefaultBrowser); if (show_prompt) { const std::string disable_version_string = g_browser_process->local_state()->GetString( diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index b5b84de..74ee53c 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -937,6 +937,10 @@ const char kPluginsResourceCacheUpdate[] = "plugins.resource_cache_update"; // Boolean that indicates whether we should check if we are the default browser // on start-up. const char kCheckDefaultBrowser[] = "browser.check_default_browser"; +// Boolean that indicates whether the kCheckDefaultBrowser preference should be +// reset on start-up. +const char kResetCheckDefaultBrowser[] = + "browser.should_reset_check_default_browser"; // Policy setting whether default browser check should be disabled and default // browser registration should take place. diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 6e5bc6e..d7c4942 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -324,6 +324,7 @@ extern const char kPluginsMetadata[]; extern const char kPluginsResourceCacheUpdate[]; #endif extern const char kCheckDefaultBrowser[]; +extern const char kResetCheckDefaultBrowser[]; extern const char kDefaultBrowserSettingEnabled[]; #if defined(OS_MACOSX) extern const char kShowUpdatePromotionInfoBar[]; |