Index: components/mus/public/cpp/lib/window.cc |
diff --git a/components/mus/public/cpp/lib/window.cc b/components/mus/public/cpp/lib/window.cc |
index ba6b77f77b740ee006a6744c0793f51e4d2d33eb..289a2cbdceacbc77ddfd86c58aa1422c83d10f82 100644 |
--- a/components/mus/public/cpp/lib/window.cc |
+++ b/components/mus/public/cpp/lib/window.cc |
@@ -373,6 +373,18 @@ void Window::SetImeVisibility(bool visible, mojo::TextInputStatePtr state) { |
tree_client()->SetImeVisibility(id_, visible, std::move(state)); |
} |
+void Window::SetCapture() { |
+ if (connection_) |
+ tree_client()->SetCapture(this); |
+ LocalSetCapture(true); |
+} |
+ |
+void Window::ReleaseCapture() { |
+ if (connection_) |
+ tree_client()->ReleaseCapture(this); |
+ LocalSetCapture(false); |
+} |
+ |
void Window::SetFocus() { |
if (connection_ && IsDrawn()) |
tree_client()->SetFocus(this); |
@@ -483,6 +495,7 @@ Window::Window(WindowTreeConnection* connection, Id id) |
input_event_handler_(nullptr), |
viewport_metrics_(CreateEmptyViewportMetrics()), |
visible_(false), |
+ has_capture_(false), |
cursor_id_(mojom::Cursor::CURSOR_NULL), |
drawn_(false) {} |
@@ -589,6 +602,10 @@ void Window::LocalSetBounds(const gfx::Rect& old_bounds, |
bounds_ = new_bounds; |
} |
+void Window::LocalSetCapture(bool capture) { |
+ has_capture_ = capture; |
+} |
+ |
void Window::LocalSetClientArea( |
const gfx::Insets& new_client_area, |
const std::vector<gfx::Rect>& additional_client_areas) { |