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