Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ui/views/controls/button/label_button.h

Issue 1569113002: MacViews: Style BUTTON_STYLE buttons using the "modern" UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix desktop linux weirdness Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.
170 void HighlightStateChanged();
Elly Fong-Jones 2016/04/05 16:43:25 This function's comment is a little bit vague. It
tapted 2016/04/06 12:08:33 Done.
171
170 // The image and label shown in the button. 172 // The image and label shown in the button.
171 ImageView* image_; 173 ImageView* image_;
172 Label* label_; 174 Label* label_;
173 175
174 // A separate view is necessary to hold the ink drop layer so that it can 176 // 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 177 // 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). 178 // drawing |label_| on a layer (which can mess with subpixel anti-aliasing).
177 View* ink_drop_container_; 179 View* ink_drop_container_;
178 180
179 // The cached font lists in the normal and bold style. 181 // The cached font lists in the normal and bold style.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 gfx::HorizontalAlignment horizontal_alignment_; 219 gfx::HorizontalAlignment horizontal_alignment_;
218 220
219 scoped_ptr<Painter> focus_painter_; 221 scoped_ptr<Painter> focus_painter_;
220 222
221 DISALLOW_COPY_AND_ASSIGN(LabelButton); 223 DISALLOW_COPY_AND_ASSIGN(LabelButton);
222 }; 224 };
223 225
224 } // namespace views 226 } // namespace views
225 227
226 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ 228 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698