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

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

Issue 2189893004: Unify display ids between Display and PlatformDisplay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to pure virtual. Created 4 years, 5 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/display.h ('k') | services/ui/ws/display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display.cc
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc
index f375d07c3bba7ecb12b50070168378bfe04cdcc7..071df3a3b5449cd54b67c146238e444b4f34967f 100644
--- a/services/ui/ws/display.cc
+++ b/services/ui/ws/display.cc
@@ -33,8 +33,7 @@ namespace ws {
Display::Display(WindowServer* window_server,
const PlatformDisplayInitParams& platform_display_init_params)
- : id_(window_server->display_manager()->GetAndAdvanceNextDisplayId()),
- window_server_(window_server),
+ : window_server_(window_server),
platform_display_(PlatformDisplay::Create(platform_display_init_params)),
last_cursor_(ui::kCursorNone) {
platform_display_->Init(this);
@@ -73,6 +72,10 @@ void Display::Init(std::unique_ptr<DisplayBinding> binding) {
InitWindowManagerDisplayRootsIfNecessary();
}
+int64_t Display::GetId() const {
+ return platform_display_->GetId();
+}
+
DisplayManager* Display::display_manager() {
return window_server_->display_manager();
}
@@ -94,7 +97,7 @@ mojom::WsDisplayPtr Display::ToWsDisplay() const {
}
::display::Display Display::ToDisplay() const {
- ::display::Display display(id_);
+ ::display::Display display(GetId());
// TODO(sky): Display should know its origin.
display.set_bounds(gfx::Rect(0, 0, root_->bounds().size().width(),
@@ -134,10 +137,6 @@ gfx::Size Display::GetSize() const {
return root_->bounds().size();
}
-int64_t Display::GetPlatformDisplayId() const {
- return platform_display_->GetDisplayId();
-}
-
ServerWindow* Display::GetRootWithId(const WindowId& id) {
if (id == root_->id())
return root_.get();
« no previous file with comments | « services/ui/ws/display.h ('k') | services/ui/ws/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698