diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 19:36:43 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 19:36:43 +0000 |
commit | b97c8a2239a8e8ee4ae134d9ea95213067ead3c9 (patch) | |
tree | 873a6c481ceedecc51ed5e4c184b0f48c4a22478 /views | |
parent | 1e309750fd24465e386687947b577c8f807fad3d (diff) | |
download | chromium_src-b97c8a2239a8e8ee4ae134d9ea95213067ead3c9.zip chromium_src-b97c8a2239a8e8ee4ae134d9ea95213067ead3c9.tar.gz chromium_src-b97c8a2239a8e8ee4ae134d9ea95213067ead3c9.tar.bz2 |
Don't call View::DidChangeBounds() when the bounds didn't change
Bug: None
Test: Views based UI should still layout correctly
Review URL: http://codereview.chromium.org/574013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/view.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/views/view.cc b/views/view.cc index b8db44c..53f1102 100644 --- a/views/view.cc +++ b/views/view.cc @@ -120,13 +120,14 @@ void View::SetBounds(const gfx::Rect& bounds) { gfx::Rect prev = bounds_; bounds_ = bounds; - DidChangeBounds(prev, bounds_); + bool size_changed = prev.size() != bounds_.size(); + bool position_changed = prev.origin() != bounds_.origin(); - RootView* root = GetRootView(); - if (root) { - bool size_changed = prev.size() != bounds_.size(); - bool position_changed = prev.origin() != bounds_.origin(); - if (size_changed || position_changed) + if (size_changed || position_changed) { + DidChangeBounds(prev, bounds_); + + RootView* root = GetRootView(); + if (root) root->ViewBoundsChanged(this, size_changed, position_changed); } } |