Commit 68736e1c authored by dominickn's avatar dominickn Committed by Commit bot

Removing unecessary button label

Remove the Cancel button from the app banner infobar on desktop.

This makes the infobar consistent with the mobile implementation, which
only has an Accept button and a dismissal X.

BUG=491001
R=benwells

Review URL: https://codereview.chromium.org/1163323004

Cr-Commit-Position: refs/heads/master@{#333720}
parent 5860788f
...@@ -7309,9 +7309,6 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -7309,9 +7309,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_ADD_TO_SHELF_INFOBAR_ADD_BUTTON" desc="Text displayed on the button to allow users to add to the site to their shelf"> <message name="IDS_ADD_TO_SHELF_INFOBAR_ADD_BUTTON" desc="Text displayed on the button to allow users to add to the site to their shelf">
Add Add
</message> </message>
<message name="IDS_ADD_TO_SHELF_INFOBAR_NEVER_BUTTON" desc="Text displayed on the button to prevent the add to shelf infobar from ever being displayed for this site">
Never for this site
</message>
<!-- about:system strings --> <!-- about:system strings -->
<if expr="not is_android"> <if expr="not is_android">
......
...@@ -61,11 +61,13 @@ base::string16 AppBannerInfoBarDelegateDesktop::GetMessageText() const { ...@@ -61,11 +61,13 @@ base::string16 AppBannerInfoBarDelegateDesktop::GetMessageText() const {
return l10n_util::GetStringUTF16(IDS_ADD_TO_SHELF_INFOBAR_TITLE); return l10n_util::GetStringUTF16(IDS_ADD_TO_SHELF_INFOBAR_TITLE);
} }
int AppBannerInfoBarDelegateDesktop::GetButtons() const {
return BUTTON_OK;
}
base::string16 AppBannerInfoBarDelegateDesktop::GetButtonLabel( base::string16 AppBannerInfoBarDelegateDesktop::GetButtonLabel(
InfoBarButton button) const { InfoBarButton button) const {
return l10n_util::GetStringUTF16((button == BUTTON_OK) return l10n_util::GetStringUTF16(IDS_ADD_TO_SHELF_INFOBAR_ADD_BUTTON);
? IDS_ADD_TO_SHELF_INFOBAR_ADD_BUTTON
: IDS_ADD_TO_SHELF_INFOBAR_NEVER_BUTTON);
} }
bool AppBannerInfoBarDelegateDesktop::Accept() { bool AppBannerInfoBarDelegateDesktop::Accept() {
...@@ -76,7 +78,7 @@ bool AppBannerInfoBarDelegateDesktop::Accept() { ...@@ -76,7 +78,7 @@ bool AppBannerInfoBarDelegateDesktop::Accept() {
return true; return true;
} }
bool AppBannerInfoBarDelegateDesktop::Cancel() { void AppBannerInfoBarDelegateDesktop::InfoBarDismissed() {
content::WebContents* web_contents = content::WebContents* web_contents =
InfoBarService::WebContentsFromInfoBar(infobar()); InfoBarService::WebContentsFromInfoBar(infobar());
if (web_contents) { if (web_contents) {
...@@ -91,11 +93,6 @@ bool AppBannerInfoBarDelegateDesktop::Cancel() { ...@@ -91,11 +93,6 @@ bool AppBannerInfoBarDelegateDesktop::Cancel() {
web_contents, web_manifest_.start_url.spec(), web_contents, web_manifest_.start_url.spec(),
AppBannerSettingsHelper::WEB); AppBannerSettingsHelper::WEB);
} }
return true;
}
void AppBannerInfoBarDelegateDesktop::InfoBarDismissed() {
Cancel();
} }
} // namespace banners } // namespace banners
...@@ -41,10 +41,10 @@ class AppBannerInfoBarDelegateDesktop : public ConfirmInfoBarDelegate { ...@@ -41,10 +41,10 @@ class AppBannerInfoBarDelegateDesktop : public ConfirmInfoBarDelegate {
// ConfirmInfoBarDelegate overrides. // ConfirmInfoBarDelegate overrides.
base::string16 GetMessageText() const override; base::string16 GetMessageText() const override;
int GetButtons() const override;
base::string16 GetButtonLabel(InfoBarButton button) const override; base::string16 GetButtonLabel(InfoBarButton button) const override;
bool Accept() override; bool Accept() override;
bool Cancel() override;
// InfoBarDelegate override. // InfoBarDelegate override.
void InfoBarDismissed() override; void InfoBarDismissed() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment