Chromium Code Reviews| 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); |
| } |