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

Unified Diff: ui/wm/core/capture_controller.cc

Issue 2436023003: Adds CaptureClientObserver as a way to track changes in capture (Closed)
Patch Set: fix comments Created 4 years, 2 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 | « ui/wm/core/capture_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/capture_controller.cc
diff --git a/ui/wm/core/capture_controller.cc b/ui/wm/core/capture_controller.cc
index b10cc1a76badcb279e15647d900877f8b1ad14b8..08238de931378184056d7b4e2184a40a227ee008 100644
--- a/ui/wm/core/capture_controller.cc
+++ b/ui/wm/core/capture_controller.cc
@@ -4,6 +4,7 @@
#include "ui/wm/core/capture_controller.h"
+#include "ui/aura/client/capture_client_observer.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tracker.h"
@@ -72,6 +73,9 @@ void CaptureController::SetCapture(aura::Window* new_capture_window) {
if (capture_delegate_)
capture_delegate_->SetNativeCapture();
}
+
+ for (aura::client::CaptureClientObserver& observer : observers_)
+ observer.OnCaptureChanged(old_capture_window, capture_window_);
}
void CaptureController::ReleaseCapture(aura::Window* window) {
@@ -88,6 +92,16 @@ aura::Window* CaptureController::GetGlobalCaptureWindow() {
return capture_window_;
}
+void CaptureController::AddObserver(
+ aura::client::CaptureClientObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void CaptureController::RemoveObserver(
+ aura::client::CaptureClientObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
////////////////////////////////////////////////////////////////////////////////
// CaptureController, private:
« no previous file with comments | « ui/wm/core/capture_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698