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

Unified Diff: components/mus/public/cpp/lib/window.cc

Issue 1605773004: mus: Implement Window Server Capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Create InFlightCaptureChange add tests Created 4 years, 11 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: 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) {

Powered by Google App Engine
This is Rietveld 408576698