Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 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 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 #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 "ui/views/controls/button/custom_button.h" | 10 #include "ui/views/controls/button/custom_button.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 // An image button. | 14 // An image button. |
| 15 | 15 |
| 16 // Note that this type of button is not focusable by default and will not be | 16 // Note that this type of button is not focusable by default and will not be |
| 17 // part of the focus chain. Call set_focusable(true) to make it part of the | 17 // part of the focus chain. Call set_focusable(true) to make it part of the |
| 18 // focus chain. | 18 // focus chain. |
| 19 | 19 |
| 20 class VIEWS_EXPORT ImageButton : public CustomButton { | 20 class VIEWS_EXPORT ImageButton : public CustomButton { |
| 21 public: | 21 public: |
| 22 explicit ImageButton(ButtonListener* listener); | 22 explicit ImageButton(ButtonListener* listener); |
| 23 virtual ~ImageButton(); | 23 virtual ~ImageButton(); |
| 24 | 24 |
| 25 // Set the image the button should use for the provided state. | 25 // Set the image the button should use for the provided state. |
| 26 virtual void SetImage(ButtonState aState, const SkBitmap* anImage); | 26 virtual void SetImage(ButtonState state, const SkBitmap* anImage); |
|
tfarina
2012/03/14 16:36:03
nit: anImage -> bitmap or image?
| |
| 27 | 27 |
| 28 // Set the background details. | 28 // Set the background details. |
| 29 void SetBackground(SkColor color, | 29 void SetBackground(SkColor color, |
| 30 const SkBitmap* image, | 30 const SkBitmap* image, |
| 31 const SkBitmap* mask); | 31 const SkBitmap* mask); |
| 32 | 32 |
| 33 enum HorizontalAlignment { ALIGN_LEFT = 0, | 33 enum HorizontalAlignment { ALIGN_LEFT = 0, |
| 34 ALIGN_CENTER, | 34 ALIGN_CENTER, |
| 35 ALIGN_RIGHT, }; | 35 ALIGN_RIGHT, }; |
| 36 | 36 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 // The parent class's tooltip_text_ is displayed when not toggled, and | 114 // The parent class's tooltip_text_ is displayed when not toggled, and |
| 115 // this one is shown when toggled. | 115 // this one is shown when toggled. |
| 116 string16 toggled_tooltip_text_; | 116 string16 toggled_tooltip_text_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); | 118 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace views | 121 } // namespace views |
| 122 | 122 |
| 123 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 123 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
| OLD | NEW |