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