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

Unified Diff: ash/system/user/user_card_view.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/user/rounded_image_view.cc ('k') | ash/system/web_notification/web_notification_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/user_card_view.cc
diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc
index 7460337662cfee343c67733b63b7fa1015e2685a..d507667d5662258cae7f1fa174373a010d0e2706 100644
--- a/ash/system/user/user_card_view.cc
+++ b/ash/system/user/user_card_view.cc
@@ -87,7 +87,6 @@ class PublicAccountUserDetails : public views::View,
private:
// Overridden from views::View.
void Layout() override;
- gfx::Size GetPreferredSize() const override;
void OnPaint(gfx::Canvas* canvas) override;
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
@@ -101,7 +100,6 @@ class PublicAccountUserDetails : public views::View,
base::string16 text_;
views::Link* learn_more_;
- gfx::Size preferred_size_;
std::vector<std::unique_ptr<gfx::RenderText>> lines_;
DISALLOW_COPY_AND_ASSIGN(PublicAccountUserDetails);
@@ -208,10 +206,6 @@ void PublicAccountUserDetails::Layout() {
learn_more_->SetBoundsRect(learn_more_bounds);
}
-gfx::Size PublicAccountUserDetails::GetPreferredSize() const {
- return preferred_size_;
-}
-
void PublicAccountUserDetails::OnPaint(gfx::Canvas* canvas) {
for (const auto& line : lines_)
line->Draw(canvas);
@@ -276,9 +270,9 @@ void PublicAccountUserDetails::DeterminePreferredSize() {
const int line_height = font_list.GetHeight();
const int link_extra_height = std::max(
link_size.height() - learn_more_->GetInsets().top() - line_height, 0);
- preferred_size_ =
- gfx::Size(min_width + insets.width(),
- line_count * line_height + link_extra_height + insets.height());
+ set_preferred_size(gfx::Size(
+ min_width + insets.width(),
+ line_count * line_height + link_extra_height + insets.height()));
}
} // namespace
« no previous file with comments | « ash/system/user/rounded_image_view.cc ('k') | ash/system/web_notification/web_notification_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698