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

Unified Diff: components/mus/ws/display.cc

Issue 2021483002: mus: Remove ViewportMetrics from mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 | « components/mus/ws/display.h ('k') | components/mus/ws/platform_display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/display.cc
diff --git a/components/mus/ws/display.cc b/components/mus/ws/display.cc
index ac9b9c596ba611119ff4aed586c80579e3361663..d91f7a9a3d495836d9e204d2a648c996f5e7d7e9 100644
--- a/components/mus/ws/display.cc
+++ b/components/mus/ws/display.cc
@@ -91,8 +91,7 @@ mojom::DisplayPtr Display::ToMojomDisplay() const {
display_ptr->bounds->height = root_->bounds().size().height();
// TODO(sky): window manager needs an API to set the work area.
display_ptr->work_area = display_ptr->bounds.Clone();
- display_ptr->device_pixel_ratio =
- platform_display_->GetViewportMetrics().device_pixel_ratio;
+ display_ptr->device_pixel_ratio = platform_display_->GetDeviceScaleFactor();
display_ptr->rotation = platform_display_->GetRotation();
// TODO(sky): make this real.
display_ptr->is_primary = true;
@@ -123,10 +122,6 @@ void Display::ScheduleSurfaceDestruction(ServerWindow* window) {
window->AddObserver(this);
}
-const mojom::ViewportMetrics& Display::GetViewportMetrics() const {
- return platform_display_->GetViewportMetrics();
-}
-
ServerWindow* Display::GetRootWithId(const WindowId& id) {
if (id == root_->id())
return root_.get();
@@ -292,20 +287,19 @@ void Display::OnDisplayClosed() {
display_manager()->DestroyDisplay(this);
}
-void Display::OnViewportMetricsChanged(
- const mojom::ViewportMetrics& old_metrics,
- const mojom::ViewportMetrics& new_metrics) {
+void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics,
+ const ViewportMetrics& new_metrics) {
if (!root_) {
root_.reset(window_server_->CreateServerWindow(
display_manager()->GetAndAdvanceNextRootId(),
ServerWindow::Properties()));
- root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>()));
+ root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels));
root_->SetVisible(true);
focus_controller_.reset(new FocusController(this, root_.get()));
focus_controller_->AddObserver(this);
InitWindowManagersIfNecessary();
} else {
- root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>()));
+ root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels));
const gfx::Rect wm_bounds(root_->bounds().size());
for (auto& pair : window_manager_state_map_)
pair.second->root()->SetBounds(wm_bounds);
« no previous file with comments | « components/mus/ws/display.h ('k') | components/mus/ws/platform_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698