Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: blimp/client/app/linux/blimp_display_manager.h

Issue 2363153002: Migrate Linux Blimp client to use BlimpClientContext (Closed)
Patch Set: Fix dependency issue found by gn check Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // |delegate|: The delegate to receive the OnClosed call.
40 BlimpDisplayManagerDelegate* delegate, 41 // |compositor_dependencies|: Set of compositor dependencies provided by the
41 RenderWidgetFeature* render_widget_feature, 42 // embedder.
42 TabControlFeature* tab_control_feature); 43 BlimpDisplayManager(BlimpDisplayManagerDelegate* delegate,
44 CompositorDependencies* compositor_dependencies);
43 ~BlimpDisplayManager() override; 45 ~BlimpDisplayManager() override;
44 46
45 // ui::PlatformWindowDelegate: 47 void SetWindowSize(const gfx::Size& window_size);
48 void SetBlimpContents(std::unique_ptr<BlimpContents> contents);
49
50 // ui::PlatformWindowDelegate implementation.
46 void OnBoundsChanged(const gfx::Rect& new_bounds) override; 51 void OnBoundsChanged(const gfx::Rect& new_bounds) override;
47 void OnDamageRect(const gfx::Rect& damaged_region) override {} 52 void OnDamageRect(const gfx::Rect& damaged_region) override {}
48 void DispatchEvent(ui::Event* event) override; 53 void DispatchEvent(ui::Event* event) override;
49 void OnCloseRequest() override; 54 void OnCloseRequest() override;
50 void OnClosed() override; 55 void OnClosed() override;
51 void OnWindowStateChanged(ui::PlatformWindowState new_state) override {} 56 void OnWindowStateChanged(ui::PlatformWindowState new_state) override {}
52 void OnLostCapture() override {} 57 void OnLostCapture() override {}
53 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, 58 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
54 float device_pixel_ratio) override; 59 float device_pixel_ratio) override;
55 void OnAcceleratedWidgetDestroyed() override; 60 void OnAcceleratedWidgetDestroyed() override;
(...skipping 12 matching lines...) Expand all
68 int pointer_id, 73 int pointer_id,
69 int pointer_x, 74 int pointer_x,
70 int pointer_y); 75 int pointer_y);
71 76
72 // Simulate a pinch/zoom touch event. 77 // Simulate a pinch/zoom touch event.
73 void Zoom(int pointer_x, int pointer_y, int y_offset, bool zoom_out); 78 void Zoom(int pointer_x, int pointer_y, int y_offset, bool zoom_out);
74 79
75 float device_pixel_ratio_; 80 float device_pixel_ratio_;
76 81
77 BlimpDisplayManagerDelegate* delegate_; 82 BlimpDisplayManagerDelegate* delegate_;
78 TabControlFeature* tab_control_feature_;
79 83
80 std::unique_ptr<BlimpCompositorDependencies> compositor_dependencies_;
81 std::unique_ptr<BlimpCompositorManager> compositor_manager_;
82 std::unique_ptr<BrowserCompositor> compositor_; 84 std::unique_ptr<BrowserCompositor> compositor_;
85 std::unique_ptr<BlimpContents> contents_;
86 std::unique_ptr<ui::PlatformEventSource> platform_event_source_;
83 std::unique_ptr<ui::PlatformWindow> platform_window_; 87 std::unique_ptr<ui::PlatformWindow> platform_window_;
84 88
85 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager); 89 DISALLOW_COPY_AND_ASSIGN(BlimpDisplayManager);
86 }; 90 };
87 91
88 } // namespace client 92 } // namespace client
89 } // namespace blimp 93 } // namespace blimp
90 94
91 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_ 95 #endif // BLIMP_CLIENT_APP_LINUX_BLIMP_DISPLAY_MANAGER_H_
OLDNEW
« no previous file with comments | « blimp/client/app/linux/blimp_client_context_delegate_linux.cc ('k') | blimp/client/app/linux/blimp_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698