Chromium Code Reviews| Index: services/ui/ws/display.h |
| diff --git a/services/ui/ws/display.h b/services/ui/ws/display.h |
| index 478f16a37a93e48de6cf96cb6940865af3e22bd2..5c98f9761d35dbaf6d65574e5ef98cc369570664 100644 |
| --- a/services/ui/ws/display.h |
| +++ b/services/ui/ws/display.h |
| @@ -29,13 +29,16 @@ |
| #include "services/ui/ws/window_manager_window_tree_factory_set_observer.h" |
| #include "ui/display/display.h" |
| +namespace display { |
| +struct ViewportMetrics; |
| +} |
| + |
| namespace ui { |
| namespace ws { |
| class DisplayBinding; |
| class DisplayManager; |
| class FocusController; |
| -struct PlatformDisplayInitParams; |
| class WindowManagerDisplayRoot; |
| class WindowServer; |
| class WindowTree; |
| @@ -65,19 +68,25 @@ class Display : public PlatformDisplayDelegate, |
| // Initializes the display root ServerWindow and PlatformDisplay. Adds this to |
| // DisplayManager as a pending display, until accelerated widget is available. |
| - void Init(const PlatformDisplayInitParams& init_params, |
| + void Init(const display::ViewportMetrics& metrics, |
| std::unique_ptr<DisplayBinding> binding); |
| + // Returns an ID for this display. In internal mode this the display::Display |
| + // ID. In external mode this hasn't been defined yet. |
| int64_t GetId() const; |
| + // Sets the display::Display corresponding to this ws::Display. This is only |
| + // valid in internal window mode. |
| + void SetDisplay(const display::Display& display); |
| + |
| + // PlatformDisplayDelegate: |
| + display::Display GetDisplay() override; |
|
sky
2017/03/13 18:29:06
Can this return a const Display& ?
kylechar
2017/03/13 19:28:02
Yep! I missed that it wasn't.
|
| + |
| DisplayManager* display_manager(); |
| const DisplayManager* display_manager() const; |
| PlatformDisplay* platform_display() { return platform_display_.get(); } |
| - // Returns a display::Display corresponding to this ws::Display. |
| - display::Display ToDisplay() const; |
| - |
| // Returns the size of the display in physical pixels. |
| gfx::Size GetSize() const; |
| @@ -168,7 +177,6 @@ class Display : public PlatformDisplayDelegate, |
| void CreateRootWindow(const gfx::Size& size); |
| // PlatformDisplayDelegate: |
| - display::Display GetDisplay() override; |
| ServerWindow* GetRootWindow() override; |
| void OnAcceleratedWidgetAvailable() override; |
| bool IsInHighContrastMode() override; |
| @@ -198,6 +206,10 @@ class Display : public PlatformDisplayDelegate, |
| std::unique_ptr<PlatformDisplay> platform_display_; |
| std::unique_ptr<FocusController> focus_controller_; |
| + // In internal window mode this contains information about the display. In |
| + // external window mode this will be invalid. |
| + display::Display display_; |
| + |
| // The last cursor set. Used to track whether we need to change the cursor. |
| mojom::Cursor last_cursor_; |