Commit e73f470c authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Consolicate WMHelperAsh and WMHelper, remove WMHelperMus

I'll remove accessors in separate CL(s).

Bug: 778331
Change-Id: Ia13d4eb195c8ebcf96986c8474566b332a065d49
Reviewed-on: https://chromium-review.googlesource.com/754090
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514852}
parent 28922ba3
......@@ -14,7 +14,7 @@
#include "components/exo/display.h"
#include "components/exo/file_helper.h"
#include "components/exo/wayland/server.h"
#include "components/exo/wm_helper_ash.h"
#include "components/exo/wm_helper.h"
namespace ash {
......@@ -62,7 +62,7 @@ WaylandServerController::~WaylandServerController() {
}
WaylandServerController::WaylandServerController() {
wm_helper_ = std::make_unique<exo::WMHelperAsh>();
wm_helper_ = std::make_unique<exo::WMHelper>();
exo::WMHelper::SetInstance(wm_helper_.get());
// TODO(penghuang): wire up notification surface manager.
// http://crbug.com/768439
......
......@@ -17,6 +17,7 @@
#include "components/arc/arc_service_manager.h"
#include "components/exo/shell_surface.h"
#include "components/exo/surface.h"
#include "components/exo/wm_helper.h"
#include "ui/arc/notification/arc_notification_surface.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
......@@ -441,6 +442,7 @@ aura::Window* ArcAccessibilityHelperBridge::GetActiveWindow() {
}
void ArcAccessibilityHelperBridge::OnWindowActivated(
ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) {
if (gained_active == lost_active)
......
......@@ -14,11 +14,11 @@
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "components/arc/common/accessibility_helper.mojom.h"
#include "components/arc/instance_holder.h"
#include "components/exo/wm_helper.h"
#include "components/keyed_service/core/keyed_service.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "ui/accessibility/ax_host_delegate.h"
#include "ui/arc/notification/arc_notification_surface_manager.h"
#include "ui/wm/public/activation_change_observer.h"
class Profile;
......@@ -38,7 +38,7 @@ class ArcAccessibilityHelperBridge
: public KeyedService,
public mojom::AccessibilityHelperHost,
public InstanceHolder<mojom::AccessibilityHelperInstance>::Observer,
public exo::WMHelper::ActivationObserver,
public wm::ActivationChangeObserver,
public AXTreeSourceArc::Delegate,
public ArcAppListPrefs::Observer,
public ArcNotificationSurfaceManager::Observer {
......@@ -90,8 +90,9 @@ class ArcAccessibilityHelperBridge
virtual aura::Window* GetActiveWindow();
private:
// exo::WMHelper::ActivationObserver overrides.
void OnWindowActivated(aura::Window* gained_active,
// wm::ActivationChangeObserver overrides.
void OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) override;
void OnActionResult(const ui::AXActionData& data, bool result) const;
......
......@@ -14,7 +14,6 @@
#include "components/arc/arc_bridge_service.h"
#include "components/arc/common/accessibility_helper.mojom.h"
#include "components/exo/shell_surface.h"
#include "components/exo/wm_helper.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/window.h"
......@@ -25,40 +24,6 @@ namespace arc {
class ArcAccessibilityHelperBridgeTest : public testing::Test {
public:
class FakeWMHelper : public exo::WMHelper {
public:
FakeWMHelper() = default;
private:
const display::ManagedDisplayInfo& GetDisplayInfo(
int64_t display_id) const override {
static const display::ManagedDisplayInfo info;
return info;
}
aura::Window* GetPrimaryDisplayContainer(int container_id) override {
return nullptr;
}
aura::Window* GetActiveWindow() const override { return nullptr; }
aura::Window* GetFocusedWindow() const override { return nullptr; }
ui::CursorSize GetCursorSize() const override {
return ui::CursorSize::kNormal;
}
const display::Display& GetCursorDisplay() const override {
static const display::Display display;
return display;
}
void AddPreTargetHandler(ui::EventHandler* handler) override {}
void PrependPreTargetHandler(ui::EventHandler* handler) override {}
void RemovePreTargetHandler(ui::EventHandler* handler) override {}
void AddPostTargetHandler(ui::EventHandler* handler) override {}
void RemovePostTargetHandler(ui::EventHandler* handler) override {}
bool IsTabletModeWindowManagerEnabled() const override { return false; }
double GetDefaultDeviceScaleFactor() const override { return 1.0; }
bool AreVerifiedSyncTokensNeeded() const override { return false; }
DISALLOW_COPY_AND_ASSIGN(FakeWMHelper);
};
class TestArcAccessibilityHelperBridge : public ArcAccessibilityHelperBridge {
public:
TestArcAccessibilityHelperBridge(content::BrowserContext* browser_context,
......@@ -84,8 +49,6 @@ class ArcAccessibilityHelperBridgeTest : public testing::Test {
ArcAccessibilityHelperBridgeTest() = default;
void SetUp() override {
wm_helper_ = std::make_unique<FakeWMHelper>();
exo::WMHelper::SetInstance(wm_helper_.get());
testing_profile_ = std::make_unique<TestingProfile>();
bridge_service_ = std::make_unique<ArcBridgeService>();
accessibility_helper_bridge_ =
......@@ -98,8 +61,6 @@ class ArcAccessibilityHelperBridgeTest : public testing::Test {
accessibility_helper_bridge_.reset();
bridge_service_.reset();
testing_profile_.reset();
exo::WMHelper::SetInstance(nullptr);
wm_helper_.reset();
}
TestArcAccessibilityHelperBridge* accessibility_helper_bridge() {
......@@ -108,7 +69,6 @@ class ArcAccessibilityHelperBridgeTest : public testing::Test {
private:
content::TestBrowserThreadBundle thread_bundle_;
std::unique_ptr<FakeWMHelper> wm_helper_;
std::unique_ptr<TestingProfile> testing_profile_;
std::unique_ptr<ArcBridgeService> bridge_service_;
std::unique_ptr<TestArcAccessibilityHelperBridge>
......
......@@ -502,7 +502,8 @@ void AXTreeSourceArc::SerializeNode(mojom::AccessibilityNodeInfoData* node,
out_data->AddBoolAttribute(ui::AX_ATTR_SCROLLABLE, true);
}
exo::WMHelper* wm_helper = exo::WMHelper::GetInstance();
exo::WMHelper* wm_helper =
exo::WMHelper::HasInstance() ? exo::WMHelper::GetInstance() : nullptr;
// To get bounds of a node which can be passed to AXNodeData.location,
// - Root node must exist.
......
......@@ -20,7 +20,7 @@
#include "components/exo/display.h"
#include "components/exo/file_helper.h"
#include "components/exo/wayland/server.h"
#include "components/exo/wm_helper_ash.h"
#include "components/exo/wm_helper.h"
#include "content/public/browser/browser_thread.h"
#include "ui/arc/notification/arc_notification_surface_manager_impl.h"
......@@ -158,7 +158,7 @@ ExoParts::ExoParts() {
arc_notification_surface_manager_ =
base::MakeUnique<arc::ArcNotificationSurfaceManagerImpl>();
DCHECK(!ash_util::IsRunningInMash());
wm_helper_ = base::MakeUnique<exo::WMHelperAsh>();
wm_helper_ = base::MakeUnique<exo::WMHelper>();
exo::WMHelper::SetInstance(wm_helper_.get());
display_ =
base::MakeUnique<exo::Display>(arc_notification_surface_manager_.get(),
......
......@@ -13,6 +13,7 @@
#include "components/arc/ime/arc_ime_bridge_impl.h"
#include "components/exo/shell_surface.h"
#include "components/exo/surface.h"
#include "components/exo/wm_helper.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
......
......@@ -9,8 +9,8 @@
#include "base/macros.h"
#include "components/arc/ime/arc_ime_bridge.h"
#include "components/exo/wm_helper.h"
#include "components/keyed_service/core/keyed_service.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/aura/env_observer.h"
#include "ui/aura/window_observer.h"
#include "ui/base/ime/text_input_client.h"
......@@ -42,7 +42,7 @@ class ArcImeService : public KeyedService,
public ArcImeBridge::Delegate,
public aura::EnvObserver,
public aura::WindowObserver,
public exo::WMHelper::FocusObserver,
public aura::client::FocusChangeObserver,
public keyboard::KeyboardControllerObserver,
public ui::TextInputClient {
public:
......@@ -79,7 +79,7 @@ class ArcImeService : public KeyedService,
void OnWindowRemovingFromRootWindow(aura::Window* window,
aura::Window* new_root) override;
// Overridden from exo::WMHelper::FocusObserver:
// Overridden from aura::client::FocusChangeObserver:
void OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) override;
......
......@@ -54,10 +54,6 @@ source_set("exo") {
"touch_delegate.h",
"wm_helper.cc",
"wm_helper.h",
"wm_helper_ash.cc",
"wm_helper_ash.h",
"wm_helper_mus.cc",
"wm_helper_mus.h",
]
deps = [
......
......@@ -32,7 +32,7 @@ GamingSeat::~GamingSeat() {
}
////////////////////////////////////////////////////////////////////////////////
// WMHelper::FocusObserver overrides:
// ui::aura::client::FocusChangeObserver overrides:
void GamingSeat::OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) {
......
......@@ -23,7 +23,8 @@ class GamepadDelegate;
// This class represents one gaming seat. It uses /device/gamepad or
// ozone/gamepad as backend and notifies corresponding GamepadDelegate of any
// gamepad changes.
class GamingSeat : public WMHelper::FocusObserver, public ui::GamepadObserver {
class GamingSeat : public aura::client::FocusChangeObserver,
public ui::GamepadObserver {
public:
// This class will monitor gamepad connection changes and manage gamepad
// returned by gaming_seat_delegate.
......@@ -31,7 +32,7 @@ class GamingSeat : public WMHelper::FocusObserver, public ui::GamepadObserver {
~GamingSeat() override;
// Overridden from WMHelper::FocusObserver:
// Overridden from ui::aura::client::FocusChangeObserver:
void OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) override;
......
......@@ -9,6 +9,7 @@
#include "components/exo/keyboard_device_configuration_delegate.h"
#include "components/exo/shell_surface.h"
#include "components/exo/surface.h"
#include "components/exo/wm_helper.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/window.h"
#include "ui/base/ime/input_method.h"
......@@ -309,7 +310,7 @@ void Keyboard::OnKeyboardDeviceConfigurationChanged() {
}
////////////////////////////////////////////////////////////////////////////////
// WMHelper::TabletModeObserver overrides:
// ash::TabletModeObserver overrides:
void Keyboard::OnTabletModeStarted() {
OnKeyboardDeviceConfigurationChanged();
......
......@@ -7,11 +7,14 @@
#include <vector>
#include "ash/wm/tablet_mode/tablet_mode_observer.h"
#include "base/containers/flat_map.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "components/exo/keyboard_observer.h"
#include "components/exo/surface_observer.h"
#include "components/exo/wm_helper.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/events/devices/input_device_event_observer.h"
#include "ui/events/event.h"
#include "ui/events/event_handler.h"
......@@ -28,9 +31,9 @@ class Surface;
// This class implements a client keyboard that represents one or more keyboard
// devices.
class Keyboard : public ui::EventHandler,
public WMHelper::FocusObserver,
public WMHelper::InputDeviceEventObserver,
public WMHelper::TabletModeObserver,
public aura::client::FocusChangeObserver,
public ui::InputDeviceEventObserver,
public ash::TabletModeObserver,
public SurfaceObserver {
public:
explicit Keyboard(KeyboardDelegate* delegate);
......@@ -53,7 +56,7 @@ class Keyboard : public ui::EventHandler,
// Overridden from ui::EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override;
// Overridden WMHelper::FocusObserver:
// Overridden ui::aura::client::FocusChangeObserver:
void OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) override;
......@@ -63,7 +66,7 @@ class Keyboard : public ui::EventHandler,
// Overridden from ui::InputDeviceEventObserver:
void OnKeyboardDeviceConfigurationChanged() override;
// Overridden from WMHelper::TabletModeObserver:
// Overridden from ash::TabletModeObserver:
void OnTabletModeStarted() override;
void OnTabletModeEnding() override;
void OnTabletModeEnded() override;
......
......@@ -330,7 +330,7 @@ void Pointer::OnGestureEvent(ui::GestureEvent* event) {
}
////////////////////////////////////////////////////////////////////////////////
// WMHelper::CursorObserver overrides:
// ui::client::CursorClientObserver overrides:
void Pointer::OnCursorSizeChanged(ui::CursorSize cursor_size) {
if (focus_surface_)
......@@ -343,7 +343,7 @@ void Pointer::OnCursorDisplayChanged(const display::Display& display) {
}
////////////////////////////////////////////////////////////////////////////////
// WMHelper::DisplayConfigurationObserver overrides:
// ash::WindowTreeHostManager::Observer overrides:
void Pointer::OnDisplayConfigurationChanged() {
UpdatePointerSurface(root_surface());
......
......@@ -14,6 +14,7 @@
#include "components/exo/surface_tree_host.h"
#include "components/exo/wm_helper.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/cursor_client_observer.h"
#include "ui/base/cursor/cursor.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_handler.h"
......@@ -41,8 +42,8 @@ class SurfaceTreeHost;
class Pointer : public SurfaceTreeHost,
public SurfaceObserver,
public ui::EventHandler,
public WMHelper::CursorObserver,
public WMHelper::DisplayConfigurationObserver {
public aura::client::CursorClientObserver,
public ash::WindowTreeHostManager::Observer {
public:
explicit Pointer(PointerDelegate* delegate);
~Pointer() override;
......@@ -71,11 +72,11 @@ class Pointer : public SurfaceTreeHost,
void OnScrollEvent(ui::ScrollEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden from WMHelper::CursorObserver:
// Overridden from ui::client::CursorClientObserver:
void OnCursorSizeChanged(ui::CursorSize cursor_size) override;
void OnCursorDisplayChanged(const display::Display& display) override;
// Overridden from WMHelper::DisplayConfigurationObserver:
// Overridden from ash::WindowTreeHostManager::Observer:
void OnDisplayConfigurationChanged() override;
private:
......
......@@ -24,6 +24,7 @@
#include "base/trace_event/trace_event_argument.h"
#include "cc/trees/layer_tree_frame_sink.h"
#include "components/exo/surface.h"
#include "components/exo/wm_helper.h"
#include "services/ui/public/interfaces/window_tree_constants.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/cursor_client.h"
......@@ -1084,11 +1085,11 @@ void ShellSurface::OnWindowDestroying(aura::Window* window) {
}
////////////////////////////////////////////////////////////////////////////////
// WMHelper::ActivationObserver overrides:
// wm::ActivationChangeObserver overrides:
void ShellSurface::OnWindowActivated(
aura::Window* gained_active,
aura::Window* lost_active) {
void ShellSurface::OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) {
if (!widget_)
return;
......@@ -1101,7 +1102,7 @@ void ShellSurface::OnWindowActivated(
}
////////////////////////////////////////////////////////////////////////////////
// WMHelper::DisplayConfigurationObserver overrides:
// ash::WindowTreeHostManager::Observer overrides:
void ShellSurface::OnDisplayConfigurationChanged() {
if (bounds_mode_ != BoundsMode::CLIENT)
......
......@@ -9,6 +9,7 @@
#include <memory>
#include <string>
#include "ash/display/window_tree_host_manager.h"
#include "ash/wm/window_state_observer.h"
#include "base/containers/circular_deque.h"
#include "base/macros.h"
......@@ -16,7 +17,7 @@
#include "base/strings/string16.h"
#include "components/exo/surface_observer.h"
#include "components/exo/surface_tree_host.h"
#include "components/exo/wm_helper.h"
#include "ui/aura/window_observer.h"
#include "ui/base/hit_test.h"
#include "ui/compositor/compositor_lock.h"
......@@ -25,6 +26,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/vector2d.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/wm/public/activation_change_observer.h"
namespace ash {
class WindowResizer;
......@@ -58,8 +60,8 @@ class ShellSurface : public SurfaceTreeHost,
public display::DisplayObserver,
public ash::wm::WindowStateObserver,
public aura::WindowObserver,
public WMHelper::ActivationObserver,
public WMHelper::DisplayConfigurationObserver,
public wm::ActivationChangeObserver,
public ash::WindowTreeHostManager::Observer,
public ui::CompositorLockClient {
public:
enum class BoundsMode { SHELL, CLIENT, FIXED };
......@@ -274,12 +276,12 @@ class ShellSurface : public SurfaceTreeHost,
const gfx::Rect& new_bounds) override;
void OnWindowDestroying(aura::Window* window) override;
// Overridden from WMHelper::ActivationObserver:
void OnWindowActivated(
aura::Window* gained_active,
aura::Window* lost_active) override;
// Overridden from wm::ActivationChangeObserver:
void OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) override;
// Overridden from WMHelper::DisplayConfigurationObserver:
// Overridden from ash::WindowTreeHostManager::Observer:
void OnDisplayConfigurationChanged() override;
// Overridden from ui::EventHandler:
......
......@@ -7,7 +7,7 @@
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "components/exo/test/exo_test_helper.h"
#include "components/exo/wm_helper_ash.h"
#include "components/exo/wm_helper.h"
#include "ui/wm/core/wm_core_switches.h"
namespace exo {
......@@ -25,7 +25,7 @@ void ExoTestBase::SetUp() {
// Disable window animation when running tests.
command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled);
AshTestBase::SetUp();
wm_helper_ = std::make_unique<WMHelperAsh>();
wm_helper_ = std::make_unique<WMHelper>();
WMHelper::SetInstance(wm_helper_.get());
}
......
......@@ -91,6 +91,7 @@ source_set("wayland") {
"//ui/events:events_base",
"//ui/views",
"//ui/wm:wm",
"//ui/wm/public",
]
if (use_ozone) {
......
......@@ -19,7 +19,7 @@
#include "components/exo/display.h"
#include "components/exo/file_helper.h"
#include "components/exo/wayland/server.h"
#include "components/exo/wm_helper_ash.h"
#include "components/exo/wm_helper.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/wm/core/cursor_manager.h"
......@@ -141,7 +141,7 @@ void WaylandClientTest::SetUpOnUIThread(base::WaitableEvent* event) {
gesture_config->set_long_press_time_in_ms(1000);
gesture_config->set_max_touch_move_in_pixels_for_click(5);
wm_helper_ = base::MakeUnique<WMHelperAsh>();
wm_helper_ = base::MakeUnique<WMHelper>();
WMHelper::SetInstance(wm_helper_.get());
display_ = base::MakeUnique<Display>(nullptr, nullptr);
wayland_server_ = exo::wayland::Server::Create(display_.get());
......
......@@ -86,6 +86,7 @@
#include "ui/base/class_property.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_features.h"
#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/display/display_observer.h"
#include "ui/display/manager/managed_display_info.h"
#include "ui/display/screen.h"
......@@ -96,6 +97,7 @@
#include "ui/views/widget/widget_observer.h"
#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/window_animations.h"
#include "ui/wm/public/activation_change_observer.h"
#if defined(USE_OZONE)
#include <drm_fourcc.h>
......@@ -2083,8 +2085,8 @@ const struct zcr_notification_surface_v1_interface
// Implements remote shell interface and monitors workspace state needed
// for the remote shell interface.
class WaylandRemoteShell : public WMHelper::TabletModeObserver,
public WMHelper::ActivationObserver,
class WaylandRemoteShell : public ash::TabletModeObserver,
public wm::ActivationChangeObserver,
public display::DisplayObserver {
public:
WaylandRemoteShell(Display* display, wl_resource* remote_shell_resource)
......@@ -2165,7 +2167,7 @@ class WaylandRemoteShell : public WMHelper::TabletModeObserver,
}
}
// Overridden from WMHelper::TabletModeObserver:
// Overridden from ash::TabletModeObserver:
void OnTabletModeStarted() override {
layout_mode_ = ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET;
ScheduleSendDisplayMetrics(kConfigureDelayAfterLayoutSwitchMs);
......@@ -2176,8 +2178,9 @@ class WaylandRemoteShell : public WMHelper::TabletModeObserver,
}
void OnTabletModeEnded() override {}
// Overridden from WMHelper::ActivationObserver:
void OnWindowActivated(aura::Window* gained_active,
// Overridden from wm::ActivationChangeObserver:
void OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) override {
SendActivated(gained_active, lost_active);
}
......@@ -2551,7 +2554,7 @@ void bind_aura_shell(wl_client* client,
// vsync_timing_interface:
// Implements VSync timing interface by monitoring updates to VSync parameters.
class VSyncTiming final : public WMHelper::VSyncObserver {
class VSyncTiming final : public ui::CompositorVSyncManager::Observer {
public:
~VSyncTiming() override {
WMHelper::GetInstance()->RemoveVSyncObserver(this);
......@@ -2564,7 +2567,7 @@ class VSyncTiming final : public WMHelper::VSyncObserver {
return vsync_timing;
}
// Overridden from WMHelper::VSyncObserver:
// Overridden from ui::CompositorVSyncManager::Observer:
void OnUpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) override {
uint64_t timebase_us = timebase.ToInternalValue();
......
This diff is collapsed.
......@@ -5,13 +5,27 @@
#ifndef COMPONENTS_EXO_WM_HELPER_H_
#define COMPONENTS_EXO_WM_HELPER_H_
#include "ash/display/window_tree_host_manager.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "ui/aura/client/drag_drop_delegate.h"
#include "ui/base/cursor/cursor.h"
#include "ui/compositor/compositor_vsync_manager.h"
namespace ash {
class TabletModeObserver;
}
namespace aura {
class Window;
namespace client {
class CursorClientObserver;
class FocusChangeObserver;
} // namespace client
} // namespace aura
namespace wm {
class ActivationChangeObserver;
}
namespace display {
......@@ -22,6 +36,11 @@ class ManagedDisplayInfo;
namespace ui {
class EventHandler;
class DropTargetEvent;
class InputDeviceEventObserver;
} // namespace ui
namespace wm {
class ActivationChangeObserver;
}
namespace exo {
......@@ -29,60 +48,6 @@ namespace exo {
// A helper class for accessing WindowManager related features.
class WMHelper : public aura::client::DragDropDelegate {
public:
class ActivationObserver {
public:
virtual void OnWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) = 0;
protected:
virtual ~ActivationObserver() {}
};
class FocusObserver {
public:
virtual void OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) = 0;
protected:
virtual ~FocusObserver() {}
};
class CursorObserver {
public:
virtual void OnCursorVisibilityChanged(bool is_visible) {}
virtual void OnCursorSizeChanged(ui::CursorSize cursor_size) {}
virtual void OnCursorDisplayChanged(const display::Display& display) {}
protected:
virtual ~CursorObserver() {}
};
class TabletModeObserver {
public:
virtual void OnTabletModeStarted() = 0;
virtual void OnTabletModeEnding() = 0;
virtual void OnTabletModeEnded() = 0;
protected:
virtual ~TabletModeObserver() {}
};
class InputDeviceEventObserver {
public:
virtual void OnKeyboardDeviceConfigurationChanged() = 0;
protected:
virtual ~InputDeviceEventObserver() {}
};
class DisplayConfigurationObserver {
public:
virtual void OnDisplayConfigurationChanged() = 0;
protected:
virtual ~DisplayConfigurationObserver() {}
};
class DragDropObserver {
public:
virtual void OnDragEntered(const ui::DropTargetEvent& event) = 0;
......@@ -94,56 +59,49 @@ class WMHelper : public aura::client::DragDropDelegate {
virtual ~DragDropObserver() {}
};
class VSyncObserver {
public:
virtual void OnUpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) = 0;
protected:
virtual ~VSyncObserver() {}
};
WMHelper();
~WMHelper() override;
static void SetInstance(WMHelper* helper);
static WMHelper* GetInstance();
static bool HasInstance();
void AddActivationObserver(ActivationObserver* observer);
void RemoveActivationObserver(ActivationObserver* observer);
void AddFocusObserver(FocusObserver* observer);
void RemoveFocusObserver(FocusObserver* observer);
void AddCursorObserver(CursorObserver* observer);
void RemoveCursorObserver(CursorObserver* observer);
void AddTabletModeObserver(TabletModeObserver* observer);