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

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

Issue 284033002: Allow TextButton derivatives to override drawing of certain parts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 7 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 | « no previous file | ui/views/controls/button/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/text_button.h
diff --git a/ui/views/controls/button/text_button.h b/ui/views/controls/button/text_button.h
index 9185b59f3694504d48ff28ab2e54339bb7c8273b..de612765ac1f8a2ed6fc0a8025f220dd9474aaee 100644
--- a/ui/views/controls/button/text_button.h
+++ b/ui/views/controls/button/text_button.h
@@ -160,6 +160,11 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
enum PaintButtonMode { PB_NORMAL, PB_FOR_DRAG };
virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode);
+ // Paint the button's text into the specified canvas. If |mode| is
+ // |PB_FOR_DRAG|, the function paints a drag image representation. Derived
+ // can override this function to change only the text rendering.
+ virtual void OnPaintText(gfx::Canvas* canvas, PaintButtonMode mode);
sky 2014/05/15 16:55:12 Why is this public?
Roger Tawa OOO till Jul 10th 2014/05/15 17:19:27 No good reason. Made it protected.
+
// Overridden from View:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;
@@ -328,6 +333,11 @@ class VIEWS_EXPORT TextButton : public TextButtonBase {
virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE;
protected:
+ // Paint the button's icon into the specified canvas. If |mode| is
+ // |PB_FOR_DRAG|, the function paints a drag image representation. Derived
+ // can override this function to change only the icon rendering.
+ virtual void OnPaintIcon(gfx::Canvas* canvas, PaintButtonMode mode);
+
gfx::ImageSkia icon() const { return icon_; }
virtual const gfx::ImageSkia& GetImageToPaint() const;
« no previous file with comments | « no previous file | ui/views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698