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

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

Issue 1777813002: MD - use new style of text button in infobars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uac button cleanup Created 4 years, 9 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 7deab920a909a4ca9fb773992c4385d3b442ac26..2780bbf2096c6117581934a06109eae5e27b194a 100644
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
@@ -28,10 +28,10 @@ scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar(
ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate)
: InfoBarView(std::move(delegate)),
- label_(NULL),
- ok_button_(NULL),
- cancel_button_(NULL),
- link_(NULL) {}
+ label_(nullptr),
+ ok_button_(nullptr),
+ cancel_button_(nullptr),
+ link_(nullptr) {}
ConfirmInfoBar::~ConfirmInfoBar() {
// Ensure |elevation_icon_setter_| is destroyed before |ok_button_|.
@@ -64,23 +64,18 @@ void ConfirmInfoBar::Layout() {
void ConfirmInfoBar::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
- if (details.is_add && details.child == this && (label_ == NULL)) {
+ if (details.is_add && details.child == this && (label_ == nullptr)) {
ConfirmInfoBarDelegate* delegate = GetDelegate();
label_ = CreateLabel(delegate->GetMessageText());
AddViewToContentArea(label_);
if (delegate->GetButtons() & ConfirmInfoBarDelegate::BUTTON_OK) {
+ ok_button_ = CreateTextButton(
+ this, delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
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));
}
AddViewToContentArea(ok_button_);
ok_button_->SizeToPreferredSize();
« 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