OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
6 #define VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "views/controls/button/custom_button.h" | 10 #include "views/controls/button/custom_button.h" |
11 | 11 |
(...skipping 24 matching lines...) Expand all Loading... |
36 | 36 |
37 enum VerticalAlignment { ALIGN_TOP = 0, | 37 enum VerticalAlignment { ALIGN_TOP = 0, |
38 ALIGN_MIDDLE, | 38 ALIGN_MIDDLE, |
39 ALIGN_BOTTOM }; | 39 ALIGN_BOTTOM }; |
40 | 40 |
41 // Sets how the image is laid out within the button's bounds. | 41 // Sets how the image is laid out within the button's bounds. |
42 void SetImageAlignment(HorizontalAlignment h_align, | 42 void SetImageAlignment(HorizontalAlignment h_align, |
43 VerticalAlignment v_align); | 43 VerticalAlignment v_align); |
44 | 44 |
45 // Overridden from View: | 45 // Overridden from View: |
46 virtual gfx::Size GetPreferredSize(); | 46 virtual gfx::Size GetPreferredSize() OVERRIDE; |
47 virtual void OnPaint(gfx::Canvas* canvas); | 47 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
48 | 48 |
49 // Sets preferred size, so it could be correctly positioned in layout even if | 49 // Sets preferred size, so it could be correctly positioned in layout even if |
50 // it is NULL. | 50 // it is NULL. |
51 void SetPreferredSize(const gfx::Size& preferred_size) { | 51 void SetPreferredSize(const gfx::Size& preferred_size) { |
52 preferred_size_ = preferred_size; | 52 preferred_size_ = preferred_size; |
53 } | 53 } |
54 | 54 |
55 protected: | 55 protected: |
56 // Returns the image to paint. This is invoked from paint and returns a value | 56 // Returns the image to paint. This is invoked from paint and returns a value |
57 // from images. | 57 // from images. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // The parent class's tooltip_text_ is displayed when not toggled, and | 113 // The parent class's tooltip_text_ is displayed when not toggled, and |
114 // this one is shown when toggled. | 114 // this one is shown when toggled. |
115 string16 toggled_tooltip_text_; | 115 string16 toggled_tooltip_text_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); | 117 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); |
118 }; | 118 }; |
119 | 119 |
120 } // namespace views | 120 } // namespace views |
121 | 121 |
122 #endif // VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 122 #endif // VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
OLD | NEW |