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