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

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

Issue 2305933002: Update dialog close buttons to use vector icons and ripples. (Closed)
Patch Set: 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: 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 f03f984ef6e3d4854188cde0953b2cbff28353a0..4bc58155a35c4e4de00df43d057adc16366cb105 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -11,6 +11,7 @@
#include "ui/base/default_style.h"
#include "ui/base/hit_test.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/paint_context.h"
#include "ui/compositor/paint_recorder.h"
@@ -19,11 +20,13 @@
#include "ui/gfx/geometry/vector2d.h"
#include "ui/gfx/path.h"
#include "ui/gfx/skia_util.h"
+#include "ui/gfx/vector_icons_public.h"
#include "ui/native_theme/native_theme.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/vector_icon_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/layout_constants.h"
@@ -99,7 +102,14 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& title_margins,
BubbleFrameView::~BubbleFrameView() {}
// static
-LabelButton* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
+Button* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ VectorIconButton* close = new VectorIconButton(listener);
+ close->SetIcon(gfx::VectorIconId::BAR_CLOSE,
+ base::Callback<SkColor(void)>());
+ close->SetSize(close->GetPreferredSize());
+ return close;
+ }
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
LabelButton* close = new LabelButton(listener, base::string16());
close->SetImage(CustomButton::STATE_NORMAL,

Powered by Google App Engine
This is Rietveld 408576698