summaryrefslogtreecommitdiffstats
path: root/ui/views/window
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-19 21:44:55 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-19 21:44:55 +0000
commita76a751357938750265432e06e24de8f559b764f (patch)
treea865a4815d30fee42273b2110fc36d7e50b5db5d /ui/views/window
parent697d8699b2c3435bd45254bc7b9dd035b715e129 (diff)
downloadchromium_src-a76a751357938750265432e06e24de8f559b764f.zip
chromium_src-a76a751357938750265432e06e24de8f559b764f.tar.gz
chromium_src-a76a751357938750265432e06e24de8f559b764f.tar.bz2
views: Simplify CustomFrameView::GetPreferredSize() implementation.
This patch uses the fact the gfx::Rect has a ctor that takes a gfx::Size, so taking this advantage we can write less to implement GetPreferredSize. R=pkasting@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9721015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/window')
-rw-r--r--ui/views/window/custom_frame_view.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc
index 1825c66..901bd42 100644
--- a/ui/views/window/custom_frame_view.cc
+++ b/ui/views/window/custom_frame_view.cc
@@ -232,10 +232,8 @@ void CustomFrameView::Layout() {
}
gfx::Size CustomFrameView::GetPreferredSize() {
- gfx::Size pref = frame_->client_view()->GetPreferredSize();
- gfx::Rect bounds(0, 0, pref.width(), pref.height());
return frame_->non_client_view()->GetWindowBoundsForClientBounds(
- bounds).size();
+ gfx::Rect(frame_->client_view()->GetPreferredSize())).size();
}
///////////////////////////////////////////////////////////////////////////////