| Index: ui/aura/mus/capture_synchronizer.cc
|
| diff --git a/ui/aura/mus/capture_synchronizer.cc b/ui/aura/mus/capture_synchronizer.cc
|
| index 67dacb4e9d5672b55204f2980242e71c5ca52f0f..3e8c974ca358dbf771eeed3f580c549108753e2a 100644
|
| --- a/ui/aura/mus/capture_synchronizer.cc
|
| +++ b/ui/aura/mus/capture_synchronizer.cc
|
| @@ -14,30 +14,26 @@
|
| namespace aura {
|
|
|
| CaptureSynchronizer::CaptureSynchronizer(CaptureSynchronizerDelegate* delegate,
|
| - ui::mojom::WindowTree* window_tree,
|
| - client::CaptureClient* capture_client)
|
| - : delegate_(delegate),
|
| - window_tree_(window_tree),
|
| - capture_client_(capture_client) {
|
| - capture_client_->AddObserver(this);
|
| -}
|
| + ui::mojom::WindowTree* window_tree)
|
| + : delegate_(delegate), window_tree_(window_tree) {}
|
|
|
| -CaptureSynchronizer::~CaptureSynchronizer() {
|
| - SetCaptureWindow(nullptr);
|
| - capture_client_->RemoveObserver(this);
|
| -}
|
| +CaptureSynchronizer::~CaptureSynchronizer() {}
|
|
|
| void CaptureSynchronizer::SetCaptureFromServer(WindowMus* window) {
|
| if (window == capture_window_)
|
| return;
|
|
|
| DCHECK(!setting_capture_);
|
| - // Don't immediately set |capture_client_|. It's possible the change will be
|
| + // Don't immediately set capture client. It's possible the change will be
|
| // rejected.
|
| base::AutoReset<bool> capture_reset(&setting_capture_, true);
|
| base::AutoReset<WindowMus*> window_setting_capture_to_reset(
|
| &window_setting_capture_to_, window);
|
| - capture_client_->SetCapture(window ? window->GetWindow() : nullptr);
|
| + client::CaptureClient* capture_client =
|
| + window ? client::GetCaptureClient(window->GetWindow()->GetRootWindow())
|
| + : client::GetCaptureClient(
|
| + capture_window_->GetWindow()->GetRootWindow());
|
| + capture_client->SetCapture(window ? window->GetWindow() : nullptr);
|
| }
|
|
|
| void CaptureSynchronizer::SetCaptureWindow(WindowMus* window) {
|
|
|