Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: ui/views/mus/window_manager_connection.h

Issue 1921673005: mus: Add PointerWatcher for passively observing mouse and touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/mus/window_manager_connection.h
diff --git a/ui/views/mus/window_manager_connection.h b/ui/views/mus/window_manager_connection.h
index 90fd9f70b021353d702456eee8d01914628536bd..c8c804818926bd0b520941c1edee4415e942c8fe 100644
--- a/ui/views/mus/window_manager_connection.h
+++ b/ui/views/mus/window_manager_connection.h
@@ -10,6 +10,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/observer_list.h"
#include "components/mus/public/cpp/window_tree_delegate.h"
#include "services/shell/public/cpp/identity.h"
#include "ui/views/mus/mus_export.h"
@@ -22,6 +23,7 @@ class Connector;
namespace views {
class NativeWidget;
+class PointerWatcher;
class ScreenMus;
namespace internal {
class NativeWidgetDelegate;
@@ -57,7 +59,12 @@ class VIEWS_MUS_EXPORT WindowManagerConnection
const Widget::InitParams& init_params,
internal::NativeWidgetDelegate* delegate);
+ void AddPointerWatcher(PointerWatcher* watcher);
+ void RemovePointerWatcher(PointerWatcher* watcher);
+
private:
+ friend class WindowManagerConnectionTest;
+
WindowManagerConnection(shell::Connector* connector,
const shell::Identity& identity);
~WindowManagerConnection() override;
@@ -65,6 +72,7 @@ class VIEWS_MUS_EXPORT WindowManagerConnection
// mus::WindowTreeDelegate:
void OnEmbed(mus::Window* root) override;
void OnConnectionLost(mus::WindowTreeConnection* connection) override;
+ void OnEventObserved(const ui::Event& event) override;
// ScreenMusDelegate:
void OnWindowManagerFrameValuesChanged() override;
@@ -73,6 +81,7 @@ class VIEWS_MUS_EXPORT WindowManagerConnection
shell::Identity identity_;
std::unique_ptr<ScreenMus> screen_;
std::unique_ptr<mus::WindowTreeConnection> window_tree_connection_;
+ base::ObserverList<PointerWatcher> pointer_watchers_;
DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection);
};

Powered by Google App Engine
This is Rietveld 408576698