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

Unified Diff: chrome/browser/ui/webui/settings/settings_default_browser_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/settings/settings_default_browser_handler.cc
diff --git a/chrome/browser/ui/webui/settings/settings_default_browser_handler.cc b/chrome/browser/ui/webui/settings/settings_default_browser_handler.cc
index 119d8c71a2f165c61798762e92c4af082ded54e8..b2083d71e92ec21fe4452274fe59e0f3e8fa78a0 100644
--- a/chrome/browser/ui/webui/settings/settings_default_browser_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_default_browser_handler.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_ui.h"
@@ -56,8 +57,7 @@ void DefaultBrowserHandler::SetAsDefaultBrowser(const base::ListValue* args) {
// If the user attempted to make Chrome the default browser, notify
// them when this changes.
- Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean(
- prefs::kCheckDefaultBrowser, true);
+ chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui()));
}
void DefaultBrowserHandler::OnDefaultBrowserWorkerFinished(
@@ -65,8 +65,7 @@ void DefaultBrowserHandler::OnDefaultBrowserWorkerFinished(
if (state == shell_integration::IS_DEFAULT) {
// Notify the user in the future if Chrome ceases to be the user's chosen
// default browser.
- Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean(
- prefs::kCheckDefaultBrowser, true);
+ chrome::ResetDefaultBrowserPrompt(Profile::FromWebUI(web_ui()));
}
base::FundamentalValue is_default(state == shell_integration::IS_DEFAULT);

Powered by Google App Engine
This is Rietveld 408576698