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

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

Issue 2763143002: Remove FrameGenerator::root_window_ (Closed)
Patch Set: Created 3 years, 9 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 "services/ui/ws/server_window_observer.h"
16 #include "ui/platform_window/platform_window_delegate.h" 17 #include "ui/platform_window/platform_window_delegate.h"
17 18
18 namespace ui { 19 namespace ui {
19 20
20 class ImageCursors; 21 class ImageCursors;
21 class LocatedEvent; 22 class LocatedEvent;
22 class PlatformWindow; 23 class PlatformWindow;
23 24
24 namespace ws { 25 namespace ws {
25 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,
31 public ServerWindowObserver {
30 public: 32 public:
31 PlatformDisplayDefault(ServerWindow* root_window, 33 PlatformDisplayDefault(ServerWindow* root_window,
32 const display::ViewportMetrics& metrics); 34 const display::ViewportMetrics& metrics);
33 ~PlatformDisplayDefault() override; 35 ~PlatformDisplayDefault() override;
34 36
35 // PlatformDisplay: 37 // PlatformDisplay:
36 void Init(PlatformDisplayDelegate* delegate) override; 38 void Init(PlatformDisplayDelegate* delegate) override;
37 void SetViewportSize(const gfx::Size& size) override; 39 void SetViewportSize(const gfx::Size& size) override;
38 void SetTitle(const base::string16& title) override; 40 void SetTitle(const base::string16& title) override;
39 void SetCapture() override; 41 void SetCapture() override;
(...skipping 19 matching lines...) Expand all
59 void DispatchEvent(ui::Event* event) override; 61 void DispatchEvent(ui::Event* event) override;
60 void OnCloseRequest() override; 62 void OnCloseRequest() override;
61 void OnClosed() override; 63 void OnClosed() override;
62 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; 64 void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
63 void OnLostCapture() override; 65 void OnLostCapture() override;
64 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, 66 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
65 float device_scale_factor) override; 67 float device_scale_factor) override;
66 void OnAcceleratedWidgetDestroyed() override; 68 void OnAcceleratedWidgetDestroyed() override;
67 void OnActivationChanged(bool active) override; 69 void OnActivationChanged(bool active) override;
68 70
71 // ServerWindowObserver:
72 void OnWindowBoundsChanged(ServerWindow* window,
73 const gfx::Rect& old_bounds,
74 const gfx::Rect& new_bounds) override;
75 void OnWindowVisibilityChanged(ServerWindow* window) override;
76
69 ServerWindow* root_window_; 77 ServerWindow* root_window_;
70 78
71 #if !defined(OS_ANDROID) 79 #if !defined(OS_ANDROID)
72 std::unique_ptr<ui::ImageCursors> image_cursors_; 80 std::unique_ptr<ui::ImageCursors> image_cursors_;
73 #endif 81 #endif
74 82
75 PlatformDisplayDelegate* delegate_ = nullptr; 83 PlatformDisplayDelegate* delegate_ = nullptr;
76 std::unique_ptr<FrameGenerator> frame_generator_; 84 std::unique_ptr<FrameGenerator> frame_generator_;
77 85
78 display::ViewportMetrics metrics_; 86 display::ViewportMetrics metrics_;
79 std::unique_ptr<ui::PlatformWindow> platform_window_; 87 std::unique_ptr<ui::PlatformWindow> platform_window_;
80 gfx::AcceleratedWidget widget_; 88 gfx::AcceleratedWidget widget_;
81 float init_device_scale_factor_;
82 89
83 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault); 90 DISALLOW_COPY_AND_ASSIGN(PlatformDisplayDefault);
84 }; 91 };
85 92
86 } // namespace ws 93 } // namespace ws
87 } // namespace ui 94 } // namespace ui
88 95
89 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_ 96 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DEFAULT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698