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

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

Issue 1525163004: First stab at MD text buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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/native_theme/native_theme.h ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/md_text_button.h
diff --git a/ui/views/controls/button/md_text_button.h b/ui/views/controls/button/md_text_button.h
new file mode 100644
index 0000000000000000000000000000000000000000..ba982a32a9363a2129b714c3ef34df3dedf45dd8
--- /dev/null
+++ b/ui/views/controls/button/md_text_button.h
@@ -0,0 +1,37 @@
+// Copyright 2015 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_MD_TEXT_BUTTON_H_
+#define UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "ui/views/controls/button/custom_button.h"
+
+namespace gfx {
+class RenderText;
+}
+
+namespace views {
+
+// A button class that implements the Material Design text button spec.
+class VIEWS_EXPORT MdTextButton : public CustomButton {
+ public:
+ MdTextButton(ButtonListener* listener, const base::string16& text);
+ ~MdTextButton() override;
+
+ // View:
+ void OnPaint(gfx::Canvas* canvas) override;
+ gfx::Size GetPreferredSize() const override;
+
+ private:
+ void UpdateColor();
+
+ scoped_ptr<gfx::RenderText> render_text_;
+
+ DISALLOW_COPY_AND_ASSIGN(MdTextButton);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_
« no previous file with comments | « ui/native_theme/native_theme.h ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698