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

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

Issue 1525163004: First stab at MD text buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 12 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 | « chrome/browser/ui/views/infobars/confirm_infobar.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | 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 b2ba67696cc50dd639692db28698c154ea1be52c..61f39beaa8bee3d8242495dc535eb3a0556339a5 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -70,18 +70,24 @@ void ConfirmInfoBar::ViewHierarchyChanged(
AddChildView(label_);
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_OK) {
- ok_button_ = CreateLabelButton(
- this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
- if (delegate->OKButtonTriggersUACPrompt())
+ if (delegate->OKButtonTriggersUACPrompt()) {
+ // Use a label button even in MD mode as MD buttons don't support icons.
+ views::LabelButton* ok_button = CreateLabelButton(
+ this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
elevation_icon_setter_.reset(new ElevationIconSetter(
- ok_button_,
+ ok_button,
base::Bind(&ConfirmInfoBar::Layout, base::Unretained(this))));
+ ok_button_ = ok_button;
+ } else {
+ ok_button_ = CreateTextButton(
+ this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
+ }
AddChildView(ok_button_);
ok_button_->SizeToPreferredSize();
}
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_CANCEL) {
- cancel_button_ = CreateLabelButton(
+ cancel_button_ = CreateTextButton(
this,
delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL));
AddChildView(cancel_button_);
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698