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

Unified Diff: services/ui/ws/display.h

Issue 2736943003: Start to decouple display::Display from ws::PlatformDisplay. (Closed)
Patch Set: Fix comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display.h
diff --git a/services/ui/ws/display.h b/services/ui/ws/display.h
index 478f16a37a93e48de6cf96cb6940865af3e22bd2..f4b244d4f7fbc2987bd788457376e95a80926c9e 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:
+ const display::Display& GetDisplay() override;
+
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_;
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698