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

Unified Diff: ui/views/view.cc

Issue 2881183003: Add views::View::set_preferred_size, use it in a few places. (Closed)
Patch Set: auto* 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 | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index b39da4994275cb5067ff16a1f2cfbb886fcac57f..59f4d3bb3c0bda2155b01b391accb5d3d770c6de 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -422,9 +422,11 @@ gfx::Rect View::GetBoundsInScreen() const {
}
gfx::Size View::GetPreferredSize() const {
+ if (preferred_size_)
+ return *preferred_size_;
if (layout_manager_.get())
return layout_manager_->GetPreferredSize(this);
- return gfx::Size();
+ return CalculatePreferredSize();
}
int View::GetBaseline() const {
@@ -1477,6 +1479,10 @@ bool View::HasObserver(const ViewObserver* observer) const {
// Size and disposition --------------------------------------------------------
+gfx::Size View::CalculatePreferredSize() const {
+ return gfx::Size();
+}
+
void View::OnBoundsChanged(const gfx::Rect& previous_bounds) {
}
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698