Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[MD] Use strong call to action styling on solitary infobar buttons.
Browse files Browse the repository at this point in the history
BUG=596238

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

Cr-Commit-Position: refs/heads/master@{#386873}
(cherry picked from commit 81cd5c9)

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

Cr-Commit-Position: refs/branch-heads/2704@{#45}
Cr-Branched-From: 6e53600-refs/heads/master@{#386251}
  • Loading branch information
Evan Stade committed Apr 14, 2016
1 parent 7ffc303 commit 45b5708
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions chrome/browser/ui/views/infobars/confirm_infobar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,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(
Expand All @@ -100,12 +95,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(
Expand Down

0 comments on commit 45b5708

Please sign in to comment.