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

Side by Side Diff: services/ui/ws/platform_display_default.h

Issue 2916823002: Move Mus into chrome's process when running with --mus.
Patch Set: Addressing most feedback, making this work on device. Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "services/ui/display/viewport_metrics.h" 11 #include "services/ui/display/viewport_metrics.h"
12 #include "services/ui/ws/frame_generator.h" 12 #include "services/ui/ws/frame_generator.h"
13 #include "services/ui/ws/platform_display.h" 13 #include "services/ui/ws/platform_display.h"
14 #include "services/ui/ws/platform_display_delegate.h" 14 #include "services/ui/ws/platform_display_delegate.h"
15 #include "services/ui/ws/server_window.h" 15 #include "services/ui/ws/server_window.h"
16 #include "ui/platform_window/platform_window_delegate.h" 16 #include "ui/platform_window/platform_window_delegate.h"
17 17
18 namespace ui { 18 namespace ui {
19 19
20 class EventSink; 20 class EventSink;
21 class ImageCursors;
22 class PlatformWindow; 21 class PlatformWindow;
23 22
24 namespace ws { 23 namespace ws {
25 24
25 class ThreadedImageCursors;
26
26 // PlatformDisplay implementation that connects to a PlatformWindow and 27 // PlatformDisplay implementation that connects to a PlatformWindow and
27 // FrameGenerator for Chrome OS. 28 // FrameGenerator for Chrome OS.
28 class PlatformDisplayDefault : public PlatformDisplay, 29 class PlatformDisplayDefault : public PlatformDisplay,
29 public ui::PlatformWindowDelegate { 30 public ui::PlatformWindowDelegate {
30 public: 31 public:
31 // |image_cursors| may be null, for example on Android or in tests. 32 // |image_cursors| may be null, for example on Android or in tests.
32 PlatformDisplayDefault(ServerWindow* root_window, 33 PlatformDisplayDefault(ServerWindow* root_window,
33 const display::ViewportMetrics& metrics, 34 const display::ViewportMetrics& metrics,
34 std::unique_ptr<ImageCursors> image_cursors); 35 std::unique_ptr<ThreadedImageCursors> image_cursors);
35 ~PlatformDisplayDefault() override; 36 ~PlatformDisplayDefault() override;
36 37
37 // EventSource:: 38 // EventSource::
38 EventSink* GetEventSink() override; 39 EventSink* GetEventSink() override;
39 40
40 // PlatformDisplay: 41 // PlatformDisplay:
41 void Init(PlatformDisplayDelegate* delegate) override; 42 void Init(PlatformDisplayDelegate* delegate) override;
42 void SetViewportSize(const gfx::Size& size) override; 43 void SetViewportSize(const gfx::Size& size) override;
43 void SetTitle(const base::string16& title) override; 44 void SetTitle(const base::string16& title) override;
44 void SetCapture() override; 45 void SetCapture() override;
(...skipping 15 matching lines...) Expand all
60 void OnClosed() override; 61 void OnClosed() override;
61 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; 62 void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
62 void OnLostCapture() override; 63 void OnLostCapture() override;
63 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, 64 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
64 float device_scale_factor) override; 65 float device_scale_factor) override;
65 void OnAcceleratedWidgetDestroyed() override; 66 void OnAcceleratedWidgetDestroyed() override;
66 void OnActivationChanged(bool active) override; 67 void OnActivationChanged(bool active) override;
67 68
68 ServerWindow* root_window_; 69 ServerWindow* root_window_;
69 70
70 std::unique_ptr<ui::ImageCursors> image_cursors_; 71 std::unique_ptr<ThreadedImageCursors> image_cursors_;
71 72
72 PlatformDisplayDelegate* delegate_ = nullptr; 73 PlatformDisplayDelegate* delegate_ = nullptr;
73 std::unique_ptr<FrameGenerator> frame_generator_; 74 std::unique_ptr<FrameGenerator> frame_generator_;
74 75
75 display::ViewportMetrics metrics_; 76 display::ViewportMetrics metrics_;
76 std::unique_ptr<ui::PlatformWindow> platform_window_; 77 std::unique_ptr<ui::PlatformWindow> platform_window_;
77 gfx::AcceleratedWidget widget_; 78 gfx::AcceleratedWidget widget_;
78 79
79 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); 80 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault);
80 }; 81 };
81 82
82 } // namespace ws 83 } // namespace ws
83 } // namespace ui 84 } // namespace ui
84 85
85 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ 86 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698