OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
6 #define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/base/layout.h" | 10 #include "ui/base/layout.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void SetPreferredSize(const gfx::Size& preferred_size) { | 62 void SetPreferredSize(const gfx::Size& preferred_size) { |
63 preferred_size_ = preferred_size; | 63 preferred_size_ = preferred_size; |
64 } | 64 } |
65 | 65 |
66 // Whether we should draw our images resources horizontally flipped. | 66 // Whether we should draw our images resources horizontally flipped. |
67 void SetDrawImageMirrored(bool mirrored) { | 67 void SetDrawImageMirrored(bool mirrored) { |
68 draw_image_mirrored_ = mirrored; | 68 draw_image_mirrored_ = mirrored; |
69 } | 69 } |
70 | 70 |
71 // Overridden from View: | 71 // Overridden from View: |
72 virtual gfx::Size GetPreferredSize() OVERRIDE; | 72 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
73 virtual const char* GetClassName() const OVERRIDE; | 73 virtual const char* GetClassName() const OVERRIDE; |
74 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 74 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
75 | 75 |
76 protected: | 76 protected: |
77 // Overridden from View: | 77 // Overridden from View: |
78 virtual void OnFocus() OVERRIDE; | 78 virtual void OnFocus() OVERRIDE; |
79 virtual void OnBlur() OVERRIDE; | 79 virtual void OnBlur() OVERRIDE; |
80 | 80 |
81 // Returns the image to paint. This is invoked from paint and returns a value | 81 // Returns the image to paint. This is invoked from paint and returns a value |
82 // from images. | 82 // from images. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // The parent class's tooltip_text_ is displayed when not toggled, and | 162 // The parent class's tooltip_text_ is displayed when not toggled, and |
163 // this one is shown when toggled. | 163 // this one is shown when toggled. |
164 base::string16 toggled_tooltip_text_; | 164 base::string16 toggled_tooltip_text_; |
165 | 165 |
166 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); | 166 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); |
167 }; | 167 }; |
168 | 168 |
169 } // namespace views | 169 } // namespace views |
170 | 170 |
171 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 171 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
OLD | NEW |