| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "ui/aura/client/capture_client.h" | 12 #include "ui/aura/client/capture_client.h" |
| 13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
| 14 #include "ui/wm/wm_export.h" | 14 #include "ui/wm/wm_export.h" |
| 15 | 15 |
| 16 namespace aura { |
| 17 namespace client { |
| 18 class CaptureDelegate; |
| 19 } |
| 20 } |
| 21 |
| 16 namespace wm { | 22 namespace wm { |
| 17 | 23 |
| 18 // Internal CaptureClient implementation. See ScopedCaptureClient for details. | 24 // Internal CaptureClient implementation. See ScopedCaptureClient for details. |
| 19 class WM_EXPORT CaptureController : public aura::client::CaptureClient { | 25 class WM_EXPORT CaptureController : public aura::client::CaptureClient { |
| 20 public: | 26 public: |
| 21 // Adds |root| to the list of RootWindows notified when capture changes. | 27 // Adds |root| to the list of RootWindows notified when capture changes. |
| 22 void Attach(aura::Window* root); | 28 void Attach(aura::Window* root); |
| 23 | 29 |
| 24 // Removes |root| from the list of RootWindows notified when capture changes. | 30 // Removes |root| from the list of RootWindows notified when capture changes. |
| 25 void Detach(aura::Window* root); | 31 void Detach(aura::Window* root); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 37 private: | 43 private: |
| 38 friend class ScopedCaptureClient; | 44 friend class ScopedCaptureClient; |
| 39 typedef std::set<aura::Window*> RootWindows; | 45 typedef std::set<aura::Window*> RootWindows; |
| 40 | 46 |
| 41 CaptureController(); | 47 CaptureController(); |
| 42 ~CaptureController() override; | 48 ~CaptureController() override; |
| 43 | 49 |
| 44 // The current capture window. NULL if there is no capture window. | 50 // The current capture window. NULL if there is no capture window. |
| 45 aura::Window* capture_window_; | 51 aura::Window* capture_window_; |
| 46 | 52 |
| 53 // The capture delegate with native capture. |
| 54 aura::client::CaptureDelegate* capture_delegate_; |
| 55 |
| 47 // Set of RootWindows notified when capture changes. | 56 // Set of RootWindows notified when capture changes. |
| 48 RootWindows root_windows_; | 57 RootWindows root_windows_; |
| 49 | 58 |
| 50 DISALLOW_COPY_AND_ASSIGN(CaptureController); | 59 DISALLOW_COPY_AND_ASSIGN(CaptureController); |
| 51 }; | 60 }; |
| 52 | 61 |
| 53 // ScopedCaptureClient is responsible for creating a CaptureClient for a | 62 // ScopedCaptureClient is responsible for creating a CaptureClient for a |
| 54 // RootWindow. Specifically it creates a single CaptureController that is shared | 63 // RootWindow. Specifically it creates a single CaptureController that is shared |
| 55 // among all ScopedCaptureClients and adds the RootWindow to it. | 64 // among all ScopedCaptureClients and adds the RootWindow to it. |
| 56 class WM_EXPORT ScopedCaptureClient : public aura::WindowObserver { | 65 class WM_EXPORT ScopedCaptureClient : public aura::WindowObserver { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 77 | 86 |
| 78 // RootWindow this ScopedCaptureClient was create for. | 87 // RootWindow this ScopedCaptureClient was create for. |
| 79 aura::Window* root_window_; | 88 aura::Window* root_window_; |
| 80 | 89 |
| 81 DISALLOW_COPY_AND_ASSIGN(ScopedCaptureClient); | 90 DISALLOW_COPY_AND_ASSIGN(ScopedCaptureClient); |
| 82 }; | 91 }; |
| 83 | 92 |
| 84 } // namespace wm | 93 } // namespace wm |
| 85 | 94 |
| 86 #endif // UI_WM_CORE_CAPTURE_CONTROLLER_H_ | 95 #endif // UI_WM_CORE_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |