Commit 3581c0a9 authored by Ryan Daum's avatar Ryan Daum Committed by Commit Bot

Pull cast system gesture methods up to base window manager interface.

Background: Implementation of the side swipe system gesture handling
is present only in the CastWindowManagerAura implementation, but
actual users will only have a handle to the base CastWindowManager
interface. This CL pulls the methods up to the interface and leaves
them as stubs in the CastWindowManagerDefault.

Bug: b/71541742
Tested: Manual testing
Change-Id: Ib83e42b046153a0e680f8d76eda6d9c0e7bb655d
Reviewed-on: https://chromium-review.googlesource.com/891478Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Ryan Daum <rdaum@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532575}
parent 5617cbef
...@@ -16,6 +16,8 @@ class Event; ...@@ -16,6 +16,8 @@ class Event;
namespace chromecast { namespace chromecast {
class CastSideSwipeGestureHandlerInterface;
// Chromecast's window-manager interface. // Chromecast's window-manager interface.
// This declares the interface to add top-level windows to the Chromecast // This declares the interface to add top-level windows to the Chromecast
// platform window. It is owned by the UI thread, and generally one instance // platform window. It is owned by the UI thread, and generally one instance
...@@ -57,6 +59,14 @@ class CastWindowManager { ...@@ -57,6 +59,14 @@ class CastWindowManager {
// Inject a UI event into the Cast window. // Inject a UI event into the Cast window.
virtual void InjectEvent(ui::Event* event) = 0; virtual void InjectEvent(ui::Event* event) = 0;
// Register a new handler for a system side swipe event.
virtual void AddSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler) = 0;
// Remove the registration of a system side swipe event handler.
virtual void RemoveSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler) = 0;
}; };
} // namespace chromecast } // namespace chromecast
......
...@@ -21,7 +21,6 @@ class ScreenPositionClient; ...@@ -21,7 +21,6 @@ class ScreenPositionClient;
namespace chromecast { namespace chromecast {
class CastFocusClientAura; class CastFocusClientAura;
class CastSideSwipeGestureHandlerInterface;
class CastSystemGestureEventHandler; class CastSystemGestureEventHandler;
class CastWindowTreeHost; class CastWindowTreeHost;
...@@ -41,13 +40,11 @@ class CastWindowManagerAura : public CastWindowManager, ...@@ -41,13 +40,11 @@ class CastWindowManagerAura : public CastWindowManager,
aura::Window* GetDefaultParent(aura::Window* window, aura::Window* GetDefaultParent(aura::Window* window,
const gfx::Rect& bounds) override; const gfx::Rect& bounds) override;
// Register a new handler for a system side swipe event.
void AddSideSwipeGestureHandler( void AddSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler); CastSideSwipeGestureHandlerInterface* handler) override;
// Remove the registration of a system side swipe event handler.
void RemoveSideSwipeGestureHandler( void RemoveSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler); CastSideSwipeGestureHandlerInterface* handler) override;
private: private:
friend class CastWindowManager; friend class CastWindowManager;
......
...@@ -27,4 +27,12 @@ gfx::NativeView CastWindowManagerDefault::GetRootWindow() { ...@@ -27,4 +27,12 @@ gfx::NativeView CastWindowManagerDefault::GetRootWindow() {
return nullptr; return nullptr;
} }
void CastWindowManagerDefault::AddSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler) {}
// Remove the registration of a system side swipe event handler.
void CastWindowManagerDefault::CastWindowManagerDefault::
RemoveSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler) {}
} // namespace chromecast } // namespace chromecast
...@@ -23,6 +23,12 @@ class CastWindowManagerDefault : public CastWindowManager { ...@@ -23,6 +23,12 @@ class CastWindowManagerDefault : public CastWindowManager {
gfx::NativeView GetRootWindow() override; gfx::NativeView GetRootWindow() override;
void InjectEvent(ui::Event* event) override; void InjectEvent(ui::Event* event) override;
void AddSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler) override;
void RemoveSideSwipeGestureHandler(
CastSideSwipeGestureHandlerInterface* handler) override;
private: private:
friend class CastWindowManager; friend class CastWindowManager;
......
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