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

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

Issue 2889623002: Apply View::set_preferred_size in some more places. (Closed)
Patch Set: fix SystemMenuButton Created 3 years, 7 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // larger. 67 // larger.
68 const gfx::Size& minimum_image_size() const { return minimum_image_size_; } 68 const gfx::Size& minimum_image_size() const { return minimum_image_size_; }
69 void SetMinimumImageSize(const gfx::Size& size); 69 void SetMinimumImageSize(const gfx::Size& size);
70 70
71 // Whether we should draw our images resources horizontally flipped. 71 // Whether we should draw our images resources horizontally flipped.
72 void SetDrawImageMirrored(bool mirrored) { 72 void SetDrawImageMirrored(bool mirrored) {
73 draw_image_mirrored_ = mirrored; 73 draw_image_mirrored_ = mirrored;
74 } 74 }
75 75
76 // Overridden from View: 76 // Overridden from View:
77 gfx::Size GetPreferredSize() const override;
78 const char* GetClassName() const override; 77 const char* GetClassName() const override;
79 void OnPaint(gfx::Canvas* canvas) override; 78 void OnPaint(gfx::Canvas* canvas) override;
79 gfx::Size CalculatePreferredSize() const override;
80 80
81 protected: 81 protected:
82 // Overridden from View: 82 // Overridden from View:
83 void OnFocus() override; 83 void OnFocus() override;
84 void OnBlur() override; 84 void OnBlur() override;
85 85
86 // Returns the image to paint. This is invoked from paint and returns a value 86 // Returns the image to paint. This is invoked from paint and returns a value
87 // from images. 87 // from images.
88 virtual gfx::ImageSkia GetImageToPaint(); 88 virtual gfx::ImageSkia GetImageToPaint();
89 89
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // The parent class's tooltip_text_ is displayed when not toggled, and 168 // The parent class's tooltip_text_ is displayed when not toggled, and
169 // this one is shown when toggled. 169 // this one is shown when toggled.
170 base::string16 toggled_tooltip_text_; 170 base::string16 toggled_tooltip_text_;
171 171
172 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); 172 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton);
173 }; 173 };
174 174
175 } // namespace views 175 } // namespace views
176 176
177 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 177 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/custom_notification_view_unittest.cc ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698