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

Unified Diff: ui/display/mojo/display_type_converters.cc

Issue 2161993002: Start using display.mojom.Display in mus+ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@display_traits
Patch Set: Fixes. 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 | « ui/display/mojo/display_type_converters.h ('k') | ui/display/mojo/mojo_display_export.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/mojo/display_type_converters.cc
diff --git a/ui/display/mojo/display_type_converters.cc b/ui/display/mojo/display_type_converters.cc
deleted file mode 100644
index 005670c8fd545f45a8933eb4893576f5e4627947..0000000000000000000000000000000000000000
--- a/ui/display/mojo/display_type_converters.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/display/mojo/display_type_converters.h"
-
-#include "ui/display/display.h"
-
-namespace mojo {
-
-// static
-display::Display
-TypeConverter<display::Display, ui::mojom::DisplayPtr>::Convert(
- const ui::mojom::DisplayPtr& input) {
- if (input.is_null())
- return display::Display();
-
- display::Display result(input->id);
- gfx::Rect pixel_bounds = input->bounds;
- gfx::Rect pixel_work_area = input->work_area;
- float pixel_ratio = input->device_pixel_ratio;
-
- gfx::Rect dip_bounds =
- gfx::ScaleToEnclosingRect(pixel_bounds, 1.f / pixel_ratio);
- gfx::Rect dip_work_area =
- gfx::ScaleToEnclosingRect(pixel_work_area, 1.f / pixel_ratio);
- result.set_bounds(dip_bounds);
- result.set_work_area(dip_work_area);
- result.set_device_scale_factor(input->device_pixel_ratio);
-
- switch (input->rotation) {
- case ui::mojom::Rotation::VALUE_0:
- result.set_rotation(display::Display::ROTATE_0);
- break;
- case ui::mojom::Rotation::VALUE_90:
- result.set_rotation(display::Display::ROTATE_90);
- break;
- case ui::mojom::Rotation::VALUE_180:
- result.set_rotation(display::Display::ROTATE_180);
- break;
- case ui::mojom::Rotation::VALUE_270:
- result.set_rotation(display::Display::ROTATE_270);
- break;
- }
- switch (input->touch_support) {
- case ui::mojom::TouchSupport::UNKNOWN:
- result.set_touch_support(display::Display::TOUCH_SUPPORT_UNKNOWN);
- break;
- case ui::mojom::TouchSupport::AVAILABLE:
- result.set_touch_support(display::Display::TOUCH_SUPPORT_AVAILABLE);
- break;
- case ui::mojom::TouchSupport::UNAVAILABLE:
- result.set_touch_support(display::Display::TOUCH_SUPPORT_UNAVAILABLE);
- break;
- }
- return result;
-}
-
-} // namespace mojo
« no previous file with comments | « ui/display/mojo/display_type_converters.h ('k') | ui/display/mojo/mojo_display_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698