Commit 04b3f54b authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

X11: Move X11 move loop source to ui/base/x from ui/views

This Cl doesn't bring any functional changes, but just moves
the X11 code down to ui/base/x.

Bug: 1069469
Change-Id: Idaddec11dfbe88226a190d2ba4b5050ad38eed6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144056
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758493}
parent 78d9e009
...@@ -44,12 +44,18 @@ jumbo_component("x") { ...@@ -44,12 +44,18 @@ jumbo_component("x") {
sources += [ sources += [
"selection_owner.cc", "selection_owner.cc",
"selection_owner.h", "selection_owner.h",
"x11_desktop_window_move_client.cc",
"x11_desktop_window_move_client.h",
"x11_drag_context.cc", "x11_drag_context.cc",
"x11_drag_context.h", "x11_drag_context.h",
"x11_drag_drop_client.cc", "x11_drag_drop_client.cc",
"x11_drag_drop_client.h", "x11_drag_drop_client.h",
"x11_move_loop.h",
"x11_move_loop_delegate.h",
"x11_os_exchange_data_provider.cc", "x11_os_exchange_data_provider.cc",
"x11_os_exchange_data_provider.h", "x11_os_exchange_data_provider.h",
"x11_whole_screen_move_loop.cc",
"x11_whole_screen_move_loop.h",
] ]
} }
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" #include "ui/base/x/x11_desktop_window_move_client.h"
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_window.h" #include "ui/base/x/x11_window.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
namespace views { namespace ui {
X11DesktopWindowMoveClient::X11DesktopWindowMoveClient(ui::XWindow* window) X11DesktopWindowMoveClient::X11DesktopWindowMoveClient(ui::XWindow* window)
: window_(window) {} : window_(window) {}
...@@ -40,4 +40,4 @@ void X11DesktopWindowMoveClient::EndMoveLoop() { ...@@ -40,4 +40,4 @@ void X11DesktopWindowMoveClient::EndMoveLoop() {
move_loop_.EndMoveLoop(); move_loop_.EndMoveLoop();
} }
} // namespace views } // namespace ui
...@@ -2,26 +2,24 @@ ...@@ -2,26 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ #ifndef UI_BASE_X_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ #define UI_BASE_X_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
#include "base/callback.h" #include "base/callback.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/component_export.h"
#include "ui/base/x/x11_move_loop_delegate.h"
#include "ui/base/x/x11_whole_screen_move_loop.h"
#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
#include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/x11_move_loop_delegate.h"
#include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
namespace ui { namespace ui {
class XWindow;
}
namespace views { class XWindow;
// When we're dragging tabs, we need to manually position our window. // When we're dragging tabs, we need to manually position our window.
class VIEWS_EXPORT X11DesktopWindowMoveClient class COMPONENT_EXPORT(UI_BASE_X) X11DesktopWindowMoveClient
: public views::X11MoveLoopDelegate { : public X11MoveLoopDelegate {
public: public:
explicit X11DesktopWindowMoveClient(ui::XWindow* window); explicit X11DesktopWindowMoveClient(ui::XWindow* window);
~X11DesktopWindowMoveClient() override; ~X11DesktopWindowMoveClient() override;
...@@ -49,6 +47,6 @@ class VIEWS_EXPORT X11DesktopWindowMoveClient ...@@ -49,6 +47,6 @@ class VIEWS_EXPORT X11DesktopWindowMoveClient
gfx::Vector2d window_offset_; gfx::Vector2d window_offset_;
}; };
} // namespace views } // namespace ui
#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_ #endif // UI_BASE_X_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ #ifndef UI_BASE_X_X11_MOVE_LOOP_H_
#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ #define UI_BASE_X_X11_MOVE_LOOP_H_
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
#include "ui/gfx/x/x11_types.h" #include "ui/gfx/x/x11_types.h"
namespace views { namespace ui {
// Runs a nested run loop and grabs the mouse. This is used to implement // Runs a nested run loop and grabs the mouse. This is used to implement
// dragging. // dragging.
...@@ -32,6 +32,6 @@ class X11MoveLoop { ...@@ -32,6 +32,6 @@ class X11MoveLoop {
virtual void EndMoveLoop() = 0; virtual void EndMoveLoop() = 0;
}; };
} // namespace views } // namespace ui
#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_H_ #endif // UI_BASE_X_X11_MOVE_LOOP_H_
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_DELEGATE_H_ #ifndef UI_BASE_X_X11_MOVE_LOOP_DELEGATE_H_
#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_DELEGATE_H_ #define UI_BASE_X_X11_MOVE_LOOP_DELEGATE_H_
namespace gfx { namespace gfx {
class Point; class Point;
} }
namespace views { namespace ui {
// Receives mouse events while the X11MoveLoop is tracking a drag. // Receives mouse events while the X11MoveLoop is tracking a drag.
class X11MoveLoopDelegate { class X11MoveLoopDelegate {
...@@ -29,6 +29,6 @@ class X11MoveLoopDelegate { ...@@ -29,6 +29,6 @@ class X11MoveLoopDelegate {
virtual void OnMoveLoopEnded() = 0; virtual void OnMoveLoopEnded() = 0;
}; };
} // namespace views } // namespace ui
#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_MOVE_LOOP_DELEGATE_H_ #endif // UI_BASE_X_X11_MOVE_LOOP_DELEGATE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h" #include "ui/base/x/x11_whole_screen_move_loop.h"
#include <stddef.h> #include <stddef.h>
...@@ -27,9 +27,8 @@ ...@@ -27,9 +27,8 @@
#include "ui/events/x/events_x_utils.h" #include "ui/events/x/events_x_utils.h"
#include "ui/events/x/x11_window_event_manager.h" #include "ui/events/x/x11_window_event_manager.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
#include "ui/platform_window/x11/x11_window.h"
namespace views { namespace ui {
// XGrabKey requires the modifier mask to explicitly be specified. // XGrabKey requires the modifier mask to explicitly be specified.
const unsigned int kModifiersMasks[] = {0, // No additional modifier. const unsigned int kModifiersMasks[] = {0, // No additional modifier.
...@@ -250,4 +249,4 @@ void X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) { ...@@ -250,4 +249,4 @@ void X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) {
XMapRaised(display, grab_input_window_); XMapRaised(display, grab_input_window_);
} }
} // namespace views } // namespace ui
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ #ifndef UI_BASE_X_X11_WHOLE_SCREEN_MOVE_LOOP_H_
#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ #define UI_BASE_X_X11_WHOLE_SCREEN_MOVE_LOOP_H_
#include <stdint.h> #include <stdint.h>
...@@ -11,29 +11,27 @@ ...@@ -11,29 +11,27 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "ui/base/cursor/cursor.h" #include "ui/base/x/x11_move_loop.h"
#include "ui/base/x/x11_move_loop_delegate.h"
#include "ui/events/platform/platform_event_dispatcher.h" #include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/geometry/vector2d_f.h" #include "ui/gfx/geometry/vector2d_f.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
#include "ui/gfx/x/x11_types.h" #include "ui/gfx/x/x11_types.h"
#include "ui/views/widget/desktop_aura/x11_move_loop.h"
#include "ui/views/widget/desktop_aura/x11_move_loop_delegate.h"
namespace ui { namespace ui {
class MouseEvent; class MouseEvent;
class ScopedEventDispatcher; class ScopedEventDispatcher;
class XScopedEventSelector; class XScopedEventSelector;
} // namespace ui
namespace views {
// Runs a nested run loop and grabs the mouse. This is used to implement // Runs a nested run loop and grabs the mouse. This is used to implement
// dragging. // dragging.
class X11WholeScreenMoveLoop : public X11MoveLoop, class COMPONENT_EXPORT(UI_BASE_X) X11WholeScreenMoveLoop
public ui::PlatformEventDispatcher { : public X11MoveLoop,
public ui::PlatformEventDispatcher {
public: public:
explicit X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate); explicit X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate);
~X11WholeScreenMoveLoop() override; ~X11WholeScreenMoveLoop() override;
...@@ -96,6 +94,6 @@ class X11WholeScreenMoveLoop : public X11MoveLoop, ...@@ -96,6 +94,6 @@ class X11WholeScreenMoveLoop : public X11MoveLoop,
DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop); DISALLOW_COPY_AND_ASSIGN(X11WholeScreenMoveLoop);
}; };
} // namespace views } // namespace ui
#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WHOLE_SCREEN_MOVE_LOOP_H_ #endif // UI_BASE_X_X11_WHOLE_SCREEN_MOVE_LOOP_H_
...@@ -757,24 +757,21 @@ jumbo_component("views") { ...@@ -757,24 +757,21 @@ jumbo_component("views") {
] ]
public_deps += [ "//ui/base/mojom:cursor_type" ] public_deps += [ "//ui/base/mojom:cursor_type" ]
if (use_x11) { if (use_x11) {
deps += [ "//ui/platform_window/x11" ] deps += [
"//ui/base/x",
"//ui/platform_window/x11",
]
public += [ public += [
"widget/desktop_aura/desktop_drag_drop_client_aurax11.h", "widget/desktop_aura/desktop_drag_drop_client_aurax11.h",
"widget/desktop_aura/desktop_screen_x11.h", "widget/desktop_aura/desktop_screen_x11.h",
"widget/desktop_aura/desktop_window_tree_host_x11.h", "widget/desktop_aura/desktop_window_tree_host_x11.h",
"widget/desktop_aura/x11_desktop_window_move_client.h",
"widget/desktop_aura/x11_move_loop.h",
"widget/desktop_aura/x11_move_loop_delegate.h",
"widget/desktop_aura/x11_topmost_window_finder.h", "widget/desktop_aura/x11_topmost_window_finder.h",
"widget/desktop_aura/x11_whole_screen_move_loop.h",
] ]
sources += [ sources += [
"widget/desktop_aura/desktop_drag_drop_client_aurax11.cc", "widget/desktop_aura/desktop_drag_drop_client_aurax11.cc",
"widget/desktop_aura/desktop_screen_x11.cc", "widget/desktop_aura/desktop_screen_x11.cc",
"widget/desktop_aura/desktop_window_tree_host_x11.cc", "widget/desktop_aura/desktop_window_tree_host_x11.cc",
"widget/desktop_aura/x11_desktop_window_move_client.cc",
"widget/desktop_aura/x11_topmost_window_finder.cc", "widget/desktop_aura/x11_topmost_window_finder.cc",
"widget/desktop_aura/x11_whole_screen_move_loop.cc",
] ]
} else if (is_win) { } else if (is_win) {
public += [ "widget/desktop_aura/desktop_window_tree_host_win.h" ] public += [ "widget/desktop_aura/desktop_window_tree_host_win.h" ]
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "ui/base/x/selection_utils.h" #include "ui/base/x/selection_utils.h"
#include "ui/base/x/x11_drag_context.h" #include "ui/base/x/x11_drag_context.h"
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_whole_screen_move_loop.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h"
#include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"
#include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
using aura::client::DragDropDelegate; using aura::client::DragDropDelegate;
...@@ -251,9 +251,9 @@ void DesktopDragDropClientAuraX11::OnMoveLoopEnded() { ...@@ -251,9 +251,9 @@ void DesktopDragDropClientAuraX11::OnMoveLoopEnded() {
XDragDropClient::HandleMoveLoopEnded(); XDragDropClient::HandleMoveLoopEnded();
} }
std::unique_ptr<X11MoveLoop> DesktopDragDropClientAuraX11::CreateMoveLoop( std::unique_ptr<ui::X11MoveLoop> DesktopDragDropClientAuraX11::CreateMoveLoop(
X11MoveLoopDelegate* delegate) { X11MoveLoopDelegate* delegate) {
return base::WrapUnique(new X11WholeScreenMoveLoop(this)); return base::WrapUnique(new ui::X11WholeScreenMoveLoop(this));
} }
void DesktopDragDropClientAuraX11::DragTranslate( void DesktopDragDropClientAuraX11::DragTranslate(
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "ui/base/cursor/cursor.h" #include "ui/base/cursor/cursor.h"
#include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/x/x11_drag_drop_client.h" #include "ui/base/x/x11_drag_drop_client.h"
#include "ui/base/x/x11_move_loop_delegate.h"
#include "ui/events/event_constants.h" #include "ui/events/event_constants.h"
#include "ui/events/platform/x11/x11_event_source.h" #include "ui/events/platform/x11/x11_event_source.h"
#include "ui/events/x/x11_window_event_manager.h" #include "ui/events/x/x11_window_event_manager.h"
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
#include "ui/views/views_export.h" #include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/x11_move_loop_delegate.h"
namespace aura { namespace aura {
namespace client { namespace client {
...@@ -40,12 +40,12 @@ namespace ui { ...@@ -40,12 +40,12 @@ namespace ui {
class DropTargetEvent; class DropTargetEvent;
class OSExchangeData; class OSExchangeData;
class XTopmostWindowFinder; class XTopmostWindowFinder;
class X11MoveLoop;
} // namespace ui } // namespace ui
namespace views { namespace views {
class DesktopNativeCursorManager; class DesktopNativeCursorManager;
class Widget; class Widget;
class X11MoveLoop;
// Implements drag and drop on X11 for aura. On one side, this class takes raw // Implements drag and drop on X11 for aura. On one side, this class takes raw
// X11 events forwarded from DesktopWindowTreeHostLinux, while on the other, it // X11 events forwarded from DesktopWindowTreeHostLinux, while on the other, it
...@@ -56,7 +56,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11 ...@@ -56,7 +56,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
public aura::client::DragDropClient, public aura::client::DragDropClient,
public ui::XEventDispatcher, public ui::XEventDispatcher,
public aura::WindowObserver, public aura::WindowObserver,
public X11MoveLoopDelegate { public ui::X11MoveLoopDelegate {
public: public:
DesktopDragDropClientAuraX11( DesktopDragDropClientAuraX11(
aura::Window* root_window, aura::Window* root_window,
...@@ -85,7 +85,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11 ...@@ -85,7 +85,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
// aura::WindowObserver: // aura::WindowObserver:
void OnWindowDestroyed(aura::Window* window) override; void OnWindowDestroyed(aura::Window* window) override;
// X11MoveLoopDelegate: // ui::X11MoveLoopDelegate:
void OnMouseMovement(const gfx::Point& screen_point, void OnMouseMovement(const gfx::Point& screen_point,
int flags, int flags,
base::TimeTicks event_time) override; base::TimeTicks event_time) override;
...@@ -97,7 +97,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11 ...@@ -97,7 +97,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
Widget* drag_widget() { return drag_widget_.get(); } Widget* drag_widget() { return drag_widget_.get(); }
// Creates a move loop. Virtual for testing. // Creates a move loop. Virtual for testing.
virtual std::unique_ptr<X11MoveLoop> CreateMoveLoop( virtual std::unique_ptr<ui::X11MoveLoop> CreateMoveLoop(
X11MoveLoopDelegate* delegate); X11MoveLoopDelegate* delegate);
private: private:
...@@ -125,8 +125,8 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11 ...@@ -125,8 +125,8 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
void EndMoveLoop() override; void EndMoveLoop() override;
// A nested run loop that notifies this object of events through the // A nested run loop that notifies this object of events through the
// X11MoveLoopDelegate interface. // ui::X11MoveLoopDelegate interface.
std::unique_ptr<X11MoveLoop> move_loop_; std::unique_ptr<ui::X11MoveLoop> move_loop_;
aura::Window* root_window_; aura::Window* root_window_;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
#include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/x/x11_move_loop.h"
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
#include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11.h"
...@@ -29,7 +30,6 @@ ...@@ -29,7 +30,6 @@
#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h"
#include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/widget/desktop_aura/x11_move_loop.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
namespace views { namespace views {
...@@ -66,17 +66,17 @@ class ClientMessageEventCollector { ...@@ -66,17 +66,17 @@ class ClientMessageEventCollector {
DISALLOW_COPY_AND_ASSIGN(ClientMessageEventCollector); DISALLOW_COPY_AND_ASSIGN(ClientMessageEventCollector);
}; };
// An implementation of X11MoveLoop where RunMoveLoop() always starts the move // An implementation of ui::X11MoveLoop where RunMoveLoop() always starts the
// loop. // move loop.
class TestMoveLoop : public X11MoveLoop { class TestMoveLoop : public ui::X11MoveLoop {
public: public:
explicit TestMoveLoop(X11MoveLoopDelegate* delegate); explicit TestMoveLoop(ui::X11MoveLoopDelegate* delegate);
~TestMoveLoop() override; ~TestMoveLoop() override;
// Returns true if the move loop is running. // Returns true if the move loop is running.
bool IsRunning() const; bool IsRunning() const;
// X11MoveLoop: // ui::X11MoveLoop:
bool RunMoveLoop(bool can_grab_pointer, bool RunMoveLoop(bool can_grab_pointer,
::Cursor old_cursor, ::Cursor old_cursor,
::Cursor new_cursor) override; ::Cursor new_cursor) override;
...@@ -85,7 +85,7 @@ class TestMoveLoop : public X11MoveLoop { ...@@ -85,7 +85,7 @@ class TestMoveLoop : public X11MoveLoop {
private: private:
// Not owned. // Not owned.
X11MoveLoopDelegate* delegate_; ui::X11MoveLoopDelegate* delegate_;
// Ends the move loop. // Ends the move loop.
base::OnceClosure quit_closure_; base::OnceClosure quit_closure_;
...@@ -111,8 +111,8 @@ class SimpleTestDragDropClient : public DesktopDragDropClientAuraX11 { ...@@ -111,8 +111,8 @@ class SimpleTestDragDropClient : public DesktopDragDropClientAuraX11 {
private: private:
// DesktopDragDropClientAuraX11: // DesktopDragDropClientAuraX11:
std::unique_ptr<X11MoveLoop> CreateMoveLoop( std::unique_ptr<ui::X11MoveLoop> CreateMoveLoop(
X11MoveLoopDelegate* delegate) override; ui::X11MoveLoopDelegate* delegate) override;
XID FindWindowFor(const gfx::Point& screen_point) override; XID FindWindowFor(const gfx::Point& screen_point) override;
// The XID of the window which is simulated to be the topmost window. // The XID of the window which is simulated to be the topmost window.
...@@ -209,7 +209,7 @@ void ClientMessageEventCollector::RecordEvent( ...@@ -209,7 +209,7 @@ void ClientMessageEventCollector::RecordEvent(
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// TestMoveLoop // TestMoveLoop
TestMoveLoop::TestMoveLoop(X11MoveLoopDelegate* delegate) TestMoveLoop::TestMoveLoop(ui::X11MoveLoopDelegate* delegate)
: delegate_(delegate) {} : delegate_(delegate) {}
TestMoveLoop::~TestMoveLoop() = default; TestMoveLoop::~TestMoveLoop() = default;
...@@ -259,8 +259,8 @@ bool SimpleTestDragDropClient::IsMoveLoopRunning() { ...@@ -259,8 +259,8 @@ bool SimpleTestDragDropClient::IsMoveLoopRunning() {
return loop_->IsRunning(); return loop_->IsRunning();
} }
std::unique_ptr<X11MoveLoop> SimpleTestDragDropClient::CreateMoveLoop( std::unique_ptr<ui::X11MoveLoop> SimpleTestDragDropClient::CreateMoveLoop(
X11MoveLoopDelegate* delegate) { ui::X11MoveLoopDelegate* delegate) {
loop_ = new TestMoveLoop(delegate); loop_ = new TestMoveLoop(delegate);
return base::WrapUnique(loop_); return base::WrapUnique(loop_);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "ui/base/hit_test.h" #include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h" #include "ui/base/ime/input_method.h"
#include "ui/base/layout.h" #include "ui/base/layout.h"
#include "ui/base/x/x11_desktop_window_move_client.h"
#include "ui/base/x/x11_pointer_grab.h" #include "ui/base/x/x11_pointer_grab.h"
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_util_internal.h" #include "ui/base/x/x11_util_internal.h"
...@@ -57,7 +58,6 @@ ...@@ -57,7 +58,6 @@
#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h"
#include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h"
#include "ui/views/window/native_frame_view.h" #include "ui/views/window/native_frame_view.h"
#include "ui/wm/core/compound_event_filter.h" #include "ui/wm/core/compound_event_filter.h"
#include "ui/wm/core/window_util.h" #include "ui/wm/core/window_util.h"
...@@ -91,7 +91,7 @@ void DesktopWindowTreeHostX11::Init(const Widget::InitParams& params) { ...@@ -91,7 +91,7 @@ void DesktopWindowTreeHostX11::Init(const Widget::InitParams& params) {
void DesktopWindowTreeHostX11::OnNativeWidgetCreated( void DesktopWindowTreeHostX11::OnNativeWidgetCreated(
const Widget::InitParams& params) { const Widget::InitParams& params) {
x11_window_move_client_ = std::make_unique<X11DesktopWindowMoveClient>( x11_window_move_client_ = std::make_unique<ui::X11DesktopWindowMoveClient>(
static_cast<ui::X11Window*>(platform_window())); static_cast<ui::X11Window*>(platform_window()));
DesktopWindowTreeHostLinux::OnNativeWidgetCreated(params); DesktopWindowTreeHostLinux::OnNativeWidgetCreated(params);
} }
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
namespace ui { namespace ui {
enum class DomCode; enum class DomCode;
class X11Window; class X11Window;
class X11DesktopWindowMoveClient;
} // namespace ui } // namespace ui
namespace views { namespace views {
class DesktopDragDropClientAuraX11; class DesktopDragDropClientAuraX11;
class X11DesktopWindowMoveClient;
class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
public ui::XEventDelegate { public ui::XEventDelegate {
...@@ -58,7 +58,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, ...@@ -58,7 +58,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux,
DesktopDragDropClientAuraX11* drag_drop_client_ = nullptr; DesktopDragDropClientAuraX11* drag_drop_client_ = nullptr;
std::unique_ptr<X11DesktopWindowMoveClient> x11_window_move_client_; std::unique_ptr<ui::X11DesktopWindowMoveClient> x11_window_move_client_;
DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment