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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: tests Created 3 years, 9 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_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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 gfx::ImageSkia images_[STATE_COUNT]; 96 gfx::ImageSkia images_[STATE_COUNT];
97 97
98 gfx::ImageSkia background_image_; 98 gfx::ImageSkia background_image_;
99 99
100 private: 100 private:
101 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, Basics); 101 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, Basics);
102 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, ImagePositionWithBorder); 102 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, ImagePositionWithBorder);
103 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, LeftAlignedMirrored); 103 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, LeftAlignedMirrored);
104 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, RightAlignedMirrored); 104 FRIEND_TEST_ALL_PREFIXES(ImageButtonTest, RightAlignedMirrored);
105 105
106 FRIEND_TEST_ALL_PREFIXES(ImageButtonUtilTest,
107 CreateImageButtonWithVectorIconStyling);
108
106 // Returns the correct position of the image for painting. 109 // Returns the correct position of the image for painting.
107 gfx::Point ComputeImagePaintPosition(const gfx::ImageSkia& image); 110 gfx::Point ComputeImagePaintPosition(const gfx::ImageSkia& image);
108 111
109 // Image alignment. 112 // Image alignment.
110 HorizontalAlignment h_alignment_; 113 HorizontalAlignment h_alignment_;
111 VerticalAlignment v_alignment_; 114 VerticalAlignment v_alignment_;
112 gfx::Size minimum_image_size_; 115 gfx::Size minimum_image_size_;
113 116
114 // Whether we draw our resources horizontally flipped. This can happen in the 117 // Whether we draw our resources horizontally flipped. This can happen in the
115 // linux titlebar, where image resources were designed to be flipped so a 118 // linux titlebar, where image resources were designed to be flipped so a
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // The parent class's tooltip_text_ is displayed when not toggled, and 169 // The parent class's tooltip_text_ is displayed when not toggled, and
167 // this one is shown when toggled. 170 // this one is shown when toggled.
168 base::string16 toggled_tooltip_text_; 171 base::string16 toggled_tooltip_text_;
169 172
170 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); 173 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton);
171 }; 174 };
172 175
173 } // namespace views 176 } // namespace views
174 177
175 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 178 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698