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

Side by Side Diff: ui/views/controls/button/image_button_util.h

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: tests 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 #ifndef UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_UTIL_H_
Evan Stade 2017/03/17 13:54:44 nit: not sure how many more things will be added t
sky 2017/03/17 15:38:12 I prefer not having files that become dumping grou
Bret 2017/03/17 23:41:41 I went with image_button_factory as the more speci
6 #define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_UTIL_H_
7
8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/views/views_export.h"
10
11 namespace gfx {
12 struct VectorIcon;
13 }
14
15 namespace views {
16
17 class ButtonListener;
18 class ImageButton;
19
20 // Creates an ImageButton with an ink drop and a centered image in preparation
21 // for applying a vector icon with SetImageFromVectorIcon below.
22 VIEWS_EXPORT ImageButton* CreateImageButtonWithVectorIconStyling(
Evan Stade 2017/03/17 13:54:45 nit: naming is hard, but I'd give this a shorter n
Bret 2017/03/17 23:41:41 This one is pretty tough. I went with your suggest
23 ButtonListener* listener);
24
25 // Sets images on |button| for STATE_NORMAL and STATE_DISABLED from the given
26 // vector icon and color.
sky 2017/03/17 15:38:12 optional: as a common pattern is calling this from
Bret 2017/03/17 23:41:41 I put in a sentence about calling this again if th
27 VIEWS_EXPORT void SetImageFromVectorIcon(ImageButton* button,
28 const gfx::VectorIcon& icon,
29 SkColor base_color);
Evan Stade 2017/03/17 13:54:45 nit: the nomenclature here is probably my fault, b
Evan Stade 2017/03/17 13:54:45 nit: I think we should make base_color optional, a
Bret 2017/03/17 23:41:41 I updated the names and comment. I'm a bit hesitan
Evan Stade 2017/03/18 00:27:58 It was already optional. Callers that didn't speci
Bret 2017/03/18 20:12:53 Okay, done.
30
31 } // namespace views
32
33 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698