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

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

Issue 2626013005: Change CaptureSynchronizer and PointerWatcherEventRouter to support multiple CaptureClients. (Closed)
Patch Set: another approach to attach capture client 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 13660c96943379fbde45e8063fb00f656942a44e..78890be25da267c2e3e0cd9ddf4606e02dbfe49b 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -21,6 +21,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/mus/capture_synchronizer.h"
@@ -453,8 +454,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_);
}
@@ -464,9 +464,15 @@ void WindowTreeClient::OnConnectionLost() {
bool WindowTreeClient::HandleInternalPropertyChanged(WindowMus* window,
const void* key) {
- if (key != client::kModalKey)
+ if (key != client::kModalKey && key != client::kRootWindowCaptureClientKey)
return false;
+ if (key == client::kRootWindowCaptureClientKey) {
+ capture_synchronizer_->Attach(
+ client::GetCaptureClient(window->GetWindow()));
+ return true;
+ }
+
if (window->GetWindow()->GetProperty(client::kModalKey) ==
ui::MODAL_TYPE_NONE) {
// TODO: shouldn't early return, but explicitly tell server to turn off

Powered by Google App Engine
This is Rietveld 408576698