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

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: Rebasing 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
« no previous file with comments | « chrome/browser/ui/startup/default_browser_infobar_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b9175c728460200fdd5fb81a6dc20033b42f6610..7a5fc909fd045176c4fd3c72019fa68b4f1be12f 100644
--- a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
+++ b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
@@ -135,6 +135,9 @@ bool DefaultBrowserInfoBarDelegate::ShouldExpire(
void DefaultBrowserInfoBarDelegate::InfoBarDismissed() {
action_taken_ = true;
+ // This can get reached in tests where profile_ is null.
+ if (profile_)
+ chrome::DefaultBrowserPromptDeclined(profile_);
content::RecordAction(
base::UserMetricsAction("DefaultBrowserInfoBar_Dismiss"));
UMA_HISTOGRAM_ENUMERATION("DefaultBrowser.InfoBar.UserInteraction",
@@ -146,8 +149,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.
@@ -159,9 +167,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
@@ -198,19 +204,6 @@ bool DefaultBrowserInfoBarDelegate::Accept() {
return close_infobar;
}
-bool DefaultBrowserInfoBarDelegate::Cancel() {
- action_taken_ = true;
- // 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) {
« no previous file with comments | « chrome/browser/ui/startup/default_browser_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698