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

Side by Side Diff: ui/views/view.cc

Issue 1442683002: Fix views::View::BoundsChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 2 Created 5 years, 1 month 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 | « no previous file | ui/views/view_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 } 1880 }
1881 } 1881 }
1882 } else { 1882 } else {
1883 // If our bounds have changed, then any descendant layer bounds may have 1883 // If our bounds have changed, then any descendant layer bounds may have
1884 // changed. Update them accordingly. 1884 // changed. Update them accordingly.
1885 UpdateChildLayerBounds(CalculateOffsetToAncestorWithLayer(NULL)); 1885 UpdateChildLayerBounds(CalculateOffsetToAncestorWithLayer(NULL));
1886 } 1886 }
1887 1887
1888 OnBoundsChanged(previous_bounds); 1888 OnBoundsChanged(previous_bounds);
1889 1889
1890 if (previous_bounds.size() != size()) { 1890 if (needs_layout_ || previous_bounds.size() != size()) {
1891 needs_layout_ = false; 1891 needs_layout_ = false;
1892 Layout(); 1892 Layout();
1893 } 1893 }
1894 1894
1895 if (GetNeedsNotificationWhenVisibleBoundsChange()) 1895 if (GetNeedsNotificationWhenVisibleBoundsChange())
1896 OnVisibleBoundsChanged(); 1896 OnVisibleBoundsChanged();
1897 1897
1898 // Notify interested Views that visible bounds within the root view may have 1898 // Notify interested Views that visible bounds within the root view may have
1899 // changed. 1899 // changed.
1900 if (descendants_to_notify_.get()) { 1900 if (descendants_to_notify_.get()) {
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 // Message the RootView to do the drag and drop. That way if we're removed 2354 // Message the RootView to do the drag and drop. That way if we're removed
2355 // the RootView can detect it and avoid calling us back. 2355 // the RootView can detect it and avoid calling us back.
2356 gfx::Point widget_location(event.location()); 2356 gfx::Point widget_location(event.location());
2357 ConvertPointToWidget(this, &widget_location); 2357 ConvertPointToWidget(this, &widget_location);
2358 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2358 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2359 // WARNING: we may have been deleted. 2359 // WARNING: we may have been deleted.
2360 return true; 2360 return true;
2361 } 2361 }
2362 2362
2363 } // namespace views 2363 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698