| 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_CHECKBOX_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 gfx::ImageSkia GetImage(ButtonState for_state) const override; | 53 gfx::ImageSkia GetImage(ButtonState for_state) const override; |
| 54 | 54 |
| 55 // Set the image shown for each button state depending on whether it is | 55 // Set the image shown for each button state depending on whether it is |
| 56 // [checked] or [focused]. | 56 // [checked] or [focused]. |
| 57 void SetCustomImage(bool checked, | 57 void SetCustomImage(bool checked, |
| 58 bool focused, | 58 bool focused, |
| 59 ButtonState for_state, | 59 ButtonState for_state, |
| 60 const gfx::ImageSkia& image); | 60 const gfx::ImageSkia& image); |
| 61 | 61 |
| 62 // Paints a focus indicator for the view. | 62 // Paints a focus indicator for the view. |
| 63 virtual void PaintFocusRing(gfx::Canvas* canvas, const cc::PaintFlags& paint); | 63 virtual void PaintFocusRing(gfx::Canvas* canvas, const cc::PaintFlags& flags); |
| 64 | 64 |
| 65 // Gets the vector icon to use based on the current state of |checked_|. | 65 // Gets the vector icon to use based on the current state of |checked_|. |
| 66 virtual const gfx::VectorIcon& GetVectorIcon() const; | 66 virtual const gfx::VectorIcon& GetVectorIcon() const; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 // Overridden from Button: | 69 // Overridden from Button: |
| 70 void NotifyClick(const ui::Event& event) override; | 70 void NotifyClick(const ui::Event& event) override; |
| 71 | 71 |
| 72 ui::NativeTheme::Part GetThemePart() const override; | 72 ui::NativeTheme::Part GetThemePart() const override; |
| 73 void GetExtraParams(ui::NativeTheme::ExtraParams* params) const override; | 73 void GetExtraParams(ui::NativeTheme::ExtraParams* params) const override; |
| 74 | 74 |
| 75 // True if the checkbox is checked. | 75 // True if the checkbox is checked. |
| 76 bool checked_; | 76 bool checked_; |
| 77 | 77 |
| 78 // The images for each button node_data. | 78 // The images for each button node_data. |
| 79 gfx::ImageSkia images_[2][2][STATE_COUNT]; | 79 gfx::ImageSkia images_[2][2][STATE_COUNT]; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(Checkbox); | 81 DISALLOW_COPY_AND_ASSIGN(Checkbox); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace views | 84 } // namespace views |
| 85 | 85 |
| 86 #endif // UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ | 86 #endif // UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ |
| OLD | NEW |