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

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: rebase 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
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b1d9196b371ac579e6236299175c1ace1fa76ad6 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,14 +59,23 @@ 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;
+ // Returns true if there is one or more pointer watchers for this client.
+ bool HasPointerWatcher();
+
// 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 +84,8 @@ class VIEWS_MUS_EXPORT WindowManagerConnection
shell::Identity identity_;
std::unique_ptr<ScreenMus> screen_;
std::unique_ptr<mus::WindowTreeConnection> window_tree_connection_;
+ // Must be empty on destruction.
+ base::ObserverList<PointerWatcher, true> pointer_watchers_;
DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection);
};
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698