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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2626013005: Change CaptureSynchronizer and PointerWatcherEventRouter to support multiple CaptureClients. (Closed)
Patch Set: separate out changes for removing GetCaptureClient() Created 3 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: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index 743f1a08ac47ea684516d8dce76b1a5e57924d75..00012d247c442238ebfb4f8e21c1e073b29fdb1b 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -22,6 +22,7 @@
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/client/transient_window_client.h"
#include "ui/aura/env.h"
@@ -467,8 +468,7 @@ void WindowTreeClient::WindowTreeConnectionEstablished(
tree_ = window_tree;
drag_drop_controller_ = base::MakeUnique<DragDropControllerMus>(this, tree_);
- capture_synchronizer_ =
- base::MakeUnique<CaptureSynchronizer>(this, tree_, GetCaptureClient());
+ capture_synchronizer_ = base::MakeUnique<CaptureSynchronizer>(this, tree_);
focus_synchronizer_ = base::MakeUnique<FocusSynchronizer>(this, tree_);
}
@@ -829,6 +829,17 @@ void WindowTreeClient::CancelWindowMove(Window* window) {
tree_->CancelWindowMove(WindowMus::Get(window)->server_id());
}
+void WindowTreeClient::OnCaptureClientSet(
+ client::CaptureClient* capture_client) {
+ capture_client->AddObserver(capture_synchronizer_.get());
+}
+
+void WindowTreeClient::OnCaptureClientUnset(
+ client::CaptureClient* capture_client) {
+ capture_synchronizer_->SetCaptureWindow(nullptr);
+ capture_client->RemoveObserver(capture_synchronizer_.get());
sadrul 2017/01/27 01:06:53 Can this be replaced by adding functions on Captur
+}
+
void WindowTreeClient::AddObserver(WindowTreeClientObserver* observer) {
observers_.AddObserver(observer);
}

Powered by Google App Engine
This is Rietveld 408576698