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

Side by Side Diff: ash/system/user/rounded_image_view.h

Issue 2901503003: Rename GetPreferredSize to CalculatePreferredSize in ash/ (Closed)
Patch Set: improvements 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
« no previous file with comments | « ash/system/tray/tray_popup_header_button.cc ('k') | ash/system/user/rounded_image_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ASH_SYSTEM_USER_ROUNDED_IMAGE_VIEW_H_ 5 #ifndef ASH_SYSTEM_USER_ROUNDED_IMAGE_VIEW_H_
6 #define ASH_SYSTEM_USER_ROUNDED_IMAGE_VIEW_H_ 6 #define ASH_SYSTEM_USER_ROUNDED_IMAGE_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/gfx/geometry/size.h" 9 #include "ui/gfx/geometry/size.h"
10 #include "ui/gfx/image/image_skia.h" 10 #include "ui/gfx/image/image_skia.h"
(...skipping 14 matching lines...) Expand all
25 // receiver's image. 25 // receiver's image.
26 void SetImage(const gfx::ImageSkia& image, const gfx::Size& size); 26 void SetImage(const gfx::ImageSkia& image, const gfx::Size& size);
27 27
28 // Set the radii of the corners independently. 28 // Set the radii of the corners independently.
29 void SetCornerRadii(int top_left, 29 void SetCornerRadii(int top_left,
30 int top_right, 30 int top_right,
31 int bottom_right, 31 int bottom_right,
32 int bottom_left); 32 int bottom_left);
33 33
34 // Overridden from views::View. 34 // Overridden from views::View.
35 gfx::Size GetPreferredSize() const override; 35 gfx::Size CalculatePreferredSize() const override;
36 void OnPaint(gfx::Canvas* canvas) override; 36 void OnPaint(gfx::Canvas* canvas) override;
37 37
38 // Gets the image painted by RoundedImageView for test. 38 // Gets the image painted by RoundedImageView for test.
39 const gfx::ImageSkia& image_for_test() const { return resized_image_; } 39 const gfx::ImageSkia& image_for_test() const { return resized_image_; }
40 40
41 private: 41 private:
42 gfx::ImageSkia resized_image_; 42 gfx::ImageSkia resized_image_;
43 gfx::Size image_size_; 43 gfx::Size image_size_;
44 int corner_radius_[4]; 44 int corner_radius_[4];
45 45
46 DISALLOW_COPY_AND_ASSIGN(RoundedImageView); 46 DISALLOW_COPY_AND_ASSIGN(RoundedImageView);
47 }; 47 };
48 48
49 } // namespace tray 49 } // namespace tray
50 } // namespace ash 50 } // namespace ash
51 51
52 #endif // ASH_SYSTEM_USER_ROUNDED_IMAGE_VIEW_H_ 52 #endif // ASH_SYSTEM_USER_ROUNDED_IMAGE_VIEW_H_
OLDNEW
« no previous file with comments | « ash/system/tray/tray_popup_header_button.cc ('k') | ash/system/user/rounded_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698