From 877360ea4b4863c70100283d521f408829738d88 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Tue, 12 Nov 2013 07:23:26 +0000 Subject: Revert 234428 "Make RootWindow not subclass Window." > Make RootWindow not subclass Window. > > Removes the #include of window.h from root_window.h too, which makes this CL a little longer bandaiding all those places. > The interesting parts of this change are in root_window.* and window.* > > R=sky@chromium.org > http://crbug.com/308843 > > Review URL: https://codereview.chromium.org/68313003 TBR=ben@chromium.org Review URL: https://codereview.chromium.org/70043002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234449 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/aura/root_window.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'ui/aura/root_window.h') diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h index f6a966b..1b81d58 100644 --- a/ui/aura/root_window.h +++ b/ui/aura/root_window.h @@ -16,6 +16,7 @@ #include "ui/aura/aura_export.h" #include "ui/aura/client/capture_delegate.h" #include "ui/aura/root_window_host_delegate.h" +#include "ui/aura/window.h" #include "ui/base/cursor/cursor.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer_animation_observer.h" @@ -51,7 +52,8 @@ class RootWindowTransformer; class TestScreen; // RootWindow is responsible for hosting a set of windows. -class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, +class AURA_EXPORT RootWindow : public Window, + public ui::EventDispatcherDelegate, public ui::GestureEventHelper, public ui::LayerAnimationObserver, public aura::client::CaptureDelegate, @@ -79,7 +81,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, Window* window() { return const_cast(const_cast(this)->window()); } - const Window* window() const { return window_.get(); } + const Window* window() const { return this; } ui::Compositor* compositor() { return compositor_.get(); } gfx::NativeCursor last_cursor() const { return last_cursor_; } Window* mouse_pressed_handler() { return mouse_pressed_handler_; } @@ -127,7 +129,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, void OnMouseEventsEnableStateChanged(bool enabled); // Moves the cursor to the specified location relative to the root window. - void MoveCursorTo(const gfx::Point& location); + virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; // Moves the cursor to the |host_location| given in host coordinates. void MoveCursorToHostLocation(const gfx::Point& host_location); @@ -242,9 +244,12 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, void SetRootWindowTransformer(scoped_ptr transformer); gfx::Transform GetRootTransform() const; - void SetTransform(const gfx::Transform& transform); - - void DeviceScaleFactorChanged(float device_scale_factor); + // Overridden from Window: + virtual Window* GetRootWindow() OVERRIDE; + virtual const Window* GetRootWindow() const OVERRIDE; + virtual void SetTransform(const gfx::Transform& transform) OVERRIDE; + virtual bool CanFocus() const OVERRIDE; + virtual bool CanReceiveEvents() const OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(RootWindowTest, KeepTranslatedEventInRoot); @@ -299,6 +304,12 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, // transform and insets. void UpdateRootWindowSize(const gfx::Size& host_size); + // Overridden from ui::EventTarget: + virtual ui::EventTarget* GetParentTarget() OVERRIDE; + + // Overridden from ui::LayerDelegate: + virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; + // Overridden from aura::client::CaptureDelegate: virtual void UpdateCapture(Window* old_capture, Window* new_capture) OVERRIDE; virtual void OnOtherRootGotCapture() OVERRIDE; @@ -306,7 +317,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, virtual void ReleaseNativeCapture() OVERRIDE; // Overridden from ui::EventDispatcherDelegate. - virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; + virtual bool CanDispatchToTarget(EventTarget* target) OVERRIDE; // Overridden from ui::GestureEventHelper. virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; @@ -369,9 +380,6 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, gfx::Transform GetInverseRootTransform() const; - // TODO(beng): evaluate the ideal ownership model. - scoped_ptr window_; - scoped_ptr compositor_; scoped_ptr host_; -- cgit v1.1