| 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_LABEL_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 // NativeThemeDelegate: | 140 // NativeThemeDelegate: |
| 141 gfx::Rect GetThemePaintRect() const override; | 141 gfx::Rect GetThemePaintRect() const override; |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Init); | 144 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Init); |
| 145 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Label); | 145 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Label); |
| 146 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Image); | 146 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Image); |
| 147 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, LabelAndImage); | 147 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, LabelAndImage); |
| 148 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, FontList); | 148 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, FontList); |
| 149 FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, ButtonStyleIsDefaultSize); | |
| 150 | 149 |
| 151 void SetTextInternal(const base::string16& text); | 150 void SetTextInternal(const base::string16& text); |
| 152 | 151 |
| 153 // View: | 152 // View: |
| 154 void ChildPreferredSizeChanged(View* child) override; | 153 void ChildPreferredSizeChanged(View* child) override; |
| 155 | 154 |
| 156 // NativeThemeDelegate: | 155 // NativeThemeDelegate: |
| 157 ui::NativeTheme::Part GetThemePart() const override; | 156 ui::NativeTheme::Part GetThemePart() const override; |
| 158 ui::NativeTheme::State GetThemeState( | 157 ui::NativeTheme::State GetThemeState( |
| 159 ui::NativeTheme::ExtraParams* params) const override; | 158 ui::NativeTheme::ExtraParams* params) const override; |
| 160 const gfx::Animation* GetThemeAnimation() const override; | 159 const gfx::Animation* GetThemeAnimation() const override; |
| 161 ui::NativeTheme::State GetBackgroundThemeState( | 160 ui::NativeTheme::State GetBackgroundThemeState( |
| 162 ui::NativeTheme::ExtraParams* params) const override; | 161 ui::NativeTheme::ExtraParams* params) const override; |
| 163 ui::NativeTheme::State GetForegroundThemeState( | 162 ui::NativeTheme::State GetForegroundThemeState( |
| 164 ui::NativeTheme::ExtraParams* params) const override; | 163 ui::NativeTheme::ExtraParams* params) const override; |
| 165 | 164 |
| 166 // Resets |cached_preferred_size_| and marks |cached_preferred_size_valid_| | 165 // Resets |cached_preferred_size_| and marks |cached_preferred_size_valid_| |
| 167 // as false. | 166 // as false. |
| 168 void ResetCachedPreferredSize(); | 167 void ResetCachedPreferredSize(); |
| 169 | 168 |
| 169 // Updates additional state related to focus or default status, rather than |
| 170 // merely the CustomButton::state(). E.g. ensures the label text color is |
| 171 // correct for the current background. |
| 172 void ResetLabelEnabledColor(); |
| 173 |
| 170 // The image and label shown in the button. | 174 // The image and label shown in the button. |
| 171 ImageView* image_; | 175 ImageView* image_; |
| 172 Label* label_; | 176 Label* label_; |
| 173 | 177 |
| 174 // A separate view is necessary to hold the ink drop layer so that it can | 178 // A separate view is necessary to hold the ink drop layer so that it can |
| 175 // be stacked below |image_| and on top of |label_|, without resorting to | 179 // be stacked below |image_| and on top of |label_|, without resorting to |
| 176 // drawing |label_| on a layer (which can mess with subpixel anti-aliasing). | 180 // drawing |label_| on a layer (which can mess with subpixel anti-aliasing). |
| 177 View* ink_drop_container_; | 181 View* ink_drop_container_; |
| 178 | 182 |
| 179 // The cached font lists in the normal and bold style. | 183 // The cached font lists in the normal and bold style. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 gfx::HorizontalAlignment horizontal_alignment_; | 221 gfx::HorizontalAlignment horizontal_alignment_; |
| 218 | 222 |
| 219 scoped_ptr<Painter> focus_painter_; | 223 scoped_ptr<Painter> focus_painter_; |
| 220 | 224 |
| 221 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 225 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
| 222 }; | 226 }; |
| 223 | 227 |
| 224 } // namespace views | 228 } // namespace views |
| 225 | 229 |
| 226 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 230 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| OLD | NEW |