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

Unified Diff: ash/mus/window_manager.cc

Issue 2626013005: Change CaptureSynchronizer and PointerWatcherEventRouter to support multiple CaptureClients. (Closed)
Patch Set: fix leak in test 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
« no previous file with comments | « no previous file | ui/aura/mus/capture_synchronizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index bcf577263f5dceae73476f445cf9f2d183c615f8..c0233919f382d46d17f9630b54832f46aaf14b50 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -41,6 +41,7 @@
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/aura/client/window_parenting_client.h"
#include "ui/aura/env.h"
+#include "ui/aura/mus/capture_synchronizer.h"
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/mus/window_tree_host_mus.h"
@@ -114,6 +115,13 @@ void WindowManager::Init(
std::move(frame_decoration_values));
lookup_.reset(new WmLookupMus);
+
+ // Notify PointerWatcherEventRouter and CaptureSynchronizer that the capture
+ // client has been set.
+ aura::client::CaptureClient* capture_client = wm_state_->capture_controller();
+ pointer_watcher_event_router_->AttachToCaptureClient(capture_client);
+ window_tree_client_->capture_synchronizer()->AttachToCaptureClient(
+ capture_client);
}
void WindowManager::DeleteAllRootWindowControllers() {
@@ -238,6 +246,11 @@ void WindowManager::Shutdown() {
if (!window_tree_client_)
return;
+ aura::client::CaptureClient* capture_client = wm_state_->capture_controller();
+ pointer_watcher_event_router_->DetachFromCaptureClient(capture_client);
+ window_tree_client_->capture_synchronizer()->DetachFromCaptureClient(
+ capture_client);
+
Shell::DeleteInstance();
lookup_.reset();
« no previous file with comments | « no previous file | ui/aura/mus/capture_synchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698