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

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

Issue 2347773003: Remove pre-MD infobar code (on Views). (Closed)
Patch Set: pkasting review/button image clear out Created 4 years, 3 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 5a7aa1599f09c1298c1fb75aaa08f0009b11fd06..f462b806e3624a8beb7ee986ca7602bc9b948ce9 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -72,15 +72,9 @@ void ConfirmInfoBar::ViewHierarchyChanged(
AddViewToContentArea(label_);
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_OK) {
- if (ui::MaterialDesignController::IsModeMaterial()) {
- views::MdTextButton* button = views::MdTextButton::Create(
- this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
- button->SetCallToAction(true);
- ok_button_ = button;
- } else {
- ok_button_ = CreateTextButton(
- this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
- }
+ ok_button_ = views::MdTextButton::Create(
+ this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
+ ok_button_->SetCallToAction(true);
if (delegate->OKButtonTriggersUACPrompt()) {
elevation_icon_setter_.reset(new ElevationIconSetter(
ok_button_,
@@ -91,26 +85,19 @@ void ConfirmInfoBar::ViewHierarchyChanged(
}
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_CANCEL) {
- if (ui::MaterialDesignController::IsModeMaterial()) {
- views::MdTextButton* button = views::MdTextButton::Create(
- this,
- delegate->GetButtonLabel(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;
+ cancel_button_ = views::MdTextButton::Create(
+ this,
+ delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL));
+ if (delegate->GetButtons() == ConfirmInfoBarDelegate::BUTTON_CANCEL) {
+ // Apply CTA only if the cancel button is the only button.
+ cancel_button_->SetCallToAction(true);
} else {
- cancel_button_ = CreateTextButton(
- this,
- delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL));
+ // 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.
+ cancel_button_->set_bg_color_override(SK_ColorWHITE);
+ cancel_button_->SetEnabledTextColors(kTextColor);
}
AddViewToContentArea(cancel_button_);
cancel_button_->SizeToPreferredSize();
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.h ('k') | chrome/browser/ui/views/infobars/infobar_background.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698