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

Unified Diff: chrome/browser/ui/webui/set_as_default_browser_ui.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/set_as_default_browser_ui.cc
diff --git a/chrome/browser/ui/webui/set_as_default_browser_ui.cc b/chrome/browser/ui/webui/set_as_default_browser_ui.cc
index 17176255fbc3960d8949200e3390b9c8c18c2bca..a9a6a9e2c79bc0e7310a1616e930e29c2dee3bc0 100644
--- a/chrome/browser/ui/webui/set_as_default_browser_ui.cc
+++ b/chrome/browser/ui/webui/set_as_default_browser_ui.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/singleton_tabs.h"
+#include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/browser/ui/sync/sync_promo_ui.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
@@ -291,12 +292,10 @@ void SetAsDefaultBrowserDialogImpl::OnDialogClosed(
dialog_interaction_result_,
MAKE_CHROME_DEFAULT_MAX);
- // If the user explicitly elected *not to* make Chrome default, we won't
- // ask again.
- if (dialog_interaction_result_ == MAKE_CHROME_DEFAULT_REGRETTED) {
- PrefService* prefs = profile_->GetPrefs();
- prefs->SetBoolean(prefs::kCheckDefaultBrowser, false);
- }
+ // Suppress showing the default browser infobar if the user explicitly elected
+ // *not to* make Chrome default.
+ if (dialog_interaction_result_ == MAKE_CHROME_DEFAULT_REGRETTED)
+ chrome::DefaultBrowserPromptDeclined(profile_);
// Carry on with a normal chrome session. For the purpose of surfacing this
// dialog the actual browser window had to remain hidden. Now it's time to

Powered by Google App Engine
This is Rietveld 408576698