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

Unified Diff: ui/views/controls/button/image_button_factory.h

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/controls/button/image_button.h ('k') | ui/views/controls/button/image_button_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/image_button_factory.h
diff --git a/ui/views/controls/button/image_button_factory.h b/ui/views/controls/button/image_button_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..d9659570d0a28fc5589055699e322f5f8a6b5306
--- /dev/null
+++ b/ui/views/controls/button/image_button_factory.h
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+#ifndef UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_FACTORY_H_
+#define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_FACTORY_H_
+
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/views/views_export.h"
+
+namespace gfx {
+struct VectorIcon;
+}
+
+namespace views {
+
+class ButtonListener;
+class ImageButton;
+
+// Creates an ImageButton with an ink drop and a centered image in preparation
+// for applying a vector icon with SetImageFromVectorIcon below.
+VIEWS_EXPORT ImageButton* CreateVectorImageButton(ButtonListener* listener);
+
+// Sets images on |button| for STATE_NORMAL and STATE_DISABLED from the given
+// vector icon and color. |related_text_color| is normally the main text color
+// used in the parent view, and the actual color used is derived from that. Call
+// again to update the button if |related_text_color| is changing.
+VIEWS_EXPORT void SetImageFromVectorIcon(
+ ImageButton* button,
+ const gfx::VectorIcon& icon,
+ SkColor related_text_color = SK_ColorBLACK);
+
+} // namespace views
+
+#endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_FACTORY_H_
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | ui/views/controls/button/image_button_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698