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

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

Issue 2187473004: Make normal MD text buttons *on infobars* white. (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/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 2248818b88945327cfc6c949c62566b6da5aa834..1322140535c2ea1f7053e161e79d2d9eba685210 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -73,7 +73,7 @@ void ConfirmInfoBar::ViewHierarchyChanged(
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_OK) {
if (ui::MaterialDesignController::IsModeMaterial()) {
- views::MdTextButton* button = CreateMdTextButton(
+ views::MdTextButton* button = views::MdTextButton::CreateMdButton(
this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
button->SetCallToAction(true);
ok_button_ = button;
@@ -92,12 +92,20 @@ void ConfirmInfoBar::ViewHierarchyChanged(
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_CANCEL) {
if (ui::MaterialDesignController::IsModeMaterial()) {
- views::MdTextButton* button = CreateMdTextButton(
+ views::MdTextButton* button = views::MdTextButton::CreateMdButton(
this,
delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL));
- // Apply CTA only if the cancel button is the only button.
- button->SetCallToAction(delegate->GetButtons() ==
- ConfirmInfoBarDelegate::BUTTON_CANCEL);
+ if (delegate->GetButtons() == ConfirmInfoBarDelegate::BUTTON_CANCEL) {
+ // Apply CTA only if the cancel button is the only button.
+ button->SetCallToAction(true);
+ } else {
+ // Otherwise set the bg color to white and the text color to black.
+ // TODO(estade): These should be removed and moved into the native
+ // theme. Also, infobars should always use the normal (non-incognito)
+ // native theme.
+ button->set_bg_color_override(SK_ColorWHITE);
+ button->SetEnabledTextColors(kTextColor);
+ }
cancel_button_ = button;
} else {
cancel_button_ = CreateTextButton(
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | ui/views/controls/button/md_text_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698