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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: check details Created 3 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 | « ui/views/bubble/bubble_frame_view.h ('k') | ui/views/controls/button/image_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index a8220bc7a0771f400516dfc07091f7e35abf86ca..b65695e9a7ffb72b7dee365c9391b34ffb9f4367 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -25,7 +25,8 @@
#include "ui/strings/grit/ui_strings.h"
#include "ui/vector_icons/vector_icons.h"
#include "ui/views/bubble/bubble_border.h"
-#include "ui/views/controls/button/vector_icon_button.h"
+#include "ui/views/controls/button/image_button.h"
+#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
@@ -108,15 +109,14 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& title_margins,
BubbleFrameView::~BubbleFrameView() {}
// static
-Button* BubbleFrameView::CreateCloseButton(VectorIconButtonDelegate* delegate) {
+Button* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
ImageButton* close_button = nullptr;
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
- VectorIconButton* close = new VectorIconButton(delegate);
- close->SetIcon(ui::kCloseIcon);
- close_button = close;
+ close_button = CreateVectorImageButton(listener);
+ SetImageFromVectorIcon(close_button, ui::kCloseIcon);
} else {
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
- close_button = new ImageButton(delegate);
+ close_button = new ImageButton(listener);
close_button->SetImage(CustomButton::STATE_NORMAL,
*rb->GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
close_button->SetImage(
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | ui/views/controls/button/image_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698