OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ | 5 #ifndef BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ |
6 #define BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ | 6 #define BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "blimp/client/feature/compositor/blimp_compositor_manager.h" | 11 #include "blimp/client/core/contents/blimp_contents_manager.h" |
12 #include "ui/platform_window/platform_window_delegate.h" | 12 #include "ui/platform_window/platform_window_delegate.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Size; | 15 class Size; |
16 } | 16 } |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 class PlatformWindow; | 19 class PlatformWindow; |
20 } | 20 } |
21 | 21 |
22 namespace blimp { | 22 namespace blimp { |
23 namespace client { | 23 namespace client { |
24 | 24 class BlimpContentsImpl; |
25 class BlimpCompositorManager; | |
26 class RenderWidgetFeature; | 25 class RenderWidgetFeature; |
27 class TabControlFeature; | 26 class TabControlFeature; |
28 | 27 |
29 class BlimpDisplayManagerDelegate { | 28 class BlimpDisplayManagerDelegate { |
30 public: | 29 public: |
31 virtual void OnClosed() = 0; | 30 virtual void OnClosed() = 0; |
32 }; | 31 }; |
33 | 32 |
34 class BlimpDisplayManager : public ui::PlatformWindowDelegate, | 33 class BlimpDisplayManager : public ui::PlatformWindowDelegate { |
35 BlimpCompositorManagerClient { | |
36 public: | 34 public: |
37 BlimpDisplayManager(const gfx::Size& window_size, | 35 BlimpDisplayManager(const gfx::Size& window_size, |
38 BlimpDisplayManagerDelegate* delegate, | 36 BlimpDisplayManagerDelegate* delegate, |
39 RenderWidgetFeature* render_widget_feature, | 37 RenderWidgetFeature* render_widget_feature, |
40 TabControlFeature* tab_control_feature); | 38 TabControlFeature* tab_control_feature); |
41 ~BlimpDisplayManager() override; | 39 ~BlimpDisplayManager() override; |
42 | 40 |
43 // ui::PlatformWindowDelegate: | 41 // ui::PlatformWindowDelegate: |
44 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 42 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
45 void OnDamageRect(const gfx::Rect& damaged_region) override; | 43 void OnDamageRect(const gfx::Rect& damaged_region) override; |
46 void DispatchEvent(ui::Event* event) override; | 44 void DispatchEvent(ui::Event* event) override; |
47 void OnCloseRequest() override; | 45 void OnCloseRequest() override; |
48 void OnClosed() override; | 46 void OnClosed() override; |
49 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 47 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
50 void OnLostCapture() override; | 48 void OnLostCapture() override; |
51 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 49 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
52 float device_pixel_ratio) override; | 50 float device_pixel_ratio) override; |
53 void OnAcceleratedWidgetDestroyed() override; | 51 void OnAcceleratedWidgetDestroyed() override; |
54 void OnActivationChanged(bool active) override; | 52 void OnActivationChanged(bool active) override; |
55 | 53 |
56 private: | 54 private: |
57 // BlimpCompositorManagerClient implementation. | |
58 void OnSwapBuffersCompleted() override; | |
59 void DidCommitAndDrawFrame() override; | |
60 | |
61 float device_pixel_ratio_; | 55 float device_pixel_ratio_; |
62 | 56 |
63 BlimpDisplayManagerDelegate* delegate_; | 57 BlimpDisplayManagerDelegate* delegate_; |
64 TabControlFeature* tab_control_feature_; | 58 TabControlFeature* tab_control_feature_; |
65 | 59 |
66 std::unique_ptr<BlimpCompositorManager> blimp_compositor_manager_; | 60 BlimpContentsManager blimp_contents_manager_; |
| 61 std::unique_ptr<BlimpContentsImpl> blimp_contents_; |
67 std::unique_ptr<ui::PlatformWindow> platform_window_; | 62 std::unique_ptr<ui::PlatformWindow> platform_window_; |
68 | 63 |
69 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); | 64 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); |
70 }; | 65 }; |
71 | 66 |
72 } // namespace client | 67 } // namespace client |
73 } // namespace blimp | 68 } // namespace blimp |
74 | 69 |
75 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ | 70 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ |
OLD | NEW |