| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Set the tooltip text displayed when the button is toggled. | 140 // Set the tooltip text displayed when the button is toggled. |
| 141 void SetToggledTooltipText(const base::string16& tooltip); | 141 void SetToggledTooltipText(const base::string16& tooltip); |
| 142 | 142 |
| 143 // Overridden from ImageButton: | 143 // Overridden from ImageButton: |
| 144 const gfx::ImageSkia& GetImage(ButtonState state) const override; | 144 const gfx::ImageSkia& GetImage(ButtonState state) const override; |
| 145 void SetImage(ButtonState state, const gfx::ImageSkia* image) override; | 145 void SetImage(ButtonState state, const gfx::ImageSkia* image) override; |
| 146 | 146 |
| 147 // Overridden from View: | 147 // Overridden from View: |
| 148 bool GetTooltipText(const gfx::Point& p, | 148 bool GetTooltipText(const gfx::Point& p, |
| 149 base::string16* tooltip) const override; | 149 base::string16* tooltip) const override; |
| 150 void GetAccessibleState(ui::AXViewState* state) override; | 150 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 // The parent class's images_ member is used for the current images, | 153 // The parent class's images_ member is used for the current images, |
| 154 // and this array is used to hold the alternative images. | 154 // and this array is used to hold the alternative images. |
| 155 // We swap between the two when toggling. | 155 // We swap between the two when toggling. |
| 156 gfx::ImageSkia alternate_images_[STATE_COUNT]; | 156 gfx::ImageSkia alternate_images_[STATE_COUNT]; |
| 157 | 157 |
| 158 // True if the button is currently toggled. | 158 // True if the button is currently toggled. |
| 159 bool toggled_; | 159 bool toggled_; |
| 160 | 160 |
| 161 // The parent class's tooltip_text_ is displayed when not toggled, and | 161 // The parent class's tooltip_text_ is displayed when not toggled, and |
| 162 // this one is shown when toggled. | 162 // this one is shown when toggled. |
| 163 base::string16 toggled_tooltip_text_; | 163 base::string16 toggled_tooltip_text_; |
| 164 | 164 |
| 165 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); | 165 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace views | 168 } // namespace views |
| 169 | 169 |
| 170 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ | 170 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ |
| OLD | NEW |