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

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

Issue 2466023003: Makes CaptureController be created and owned by WMState (Closed)
Patch Set: moar Created 4 years, 1 month 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/views/test/views_test_helper_aura.cc ('k') | ui/wm/core/capture_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/capture_controller.h
diff --git a/ui/wm/core/capture_controller.h b/ui/wm/core/capture_controller.h
index 6c1ef145391a207576a552d8f168ff2b274fde4f..53481ab974aedb2f33b0a82dbf8b240ae186c3a3 100644
--- a/ui/wm/core/capture_controller.h
+++ b/ui/wm/core/capture_controller.h
@@ -24,6 +24,11 @@ namespace wm {
// Internal CaptureClient implementation. See ScopedCaptureClient for details.
class WM_EXPORT CaptureController : public aura::client::CaptureClient {
public:
+ CaptureController();
+ ~CaptureController() override;
+
+ static CaptureController* Get() { return instance_; }
+
// Adds |root| to the list of root windows notified when capture changes.
void Attach(aura::Window* root);
@@ -45,8 +50,7 @@ class WM_EXPORT CaptureController : public aura::client::CaptureClient {
private:
friend class ScopedCaptureClient;
- CaptureController();
- ~CaptureController() override;
+ static CaptureController* instance_;
// The current capture window. NULL if there is no capture window.
aura::Window* capture_window_;
@@ -88,13 +92,6 @@ class WM_EXPORT ScopedCaptureClient : public aura::WindowObserver {
explicit ScopedCaptureClient(aura::Window* root);
~ScopedCaptureClient() override;
- // Returns true if there is a CaptureController with at least one RootWindow.
- static bool IsActive();
-
- aura::client::CaptureClient* capture_client() {
- return capture_controller_;
- }
-
// Overridden from aura::WindowObserver:
void OnWindowDestroyed(aura::Window* window) override;
@@ -102,9 +99,6 @@ class WM_EXPORT ScopedCaptureClient : public aura::WindowObserver {
// Invoked from destructor and OnWindowDestroyed() to cleanup.
void Shutdown();
- // The single CaptureController instance.
- static CaptureController* capture_controller_;
-
// RootWindow this ScopedCaptureClient was create for.
aura::Window* root_window_;
« no previous file with comments | « ui/views/test/views_test_helper_aura.cc ('k') | ui/wm/core/capture_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698