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

Unified Diff: ui/aura/mus/capture_synchronizer.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/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) {

Powered by Google App Engine
This is Rietveld 408576698