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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.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_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index 8e1907ae196bac1e9d9dc4d0e7d95223f5f14fb0..5f47308f01e267fc7ea7ec233ca69c992909aa5b 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -243,6 +243,24 @@ void WindowTreeClientImpl::SetBounds(Window* window,
tree_->SetWindowBounds(change_id, window->id(), mojo::Rect::From(bounds));
}
+void WindowTreeClientImpl::SetCapture(Window* window) {
+ // In order for us to get here we had to have exposed a window, which implies
+ // we got a connection.
+ DCHECK(tree_);
+ const uint32_t change_id = ScheduleInFlightChange(
+ make_scoped_ptr(new InFlightCaptureChange(window, false)));
sky 2016/02/03 21:59:00 false (and true on 260) should come from the captu
+ tree_->SetCapture(change_id, window->id());
+}
+
+void WindowTreeClientImpl::ReleaseCapture(Window* window) {
+ // In order for us to get here we had to have exposed a window, which implies
+ // we got a connection.
+ DCHECK(tree_);
+ const uint32_t change_id = ScheduleInFlightChange(
+ make_scoped_ptr(new InFlightCaptureChange(window, true)));
+ tree_->ReleaseCapture(change_id, window->id());
+}
+
void WindowTreeClientImpl::SetClientArea(
Id window_id,
const gfx::Insets& client_area,
@@ -554,6 +572,14 @@ void WindowTreeClientImpl::OnUnembed(Id window_id) {
WindowPrivate(window).LocalDestroy();
}
+void WindowTreeClientImpl::OnLostCapture(Id window_id) {
+ Window* window = GetWindowById(window_id);
+ if (window) {
sky 2016/02/03 21:59:00 This potentially needs to update the capture state
+ FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(),
+ OnWindowLostCapture(window));
+ }
+}
+
void WindowTreeClientImpl::OnTopLevelCreated(uint32_t change_id,
mojom::WindowDataPtr data) {
// The server ack'd the top level window we created and supplied the state

Powered by Google App Engine
This is Rietveld 408576698