From 6260f9e685ffa86d44750e61e1695bc57e9e122d Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Wed, 16 Feb 2011 21:28:01 +0000 Subject: Remove "visible bounds in root changed" functions from RootView, move them to View. Clean up the API a little. Adds a BoundsChanged() processing function to View that does default processing for bounds-changed events, including notifying the view via OnBoundsChanged() and potentially notifying of visible bounds changing. Adds a unit test for OnVisibleBoundsChanged. http://crbug.com/72040 TEST=unit test Review URL: http://codereview.chromium.org/6534001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75182 0039d316-1c4b-4281-b951-d872f2087c98 --- views/controls/native/native_view_host.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'views/controls/native/native_view_host.cc') diff --git a/views/controls/native/native_view_host.cc b/views/controls/native/native_view_host.cc index 81f1f2f..4566b80 100644 --- a/views/controls/native/native_view_host.cc +++ b/views/controls/native/native_view_host.cc @@ -33,10 +33,6 @@ NativeViewHost::NativeViewHost() views_view_(NULL), fast_resize_(false), focus_view_(NULL) { - // The native widget is placed relative to the root. As such, we need to - // know when the position of any ancestor changes, or our visibility relative - // to other views changed as it'll effect our position relative to the root. - SetNotifyWhenVisibleBoundsInRootChanges(true); } NativeViewHost::~NativeViewHost() { @@ -156,7 +152,14 @@ void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { Layout(); } -void NativeViewHost::VisibleBoundsInRootChanged() { +bool NativeViewHost::NeedsNotificationWhenVisibleBoundsChange() const { + // The native widget is placed relative to the root. As such, we need to + // know when the position of any ancestor changes, or our visibility relative + // to other views changed as it'll effect our position relative to the root. + return true; +} + +void NativeViewHost::OnVisibleBoundsChanged() { Layout(); } -- cgit v1.1