| 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; |
| 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 | |
| 60 float device_pixel_ratio_; | 55 float device_pixel_ratio_; |
| 61 | 56 |
| 62 BlimpDisplayManagerDelegate* delegate_; | 57 BlimpDisplayManagerDelegate* delegate_; |
| 63 TabControlFeature* tab_control_feature_; | 58 TabControlFeature* tab_control_feature_; |
| 64 | 59 |
| 65 std::unique_ptr<BlimpCompositorManager> blimp_compositor_manager_; | 60 std::unique_ptr<BlimpCompositorManager> blimp_compositor_manager_; |
| 66 std::unique_ptr<ui::PlatformWindow> platform_window_; | 61 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 67 | 62 |
| 68 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); | 63 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); |
| 69 }; | 64 }; |
| 70 | 65 |
| 71 } // namespace client | 66 } // namespace client |
| 72 } // namespace blimp | 67 } // namespace blimp |
| 73 | 68 |
| 74 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ | 69 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ |
| OLD | NEW |