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

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

Issue 1352043005: mus: Implement Window Server Capture Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added capture unit tests Created 5 years, 1 month 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: 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 dd7f00323b892af5e366adb9bc9fd53092f7137c..d3d1b758a216cfe3e401261e96c21cd1869670e8 100644
--- a/components/mus/ws/window_tree_host_impl.h
+++ b/components/mus/ws/window_tree_host_impl.h
@@ -80,6 +80,9 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
ServerWindow* root_window() { return root_.get(); }
const ServerWindow* root_window() const { return root_.get(); }
+ void SetCapture(ServerWindow* window);
+ void ReleaseCapture(ServerWindow* window);
+
void SetFocusedWindow(ServerWindow* window);
ServerWindow* GetFocusedWindow();
void DestroyFocusController();
@@ -88,6 +91,13 @@ 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();
+ }
// WindowTreeHost:
void SetSize(mojo::SizePtr size) override;
void SetTitle(const mojo::String& title) override;
@@ -101,6 +111,7 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
// DisplayManagerDelegate:
ServerWindow* GetRootWindow() override;
void OnEvent(mojom::EventPtr event) override;
+ void OnLostCapture() override;
void OnDisplayClosed() override;
void OnViewportMetricsChanged(
const mojom::ViewportMetrics& old_metrics,
@@ -116,6 +127,7 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
ServerWindow* GetFocusedWindowForEventDispatcher() override;
+ void OnLostCapture(ServerWindow* window) override;
void DispatchInputEventToWindow(ServerWindow* target,
bool in_nonclient_area,
mojom::EventPtr event) override;

Powered by Google App Engine
This is Rietveld 408576698