diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-12 07:23:26 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-12 07:23:26 +0000 |
commit | 877360ea4b4863c70100283d521f408829738d88 (patch) | |
tree | 885d993c6a298dbabc899cca08269b10f3ffb279 /ui/aura/root_window.h | |
parent | e43cc327407f7a2f05d9d9a03f9366b02b5e8da4 (diff) | |
download | chromium_src-877360ea4b4863c70100283d521f408829738d88.zip chromium_src-877360ea4b4863c70100283d521f408829738d88.tar.gz chromium_src-877360ea4b4863c70100283d521f408829738d88.tar.bz2 |
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
Diffstat (limited to 'ui/aura/root_window.h')
-rw-r--r-- | ui/aura/root_window.h | 28 |
1 files changed, 18 insertions, 10 deletions
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<Window*>(const_cast<const RootWindow*>(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<RootWindowTransformer> 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> window_; - scoped_ptr<ui::Compositor> compositor_; scoped_ptr<RootWindowHost> host_; |