Chromium Code Reviews| 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 "ui/events/event.h" | 11 #include "ui/events/event.h" |
| 12 #include "ui/events/gestures/motion_event_aura.h" | 12 #include "ui/events/gestures/motion_event_aura.h" |
| 13 #include "ui/platform_window/platform_window_delegate.h" | 13 #include "ui/platform_window/platform_window_delegate.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Size; | 16 class Size; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 class PlatformEventSource; | |
| 20 class PlatformWindow; | 21 class PlatformWindow; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace blimp { | 24 namespace blimp { |
| 24 namespace client { | 25 namespace client { |
| 25 | 26 |
| 26 class BlimpCompositorDependencies; | |
| 27 class BlimpCompositorManager; | |
| 28 class BrowserCompositor; | 27 class BrowserCompositor; |
| 29 class RenderWidgetFeature; | 28 class BlimpContents; |
| 30 class TabControlFeature; | 29 class CompositorDependencies; |
| 31 | 30 |
| 32 class BlimpDisplayManagerDelegate { | 31 class BlimpDisplayManagerDelegate { |
| 33 public: | 32 public: |
| 34 virtual void OnClosed() = 0; | 33 virtual void OnClosed() = 0; |
| 35 }; | 34 }; |
| 36 | 35 |
| 36 // Manages an X11 window that interacts with a Compositor by listening to the | |
| 37 // window's event handlers | |
| 37 class BlimpDisplayManager : public ui::PlatformWindowDelegate { | 38 class BlimpDisplayManager : public ui::PlatformWindowDelegate { |
| 38 public: | 39 public: |
| 39 BlimpDisplayManager(const gfx::Size& window_size, | 40 BlimpDisplayManager( |
|
Kevin M
2016/09/28 01:35:46
Document the parameters before the constructor dec
steimel
2016/09/28 20:33:07
Done.
| |
| 40 BlimpDisplayManagerDelegate* delegate, | 41 const gfx::Size& window_size, // size of X11 window |
| 41 RenderWidgetFeature* render_widget_feature, | 42 BlimpDisplayManagerDelegate* |
| 42 TabControlFeature* tab_control_feature); | 43 delegate, // delegate to receive OnClosed call |
| 44 CompositorDependencies* compositor_dependencies, // Set of compositor | |
| 45 // dependencies provided | |
| 46 // by the embedder | |
| 47 std::unique_ptr<BlimpContents> | |
| 48 contents); // Responsible for rendering web pages | |
| 43 ~BlimpDisplayManager() override; | 49 ~BlimpDisplayManager() override; |
| 44 | 50 |
| 45 // ui::PlatformWindowDelegate: | 51 // ui::PlatformWindowDelegate implementation. |
| 46 void OnBoundsChanged(const gfx::Rect& new_bounds) override; | 52 void OnBoundsChanged(const gfx::Rect& new_bounds) override; |
| 47 void OnDamageRect(const gfx::Rect& damaged_region) override {} | 53 void OnDamageRect(const gfx::Rect& damaged_region) override {} |
| 48 void DispatchEvent(ui::Event* event) override; | 54 void DispatchEvent(ui::Event* event) override; |
| 49 void OnCloseRequest() override; | 55 void OnCloseRequest() override; |
| 50 void OnClosed() override; | 56 void OnClosed() override; |
| 51 void OnWindowStateChanged(ui::PlatformWindowState new_state) override {} | 57 void OnWindowStateChanged(ui::PlatformWindowState new_state) override {} |
| 52 void OnLostCapture() override {} | 58 void OnLostCapture() override {} |
| 53 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 59 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
| 54 float device_pixel_ratio) override; | 60 float device_pixel_ratio) override; |
| 55 void OnAcceleratedWidgetDestroyed() override; | 61 void OnAcceleratedWidgetDestroyed() override; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 68 int pointer_id, | 74 int pointer_id, |
| 69 int pointer_x, | 75 int pointer_x, |
| 70 int pointer_y); | 76 int pointer_y); |
| 71 | 77 |
| 72 // Simulate a pinch/zoom touch event. | 78 // Simulate a pinch/zoom touch event. |
| 73 void Zoom(int pointer_x, int pointer_y, int y_offset, bool zoom_out); | 79 void Zoom(int pointer_x, int pointer_y, int y_offset, bool zoom_out); |
| 74 | 80 |
| 75 float device_pixel_ratio_; | 81 float device_pixel_ratio_; |
| 76 | 82 |
| 77 BlimpDisplayManagerDelegate* delegate_; | 83 BlimpDisplayManagerDelegate* delegate_; |
| 78 TabControlFeature* tab_control_feature_; | |
| 79 | 84 |
| 80 std::unique_ptr<BlimpCompositorDependencies> compositor_dependencies_; | |
| 81 std::unique_ptr<BlimpCompositorManager> compositor_manager_; | |
| 82 std::unique_ptr<BrowserCompositor> compositor_; | 85 std::unique_ptr<BrowserCompositor> compositor_; |
| 86 std::unique_ptr<BlimpContents> contents_; | |
| 87 std::unique_ptr<ui::PlatformEventSource> platform_event_source_; | |
| 83 std::unique_ptr<ui::PlatformWindow> platform_window_; | 88 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 84 | 89 |
| 85 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); | 90 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); |
| 86 }; | 91 }; |
| 87 | 92 |
| 88 } // namespace client | 93 } // namespace client |
| 89 } // namespace blimp | 94 } // namespace blimp |
| 90 | 95 |
| 91 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ | 96 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ |
| OLD | NEW |