| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_WM_CORE_CAPTURE_CONTROLLER_H_ | 5 #ifndef UI_WM_CORE_CAPTURE_CONTROLLER_H_ |
| 6 #define UI_WM_CORE_CAPTURE_CONTROLLER_H_ | 6 #define UI_WM_CORE_CAPTURE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 void Attach(aura::Window* root); | 22 void Attach(aura::Window* root); |
| 23 | 23 |
| 24 // Removes |root| from the list of RootWindows notified when capture changes. | 24 // Removes |root| from the list of RootWindows notified when capture changes. |
| 25 void Detach(aura::Window* root); | 25 void Detach(aura::Window* root); |
| 26 | 26 |
| 27 // Returns true if this CaptureController is installed on at least one | 27 // Returns true if this CaptureController is installed on at least one |
| 28 // RootWindow. | 28 // RootWindow. |
| 29 bool is_active() const { return !root_windows_.empty(); } | 29 bool is_active() const { return !root_windows_.empty(); } |
| 30 | 30 |
| 31 // Overridden from aura::client::CaptureClient: | 31 // Overridden from aura::client::CaptureClient: |
| 32 virtual void SetCapture(aura::Window* window) OVERRIDE; | 32 virtual void SetCapture(aura::Window* window) override; |
| 33 virtual void ReleaseCapture(aura::Window* window) OVERRIDE; | 33 virtual void ReleaseCapture(aura::Window* window) override; |
| 34 virtual aura::Window* GetCaptureWindow() OVERRIDE; | 34 virtual aura::Window* GetCaptureWindow() override; |
| 35 virtual aura::Window* GetGlobalCaptureWindow() OVERRIDE; | 35 virtual aura::Window* GetGlobalCaptureWindow() override; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 friend class ScopedCaptureClient; | 38 friend class ScopedCaptureClient; |
| 39 typedef std::set<aura::Window*> RootWindows; | 39 typedef std::set<aura::Window*> RootWindows; |
| 40 | 40 |
| 41 CaptureController(); | 41 CaptureController(); |
| 42 virtual ~CaptureController(); | 42 virtual ~CaptureController(); |
| 43 | 43 |
| 44 // The current capture window. NULL if there is no capture window. | 44 // The current capture window. NULL if there is no capture window. |
| 45 aura::Window* capture_window_; | 45 aura::Window* capture_window_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 59 virtual ~ScopedCaptureClient(); | 59 virtual ~ScopedCaptureClient(); |
| 60 | 60 |
| 61 // Returns true if there is a CaptureController with at least one RootWindow. | 61 // Returns true if there is a CaptureController with at least one RootWindow. |
| 62 static bool IsActive(); | 62 static bool IsActive(); |
| 63 | 63 |
| 64 aura::client::CaptureClient* capture_client() { | 64 aura::client::CaptureClient* capture_client() { |
| 65 return capture_controller_; | 65 return capture_controller_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Overridden from aura::WindowObserver: | 68 // Overridden from aura::WindowObserver: |
| 69 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 69 virtual void OnWindowDestroyed(aura::Window* window) override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Invoked from destructor and OnWindowDestroyed() to cleanup. | 72 // Invoked from destructor and OnWindowDestroyed() to cleanup. |
| 73 void Shutdown(); | 73 void Shutdown(); |
| 74 | 74 |
| 75 // The single CaptureController instance. | 75 // The single CaptureController instance. |
| 76 static CaptureController* capture_controller_; | 76 static CaptureController* capture_controller_; |
| 77 | 77 |
| 78 // RootWindow this ScopedCaptureClient was create for. | 78 // RootWindow this ScopedCaptureClient was create for. |
| 79 aura::Window* root_window_; | 79 aura::Window* root_window_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(ScopedCaptureClient); | 81 DISALLOW_COPY_AND_ASSIGN(ScopedCaptureClient); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace wm | 84 } // namespace wm |
| 85 | 85 |
| 86 #endif // UI_WM_CORE_CAPTURE_CONTROLLER_H_ | 86 #endif // UI_WM_CORE_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |