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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 1860423003: Add a simple API around the pref controlling the default browser prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index ef9fc77ac883ff9880f9a87a421d7fa9aa3f4bc7..b5a1bb4f746890c56876464e3ee2f2cc1010fbe5 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -105,6 +105,7 @@
#include "ui/base/webui/web_ui_util.h"
#if !defined(OS_CHROMEOS)
+#include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/browser/ui/webui/settings_utils.h"
#endif
@@ -1143,8 +1144,7 @@ void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) {
// If the user attempted to make Chrome the default browser, notify
// them when this changes.
- PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
- prefs->SetBoolean(prefs::kCheckDefaultBrowser, true);
+ chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui()));
}
void BrowserOptionsHandler::OnDefaultBrowserWorkerFinished(
@@ -1155,8 +1155,7 @@ void BrowserOptionsHandler::OnDefaultBrowserWorkerFinished(
status_string_id = IDS_OPTIONS_DEFAULTBROWSER_DEFAULT;
// Notify the user in the future if Chrome ceases to be the user's chosen
// default browser.
- PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
- prefs->SetBoolean(prefs::kCheckDefaultBrowser, true);
+ chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui()));
} else if (state == shell_integration::NOT_DEFAULT) {
if (shell_integration::CanSetAsDefaultBrowser() ==
shell_integration::SET_DEFAULT_NOT_ALLOWED) {

Powered by Google App Engine
This is Rietveld 408576698