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

Unified Diff: chrome/browser/ui/views/infobars/confirm_infobar.cc

Issue 1871133002: [MD] Use strong call to action styling on solitary infobar buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: strong and independent 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/infobars/confirm_infobar.cc
diff --git a/chrome/browser/ui/views/infobars/confirm_infobar.cc b/chrome/browser/ui/views/infobars/confirm_infobar.cc
index d73d27c5382152c260369b9ab2fd25cd57f37ea1..37fc402bd101f29ee9c73ebd35235ea5a5dbf997 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -74,12 +74,7 @@ void ConfirmInfoBar::ViewHierarchyChanged(
if (ui::MaterialDesignController::IsModeMaterial()) {
views::MdTextButton* button = CreateMdTextButton(
this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
- // If this is the only button, weak call to action. Otherwise, strong
- // call to action.
- button->SetCallToAction(
- delegate->GetButtons() == ConfirmInfoBarDelegate::BUTTON_OK
- ? views::MdTextButton::WEAK_CALL_TO_ACTION
- : views::MdTextButton::STRONG_CALL_TO_ACTION);
+ button->SetCallToAction(views::MdTextButton::STRONG_CALL_TO_ACTION);
ok_button_ = button;
} else {
ok_button_ = CreateTextButton(
@@ -99,12 +94,9 @@ void ConfirmInfoBar::ViewHierarchyChanged(
views::MdTextButton* button = CreateMdTextButton(
this,
delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL));
- // If this is the only button, weak call to action. Otherwise, no call
- // to action.
- button->SetCallToAction(
- delegate->GetButtons() == ConfirmInfoBarDelegate::BUTTON_CANCEL
- ? views::MdTextButton::WEAK_CALL_TO_ACTION
- : views::MdTextButton::NO_CALL_TO_ACTION);
+ // Apply CTA only if the cancel button is the only button.
+ if (delegate->GetButtons() == ConfirmInfoBarDelegate::BUTTON_CANCEL)
+ button->SetCallToAction(views::MdTextButton::STRONG_CALL_TO_ACTION);
cancel_button_ = button;
} else {
cancel_button_ = CreateTextButton(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698