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

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

Issue 2148523002: Removed the "Don't ask again" button on the default browser prompt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_infobar_delegate.cc
diff --git a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
index bab51d959d87c8842e6288f32c8637ee6735f2db..40e20be33cbe5af8f1ed30bf8a09e844acefeab5 100644
--- a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
+++ b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
@@ -127,6 +127,9 @@ bool DefaultBrowserInfoBarDelegate::ShouldExpire(
}
void DefaultBrowserInfoBarDelegate::InfoBarDismissed() {
+ // This can get reached in tests where profile_ is null.
grt (UTC plus 2) 2016/07/14 06:31:16 does this treat 'x' and ignore equally? IIUC, 'x'
Patrick Monette 2016/07/14 17:42:57 InfoBarDismissed() is only called when the (X) but
+ if (profile_)
+ chrome::DefaultBrowserPromptDeclined(profile_);
content::RecordAction(
base::UserMetricsAction("DefaultBrowserInfoBar_Dismiss"));
UMA_HISTOGRAM_ENUMERATION("DefaultBrowser.InfoBar.UserInteraction",
@@ -138,8 +141,13 @@ base::string16 DefaultBrowserInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT);
}
+int DefaultBrowserInfoBarDelegate::GetButtons() const {
+ return BUTTON_OK;
+}
+
base::string16 DefaultBrowserInfoBarDelegate::GetButtonLabel(
InfoBarButton button) const {
+ DCHECK_EQ(BUTTON_OK, button);
#if defined(OS_WIN)
// On Windows 10, the "OK" button opens the Windows Settings application,
// through which the user must make their default browser choice.
@@ -151,9 +159,7 @@ base::string16 DefaultBrowserInfoBarDelegate::GetButtonLabel(
const int kSetAsDefaultButtonMessageId =
IDS_DEFAULT_BROWSER_INFOBAR_OK_BUTTON_LABEL;
#endif
- return l10n_util::GetStringUTF16(
- button == BUTTON_OK ? kSetAsDefaultButtonMessageId
- : IDS_DEFAULT_BROWSER_INFOBAR_CANCEL_BUTTON_LABEL);
+ return l10n_util::GetStringUTF16(kSetAsDefaultButtonMessageId);
}
// Setting an app as the default browser doesn't require elevation directly, but
@@ -189,18 +195,6 @@ bool DefaultBrowserInfoBarDelegate::Accept() {
return close_infobar;
}
-bool DefaultBrowserInfoBarDelegate::Cancel() {
- // This can get reached in tests where profile_ is null.
- if (profile_)
- chrome::DefaultBrowserPromptDeclined(profile_);
- content::RecordAction(
- base::UserMetricsAction("DefaultBrowserInfoBar_Cancel"));
- UMA_HISTOGRAM_ENUMERATION("DefaultBrowser.InfoBar.UserInteraction",
- CANCEL_INFO_BAR,
- NUM_INFO_BAR_USER_INTERACTION_TYPES);
- return true;
-}
-
scoped_refptr<shell_integration::DefaultBrowserWorker>
DefaultBrowserInfoBarDelegate::CreateDefaultBrowserWorker(
const shell_integration::DefaultWebClientWorkerCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698