summaryrefslogtreecommitdiffstats
path: root/views/controls/native/native_view_host.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 21:28:01 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 21:28:01 +0000
commit6260f9e685ffa86d44750e61e1695bc57e9e122d (patch)
tree78250b5e4a4c2f66c64701d5edbe222e36845f05 /views/controls/native/native_view_host.cc
parentd73d5f66e9c1d054e58b3966e9eaab7ab0020999 (diff)
downloadchromium_src-6260f9e685ffa86d44750e61e1695bc57e9e122d.zip
chromium_src-6260f9e685ffa86d44750e61e1695bc57e9e122d.tar.gz
chromium_src-6260f9e685ffa86d44750e61e1695bc57e9e122d.tar.bz2
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
Diffstat (limited to 'views/controls/native/native_view_host.cc')
-rw-r--r--views/controls/native/native_view_host.cc13
1 files changed, 8 insertions, 5 deletions
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();
}