| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ | 5 #ifndef CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ |
| 6 #define CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ | 6 #define CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chromecast/graphics/cast_vsync_settings.h" | |
| 12 #include "chromecast/graphics/cast_window_manager.h" | 11 #include "chromecast/graphics/cast_window_manager.h" |
| 13 #include "ui/aura/client/window_parenting_client.h" | 12 #include "ui/aura/client/window_parenting_client.h" |
| 14 | 13 |
| 15 namespace aura { | 14 namespace aura { |
| 16 namespace client { | 15 namespace client { |
| 17 class DefaultCaptureClient; | 16 class DefaultCaptureClient; |
| 18 } // namespace client | 17 } // namespace client |
| 19 } // namespace aura | 18 } // namespace aura |
| 20 | 19 |
| 21 namespace chromecast { | 20 namespace chromecast { |
| 22 | 21 |
| 23 class CastFocusClientAura; | 22 class CastFocusClientAura; |
| 24 class CastWindowTreeHost; | 23 class CastWindowTreeHost; |
| 25 | 24 |
| 26 class CastWindowManagerAura : public CastWindowManager, | 25 class CastWindowManagerAura : public CastWindowManager, |
| 27 public aura::client::WindowParentingClient, | 26 public aura::client::WindowParentingClient { |
| 28 private CastVSyncSettings::Observer { | |
| 29 public: | 27 public: |
| 30 ~CastWindowManagerAura() override; | 28 ~CastWindowManagerAura() override; |
| 31 | 29 |
| 32 // CastWindowManager implementation: | 30 // CastWindowManager implementation: |
| 33 void TearDown() override; | 31 void TearDown() override; |
| 34 void AddWindow(gfx::NativeView window) override; | 32 void AddWindow(gfx::NativeView window) override; |
| 35 gfx::NativeView GetRootWindow() override; | 33 gfx::NativeView GetRootWindow() override; |
| 36 void SetWindowId(gfx::NativeView window, WindowId window_id) override; | 34 void SetWindowId(gfx::NativeView window, WindowId window_id) override; |
| 37 | 35 |
| 38 // aura::client::WindowParentingClient implementation: | 36 // aura::client::WindowParentingClient implementation: |
| 39 aura::Window* GetDefaultParent(aura::Window* window, | 37 aura::Window* GetDefaultParent(aura::Window* window, |
| 40 const gfx::Rect& bounds) override; | 38 const gfx::Rect& bounds) override; |
| 41 | 39 |
| 42 private: | 40 private: |
| 43 friend class CastWindowManager; | 41 friend class CastWindowManager; |
| 44 | 42 |
| 45 // This class should only be instantiated by CastWindowManager::Create. | 43 // This class should only be instantiated by CastWindowManager::Create. |
| 46 explicit CastWindowManagerAura(bool enable_input); | 44 explicit CastWindowManagerAura(bool enable_input); |
| 47 | 45 |
| 48 // CastVSyncSettings::Observer implementation: | |
| 49 void OnVSyncIntervalChanged(base::TimeDelta interval) override; | |
| 50 | |
| 51 void Setup(); | 46 void Setup(); |
| 52 | 47 |
| 53 const bool enable_input_; | 48 const bool enable_input_; |
| 54 std::unique_ptr<CastWindowTreeHost> window_tree_host_; | 49 std::unique_ptr<CastWindowTreeHost> window_tree_host_; |
| 55 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; | 50 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| 56 std::unique_ptr<CastFocusClientAura> focus_client_; | 51 std::unique_ptr<CastFocusClientAura> focus_client_; |
| 57 | 52 |
| 58 DISALLOW_COPY_AND_ASSIGN(CastWindowManagerAura); | 53 DISALLOW_COPY_AND_ASSIGN(CastWindowManagerAura); |
| 59 }; | 54 }; |
| 60 | 55 |
| 61 } // namespace chromecast | 56 } // namespace chromecast |
| 62 | 57 |
| 63 #endif // CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ | 58 #endif // CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_AURA_H_ |
| OLD | NEW |