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

Unified Diff: chrome/browser/ui/startup/default_browser_prompt.cc

Issue 1578013002: Reset browser.check_default_browser on update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/default_browser_prompt.cc
diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc
index 9443190fb389a0fbd08a4b9841b19c5d33bbfcce..05a71626cd33d7d046a1e4424016b2977969099f 100644
--- a/chrome/browser/ui/startup/default_browser_prompt.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt.cc
@@ -37,6 +37,10 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/vector_icons_public.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace {
// The delegate for the infobar shown when Chrome is not the default browser.
@@ -296,12 +300,21 @@ void ShowDefaultBrowserPrompt(Profile* profile, HostDesktopType desktop_type) {
return;
}
+ PrefService* prefs = profile->GetPrefs();
+#if defined(OS_WIN)
+ // Reset preferences if kResetCheckDefaultBrowser is true.
+ if (base::win::GetVersion() >= base::win::VERSION_WIN10 &&
+ prefs->GetBoolean(prefs::kResetCheckDefaultBrowser)) {
+ prefs->SetBoolean(prefs::kResetCheckDefaultBrowser, false);
+ prefs->SetBoolean(prefs::kCheckDefaultBrowser, true);
+ }
+#endif
+
// 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(

Powered by Google App Engine
This is Rietveld 408576698