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/app_list/views/apps_grid_view.cc | 1 - ui/aura/client/default_capture_client.cc | 5 +- ui/aura/gestures/gesture_recognizer_unittest.cc | 1 - ui/aura/root_window.cc | 67 +++++++++++++++++++--- ui/aura/root_window.h | 28 +++++---- ui/aura/root_window_host_x11.cc | 15 +++-- ui/aura/root_window_unittest.cc | 5 +- ui/aura/test/aura_test_base.cc | 1 - ui/aura/test/ui_controls_factory_aurawin.cc | 1 - ui/aura/test/ui_controls_factory_aurax11.cc | 11 ++-- ui/aura/window.cc | 58 +------------------ ui/aura/window.h | 1 - ui/aura/window_unittest.cc | 2 +- ui/oak/oak_window.cc | 1 - ui/shell_dialogs/select_file_dialog_win.cc | 1 - ui/views/controls/button/custom_button_unittest.cc | 1 - ui/views/corewm/capture_controller_unittest.cc | 1 - ui/views/corewm/compound_event_filter.cc | 1 - ui/views/corewm/compound_event_filter_unittest.cc | 1 - ui/views/corewm/tooltip_aura.cc | 1 - .../content_client/examples_browser_main_parts.cc | 3 +- .../desktop_aura/desktop_native_widget_aura.cc | 7 +-- .../desktop_native_widget_aura_unittest.cc | 1 - ui/views/widget/desktop_aura/desktop_screen_win.cc | 1 - ui/views/widget/desktop_aura/desktop_screen_x11.cc | 1 - ui/views/widget/widget_interactive_uitest.cc | 1 - ui/views/win/hwnd_util_aurawin.cc | 1 - 27 files changed, 99 insertions(+), 119 deletions(-) (limited to 'ui') diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc index fb8d6da2..482a7ce 100644 --- a/ui/app_list/views/apps_grid_view.cc +++ b/ui/app_list/views/apps_grid_view.cc @@ -28,7 +28,6 @@ #if defined(USE_AURA) #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #endif #if defined(OS_WIN) && !defined(USE_AURA) diff --git a/ui/aura/client/default_capture_client.cc b/ui/aura/client/default_capture_client.cc index debd86e..6008a89 100644 --- a/ui/aura/client/default_capture_client.cc +++ b/ui/aura/client/default_capture_client.cc @@ -5,7 +5,6 @@ #include "ui/aura/client/default_capture_client.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" namespace aura { namespace client { @@ -13,11 +12,11 @@ namespace client { DefaultCaptureClient::DefaultCaptureClient(Window* root_window) : root_window_(root_window), capture_window_(NULL) { - SetCaptureClient(root_window_, this); + client::SetCaptureClient(root_window_, this); } DefaultCaptureClient::~DefaultCaptureClient() { - SetCaptureClient(root_window_, NULL); + client::SetCaptureClient(root_window_, NULL); } void DefaultCaptureClient::SetCapture(Window* window) { diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index 096505b..2d0a09c 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -14,7 +14,6 @@ #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" -#include "ui/aura/window.h" #include "ui/base/hit_test.h" #include "ui/base/ui_base_switches.h" #include "ui/events/event.h" diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc index 507f3c4..daa9a92 100644 --- a/ui/aura/root_window.cc +++ b/ui/aura/root_window.cc @@ -141,7 +141,7 @@ RootWindow::CreateParams::CreateParams(const gfx::Rect& a_initial_bounds) // RootWindow, public: RootWindow::RootWindow(const CreateParams& params) - : window_(new Window(NULL)), + : Window(NULL), host_(CreateHost(this, params)), touch_ids_down_(0), last_cursor_(ui::kCursorNull), @@ -180,7 +180,7 @@ RootWindow::~RootWindow() { // ~Window, but by that time any calls to virtual methods overriden here (such // as GetRootWindow()) result in Window's implementation. By destroying here // we ensure GetRootWindow() still returns this. - window()->RemoveOrDestroyChildren(); + RemoveOrDestroyChildren(); // Destroying/removing child windows may try to access |host_| (eg. // GetAcceleratedWidget()) @@ -199,7 +199,7 @@ RootWindow* RootWindow::GetForAcceleratedWidget( void RootWindow::Init() { compositor()->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), host_->GetBounds().size()); - window()->Init(ui::LAYER_NOT_DRAWN); + Window::Init(ui::LAYER_NOT_DRAWN); compositor()->SetRootLayer(window()->layer()); transformer_.reset( new SimpleRootWindowTransformer(window(), gfx::Transform())); @@ -525,7 +525,7 @@ void RootWindow::SetRootWindowTransformer( scoped_ptr transformer) { transformer_ = transformer.Pass(); host_->SetInsets(transformer_->GetHostInsets()); - window()->SetTransform(transformer_->GetTransform()); + Window::SetTransform(transformer_->GetTransform()); // If the layer is not animating, then we need to update the root window // size immediately. if (!window()->layer()->GetAnimator()->is_animating()) @@ -540,14 +540,29 @@ gfx::Transform RootWindow::GetRootTransform() const { return transform; } +//////////////////////////////////////////////////////////////////////////////// +// RootWindow, Window overrides: + +Window* RootWindow::GetRootWindow() { + return this; +} + +const Window* RootWindow::GetRootWindow() const { + return this; +} + void RootWindow::SetTransform(const gfx::Transform& transform) { scoped_ptr transformer( new SimpleRootWindowTransformer(window(), transform)); SetRootWindowTransformer(transformer.Pass()); } -void RootWindow::DeviceScaleFactorChanged(float device_scale_factor) { - host_->OnDeviceScaleFactorChanged(device_scale_factor); +bool RootWindow::CanFocus() const { + return IsVisible(); +} + +bool RootWindow::CanReceiveEvents() const { + return IsVisible(); } //////////////////////////////////////////////////////////////////////////////// @@ -564,7 +579,7 @@ void RootWindow::MoveCursorToInternal(const gfx::Point& root_location, client::CursorClient* cursor_client = client::GetCursorClient(window()); if (cursor_client) { const gfx::Display& display = - gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); + gfx::Screen::GetScreenFor(this)->GetDisplayNearestWindow(window()); cursor_client->SetDisplay(display); } synthesize_mouse_move_ = false; @@ -676,6 +691,44 @@ void RootWindow::UpdateRootWindowSize(const gfx::Size& host_size) { } //////////////////////////////////////////////////////////////////////////////// +// RootWindow, ui::EventTarget implementation: + +ui::EventTarget* RootWindow::GetParentTarget() { + return client::GetEventClient(this) ? + client::GetEventClient(this)->GetToplevelEventTarget() : + Env::GetInstance(); +} + +//////////////////////////////////////////////////////////////////////////////// +// RootWindow, ui::LayerDelegate implementation: + +void RootWindow::OnDeviceScaleFactorChanged( + float device_scale_factor) { + const bool cursor_is_in_bounds = + GetBoundsInScreen().Contains(Env::GetInstance()->last_mouse_location()); + bool cursor_visible = false; + client::CursorClient* cursor_client = client::GetCursorClient(this); + if (cursor_is_in_bounds && cursor_client) { + cursor_visible = cursor_client->IsCursorVisible(); + if (cursor_visible) + cursor_client->HideCursor(); + } + host_->OnDeviceScaleFactorChanged(device_scale_factor); + Window::OnDeviceScaleFactorChanged(device_scale_factor); + // Update the device scale factor of the cursor client only when the last + // mouse location is on this root window. + if (cursor_is_in_bounds) { + if (cursor_client) { + const gfx::Display& display = + gfx::Screen::GetScreenFor(this)->GetDisplayNearestWindow(this); + cursor_client->SetDisplay(display); + } + } + if (cursor_is_in_bounds && cursor_client && cursor_visible) + cursor_client->ShowCursor(); +} + +//////////////////////////////////////////////////////////////////////////////// // RootWindow, aura::client::CaptureDelegate implementation: void RootWindow::UpdateCapture(Window* old_capture, 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_; diff --git a/ui/aura/root_window_host_x11.cc b/ui/aura/root_window_host_x11.cc index ccbf5fa..ec724ac 100644 --- a/ui/aura/root_window_host_x11.cc +++ b/ui/aura/root_window_host_x11.cc @@ -448,7 +448,7 @@ bool RootWindowHostX11::Dispatch(const base::NativeEvent& event) { if (static_cast(xev->xbutton.button) == kBackMouseButton || static_cast(xev->xbutton.button) == kForwardMouseButton) { client::UserActionClient* gesture_client = - client::GetUserActionClient(delegate_->AsRootWindow()->window()); + client::GetUserActionClient(delegate_->AsRootWindow()); if (gesture_client) { gesture_client->OnUserAction( static_cast(xev->xbutton.button) == kBackMouseButton ? @@ -614,9 +614,8 @@ void RootWindowHostX11::SetBounds(const gfx::Rect& bounds) { // Even if the host window's size doesn't change, aura's root window // size, which is in DIP, changes when the scale changes. float current_scale = delegate_->GetDeviceScaleFactor(); - float new_scale = gfx::Screen::GetScreenFor( - delegate_->AsRootWindow()->window())->GetDisplayNearestWindow( - delegate_->AsRootWindow()->window()).device_scale_factor(); + float new_scale = gfx::Screen::GetScreenFor(delegate_->AsRootWindow())-> + GetDisplayNearestWindow(delegate_->AsRootWindow()).device_scale_factor(); bool origin_changed = bounds_.origin() != bounds.origin(); bool size_changed = bounds_.size() != bounds.size(); XWindowChanges changes = {0}; @@ -648,8 +647,8 @@ void RootWindowHostX11::SetBounds(const gfx::Rect& bounds) { if (size_changed || current_scale != new_scale) { delegate_->OnHostResized(bounds.size()); } else { - delegate_->AsRootWindow()->window()->SchedulePaintInRect( - delegate_->AsRootWindow()->window()->bounds()); + delegate_->AsRootWindow()->SchedulePaintInRect( + delegate_->AsRootWindow()->bounds()); } } @@ -828,7 +827,7 @@ void RootWindowHostX11::OnRootWindowInitialized(RootWindow* root_window) { // RootWindow::Init is called. // (set in DisplayManager::CreateRootWindowForDisplay) // Ready when NotifyRootWindowInitialized is called from RootWindow::Init. - if (!delegate_ || root_window != GetRootWindow()) + if (!delegate_ || root_window != GetRootWindow()->window()) return; UpdateIsInternalDisplay(); @@ -944,7 +943,7 @@ void RootWindowHostX11::DispatchXI2Event(const base::NativeEvent& event) { if (type == ui::ET_MOUSE_RELEASED) break; client::UserActionClient* gesture_client = - client::GetUserActionClient(delegate_->AsRootWindow()->window()); + client::GetUserActionClient(delegate_->AsRootWindow()); if (gesture_client) { bool reverse_direction = ui::IsTouchpadEvent(xev) && ui::IsNaturalScrollEnabled(); diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc index 3fca471..2ef4430 100644 --- a/ui/aura/root_window_unittest.cc +++ b/ui/aura/root_window_unittest.cc @@ -16,7 +16,6 @@ #include "ui/aura/test/test_event_handler.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" -#include "ui/aura/window.h" #include "ui/aura/window_tracker.h" #include "ui/base/hit_test.h" #include "ui/events/event.h" @@ -1248,7 +1247,7 @@ namespace { // See description above DeleteRootFromHeldMouseEvent for details. class DeleteRootFromHeldMouseEventDelegate : public test::TestWindowDelegate { public: - explicit DeleteRootFromHeldMouseEventDelegate(aura::RootWindow* root) + explicit DeleteRootFromHeldMouseEventDelegate(aura::Window* root) : root_(root), got_mouse_event_(false), got_destroy_(false) { @@ -1270,7 +1269,7 @@ class DeleteRootFromHeldMouseEventDelegate : public test::TestWindowDelegate { } private: - RootWindow* root_; + Window* root_; bool got_mouse_event_; bool got_destroy_; diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc index 8393766..d5263e4 100644 --- a/ui/aura/test/aura_test_base.cc +++ b/ui/aura/test/aura_test_base.cc @@ -8,7 +8,6 @@ #include "ui/aura/root_window.h" #include "ui/aura/test/aura_test_helper.h" #include "ui/aura/test/test_window_delegate.h" -#include "ui/aura/window.h" #include "ui/base/ime/input_method_initializer.h" #include "ui/events/gestures/gesture_configuration.h" diff --git a/ui/aura/test/ui_controls_factory_aurawin.cc b/ui/aura/test/ui_controls_factory_aurawin.cc index 86f2d10..60a15c9 100644 --- a/ui/aura/test/ui_controls_factory_aurawin.cc +++ b/ui/aura/test/ui_controls_factory_aurawin.cc @@ -7,7 +7,6 @@ #include "base/message_loop/message_loop.h" #include "ui/aura/root_window.h" #include "ui/aura/test/ui_controls_factory_aura.h" -#include "ui/aura/window.h" #include "ui/base/test/ui_controls_aura.h" #include "ui/base/test/ui_controls_internal_win.h" diff --git a/ui/aura/test/ui_controls_factory_aurax11.cc b/ui/aura/test/ui_controls_factory_aurax11.cc index 7926143..b672181 100644 --- a/ui/aura/test/ui_controls_factory_aurax11.cc +++ b/ui/aura/test/ui_controls_factory_aurax11.cc @@ -15,7 +15,6 @@ #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/test/ui_controls_factory_aura.h" -#include "ui/aura/window.h" #include "ui/base/test/ui_controls_aura.h" #include "ui/base/x/x11_util.h" #include "ui/compositor/dip_util.h" @@ -146,7 +145,7 @@ class UIControlsX11 : public UIControlsAura { XMotionEvent* xmotion = &xevent.xmotion; xmotion->type = MotionNotify; gfx::Point point = ui::ConvertPointToPixel( - root_window_->window()->layer(), + root_window_->layer(), gfx::Point(static_cast(x), static_cast(y))); xmotion->x = point.x(); xmotion->y = point.y(); @@ -168,11 +167,9 @@ class UIControlsX11 : public UIControlsAura { XButtonEvent* xbutton = &xevent.xbutton; gfx::Point mouse_loc = aura::Env::GetInstance()->last_mouse_location(); aura::client::ScreenPositionClient* screen_position_client = - aura::client::GetScreenPositionClient(root_window_->window()); - if (screen_position_client) { - screen_position_client->ConvertPointFromScreen(root_window_->window(), - &mouse_loc); - } + aura::client::GetScreenPositionClient(root_window_); + if (screen_position_client) + screen_position_client->ConvertPointFromScreen(root_window_, &mouse_loc); xbutton->x = mouse_loc.x(); xbutton->y = mouse_loc.y(); xbutton->same_screen = True; diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 3154d68..0fe9a6d 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -14,7 +14,6 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "ui/aura/client/capture_client.h" -#include "ui/aura/client/cursor_client.h" #include "ui/aura/client/event_client.h" #include "ui/aura/client/focus_client.h" #include "ui/aura/client/screen_position_client.h" @@ -34,47 +33,6 @@ namespace aura { -class ScopedCursorHider { - public: - explicit ScopedCursorHider(Window* window) - : window_(window), - hid_cursor_(false) { - if (!window_->HasDispatcher()) - return; - const bool cursor_is_in_bounds = window_->GetBoundsInScreen().Contains( - Env::GetInstance()->last_mouse_location()); - client::CursorClient* cursor_client = client::GetCursorClient(window_); - if (cursor_is_in_bounds && cursor_client && - cursor_client->IsCursorVisible()) { - cursor_client->HideCursor(); - hid_cursor_ = true; - } - } - ~ScopedCursorHider() { - if (!window_->HasDispatcher()) - return; - - // Update the device scale factor of the cursor client only when the last - // mouse location is on this root window. - if (hid_cursor_) { - client::CursorClient* cursor_client = client::GetCursorClient(window_); - if (cursor_client) { - const gfx::Display& display = - gfx::Screen::GetScreenFor(window_)->GetDisplayNearestWindow( - window_); - cursor_client->SetDisplay(display); - cursor_client->ShowCursor(); - } - } - } - - private: - Window* window_; - bool hid_cursor_; - - DISALLOW_COPY_AND_ASSIGN(ScopedCursorHider); -}; - Window::Window(WindowDelegate* delegate) : dispatcher_(NULL), type_(client::WINDOW_TYPE_UNKNOWN), @@ -225,7 +183,7 @@ Window* Window::GetRootWindow() { } const Window* Window::GetRootWindow() const { - return dispatcher_ ? this : parent_ ? parent_->GetRootWindow() : NULL; + return parent_ ? parent_->GetRootWindow() : NULL; } WindowEventDispatcher* Window::GetDispatcher() { @@ -578,9 +536,6 @@ bool Window::HasFocus() const { } bool Window::CanFocus() const { - if (dispatcher_) - return IsVisible(); - // NOTE: as part of focusing the window the ActivationClient may make the // window visible (by way of making a hidden ancestor visible). For this // reason we can't check visibility here and assume the client is doing it. @@ -597,9 +552,6 @@ bool Window::CanFocus() const { } bool Window::CanReceiveEvents() const { - if (dispatcher_) - return IsVisible(); - // The client may forbid certain windows from receiving events at a given // point in time. client::EventClient* client = client::GetEventClient(GetRootWindow()); @@ -650,9 +602,6 @@ void* Window::GetNativeWindowProperty(const char* key) const { } void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { - ScopedCursorHider hider(this); - if (dispatcher_) - dispatcher_->DeviceScaleFactorChanged(device_scale_factor); if (delegate_) delegate_->OnDeviceScaleFactorChanged(device_scale_factor); } @@ -1173,11 +1122,6 @@ bool Window::CanAcceptEvent(const ui::Event& event) { } ui::EventTarget* Window::GetParentTarget() { - if (dispatcher_) { - return client::GetEventClient(this) ? - client::GetEventClient(this)->GetToplevelEventTarget() : - Env::GetInstance(); - } return parent_; } diff --git a/ui/aura/window.h b/ui/aura/window.h index ea38461..e11f83a 100644 --- a/ui/aura/window.h +++ b/ui/aura/window.h @@ -366,7 +366,6 @@ class AURA_EXPORT Window : public ui::LayerDelegate, private: friend class test::WindowTestApi; friend class LayoutManager; - friend class RootWindow; // Used when stacking windows. enum StackDirection { diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 1f18378..be917dd 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -1573,7 +1573,7 @@ TEST_F(WindowTest, TransformGesture) { gfx::Transform transform; transform.Translate(size.height(), 0.0); transform.Rotate(90.0); - dispatcher()->SetTransform(transform); + root_window()->SetTransform(transform); ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), 0, getTime()); diff --git a/ui/oak/oak_window.cc b/ui/oak/oak_window.cc index 64c6e42..7d69e22 100644 --- a/ui/oak/oak_window.cc +++ b/ui/oak/oak_window.cc @@ -7,7 +7,6 @@ #include "base/strings/utf_string_conversions.h" #include "grit/ui_resources.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image.h" diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc index fdf01d7..7cec71d 100644 --- a/ui/shell_dialogs/select_file_dialog_win.cc +++ b/ui/shell_dialogs/select_file_dialog_win.cc @@ -34,7 +34,6 @@ #if defined(USE_AURA) #include "ui/aura/remote_root_window_host_win.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #endif namespace { diff --git a/ui/views/controls/button/custom_button_unittest.cc b/ui/views/controls/button/custom_button_unittest.cc index 061bbd6..88ec051 100644 --- a/ui/views/controls/button/custom_button_unittest.cc +++ b/ui/views/controls/button/custom_button_unittest.cc @@ -12,7 +12,6 @@ #if defined(USE_AURA) #include "ui/aura/root_window.h" #include "ui/aura/test/test_cursor_client.h" -#include "ui/aura/window.h" #endif namespace views { diff --git a/ui/views/corewm/capture_controller_unittest.cc b/ui/views/corewm/capture_controller_unittest.cc index f6ac7b3..295ea3d 100644 --- a/ui/views/corewm/capture_controller_unittest.cc +++ b/ui/views/corewm/capture_controller_unittest.cc @@ -11,7 +11,6 @@ #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_window_delegate.h" -#include "ui/aura/window.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/views/test/views_test_base.h" diff --git a/ui/views/corewm/compound_event_filter.cc b/ui/views/corewm/compound_event_filter.cc index 8e42dd8..b761618 100644 --- a/ui/views/corewm/compound_event_filter.cc +++ b/ui/views/corewm/compound_event_filter.cc @@ -11,7 +11,6 @@ #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #include "ui/aura/window_delegate.h" #include "ui/aura/window_tracker.h" #include "ui/base/hit_test.h" diff --git a/ui/views/corewm/compound_event_filter_unittest.cc b/ui/views/corewm/compound_event_filter_unittest.cc index 6b852e4..932ace7 100644 --- a/ui/views/corewm/compound_event_filter_unittest.cc +++ b/ui/views/corewm/compound_event_filter_unittest.cc @@ -12,7 +12,6 @@ #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_cursor_client.h" #include "ui/aura/test/test_windows.h" -#include "ui/aura/window.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" diff --git a/ui/views/corewm/tooltip_aura.cc b/ui/views/corewm/tooltip_aura.cc index 8ba2393..1f7029e 100644 --- a/ui/views/corewm/tooltip_aura.cc +++ b/ui/views/corewm/tooltip_aura.cc @@ -7,7 +7,6 @@ #include "base/command_line.h" #include "base/strings/string_split.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/screen.h" #include "ui/gfx/text_elider.h" diff --git a/ui/views/examples/content_client/examples_browser_main_parts.cc b/ui/views/examples/content_client/examples_browser_main_parts.cc index 87aee75..d27baa1 100644 --- a/ui/views/examples/content_client/examples_browser_main_parts.cc +++ b/ui/views/examples/content_client/examples_browser_main_parts.cc @@ -28,7 +28,6 @@ #if defined(OS_CHROMEOS) #include "ui/aura/root_window.h" #include "ui/aura/test/test_screen.h" -#include "ui/aura/window.h" #include "ui/shell/minimal_shell.h" #endif @@ -54,7 +53,7 @@ void ExamplesBrowserMainParts::PreMainMessageLoopRun() { // Ensure the X window gets mapped. minimal_shell_->root_window()->ShowRootWindow(); // Ensure Aura knows where to open new windows. - window_context = minimal_shell_->root_window()->window(); + window_context = minimal_shell_->root_window(); #elif defined(USE_AURA) aura::Env::CreateInstance(); gfx::Screen::SetScreenInstance( diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 51d1229..5e22f0d 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc @@ -444,11 +444,11 @@ void DesktopNativeWidgetAura::InitNativeWidget( desktop_root_window_host_->CreateTooltip())); aura::client::SetTooltipClient(root_window_->window(), tooltip_controller_.get()); - root_window_->window()->AddPreTargetHandler(tooltip_controller_.get()); + root_window_->AddPreTargetHandler(tooltip_controller_.get()); if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW) { visibility_controller_.reset(new views::corewm::VisibilityController); - aura::client::SetVisibilityClient(root_window_->window(), + aura::client::SetVisibilityClient(root_window_.get(), visibility_controller_.get()); views::corewm::SetChildWindowVisibilityChangesAnimated( root_window_->window()); @@ -458,8 +458,7 @@ void DesktopNativeWidgetAura::InitNativeWidget( if (params.type == Widget::InitParams::TYPE_WINDOW) { focus_manager_event_handler_.reset(new FocusManagerEventHandler(this)); - root_window_->window()->AddPreTargetHandler( - focus_manager_event_handler_.get()); + root_window_->AddPreTargetHandler(focus_manager_event_handler_.get()); } event_client_.reset(new DesktopEventClient); diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc index 8390356..69b6b67 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc @@ -5,7 +5,6 @@ #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget.h" diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.cc b/ui/views/widget/desktop_aura/desktop_screen_win.cc index 805417d..f1a7767 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_win.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_win.cc @@ -7,7 +7,6 @@ #include "base/logging.h" #include "ui/aura/root_window.h" #include "ui/aura/root_window_host.h" -#include "ui/aura/window.h" #include "ui/gfx/display.h" #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" #include "ui/views/widget/desktop_aura/desktop_screen.h" diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc index cd5cffc..7b99790 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc @@ -15,7 +15,6 @@ #include "base/x11/edid_parser_x11.h" #include "ui/aura/root_window.h" #include "ui/aura/root_window_host.h" -#include "ui/aura/window.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/display.h" #include "ui/gfx/display_observer.h" diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc index 19686de..544d7ab 100644 --- a/ui/views/widget/widget_interactive_uitest.cc +++ b/ui/views/widget/widget_interactive_uitest.cc @@ -15,7 +15,6 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #endif #if defined(USE_AURA) && !defined(OS_CHROMEOS) diff --git a/ui/views/win/hwnd_util_aurawin.cc b/ui/views/win/hwnd_util_aurawin.cc index fc748184..a927df1 100644 --- a/ui/views/win/hwnd_util_aurawin.cc +++ b/ui/views/win/hwnd_util_aurawin.cc @@ -5,7 +5,6 @@ #include "ui/views/win/hwnd_util.h" #include "ui/aura/root_window.h" -#include "ui/aura/window.h" #include "ui/views/widget/widget.h" namespace views { -- cgit v1.1