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

Unified Diff: components/mus/ws/window_tree_host_impl.h

Issue 1677513002: mus Window Server: implement event capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « components/mus/ws/window_tree_apptest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree_host_impl.h
diff --git a/components/mus/ws/window_tree_host_impl.h b/components/mus/ws/window_tree_host_impl.h
index e4e2bc21062d6456c4ac25dfffb33db5d9af2e5d..cace4be965d70d0899e945ff2506ed13ec849723 100644
--- a/components/mus/ws/window_tree_host_impl.h
+++ b/components/mus/ws/window_tree_host_impl.h
@@ -95,6 +95,8 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
ServerWindow* root_window() { return root_.get(); }
const ServerWindow* root_window() const { return root_.get(); }
+ void SetCapture(ServerWindow* window, bool in_nonclient_area);
+
void SetFocusedWindow(ServerWindow* window);
ServerWindow* GetFocusedWindow();
void DestroyFocusController();
@@ -107,6 +109,14 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
const ui::TextInputState& state);
void SetImeVisibility(ServerWindow* window, bool visible);
+ // Returns the window that has captured input.
+ ServerWindow* GetCaptureWindow() {
+ return event_dispatcher_.capture_window();
+ }
+ const ServerWindow* GetCaptureWindow() const {
+ return event_dispatcher_.capture_window();
+ }
+
// Called just before |tree| is destroyed after its connection encounters an
// error.
void OnWindowTreeConnectionError(WindowTreeImpl* tree);
@@ -167,6 +177,7 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
// DisplayManagerDelegate:
ServerWindow* GetRootWindow() override;
void OnEvent(const ui::Event& event) override;
+ void OnNativeCaptureLost() override;
void OnDisplayClosed() override;
void OnViewportMetricsChanged(
const mojom::ViewportMetrics& old_metrics,
@@ -188,6 +199,9 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
ServerWindow* GetFocusedWindowForEventDispatcher() override;
+ void SetNativeCapture() override;
+ void ReleaseNativeCapture() override;
+ void OnServerWindowCaptureLost(ServerWindow* window) override;
void DispatchInputEventToWindow(ServerWindow* target,
bool in_nonclient_area,
mojom::EventPtr event) override;
« no previous file with comments | « components/mus/ws/window_tree_apptest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698