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

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

Issue 2016583002: mojo/converters/ime,display -> ui/platform_window,display/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@converters_surfaces
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 | « ui/mojo/display/display_type_converters.h ('k') | ui/mojo/display/mojo_display_export.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/mojo/display/display_type_converters.cc
diff --git a/ui/mojo/display/display_type_converters.cc b/ui/mojo/display/display_type_converters.cc
deleted file mode 100644
index 920b9faeafd4c6f84baefb7dd73a5237af53cd37..0000000000000000000000000000000000000000
--- a/ui/mojo/display/display_type_converters.cc
+++ /dev/null
@@ -1,60 +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/mojo/display/display_type_converters.h"
-
-#include "ui/display/display.h"
-#include "ui/gfx/geometry/mojo/geometry_type_converters.h"
-
-namespace mojo {
-
-// static
-display::Display
-TypeConverter<display::Display, mus::mojom::DisplayPtr>::Convert(
- const mus::mojom::DisplayPtr& input) {
- if (input.is_null())
- return display::Display();
-
- display::Display result(input->id);
- gfx::Rect pixel_bounds = input->bounds.To<gfx::Rect>();
- gfx::Rect pixel_work_area = input->work_area.To<gfx::Rect>();
- 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 mus::mojom::Rotation::VALUE_0:
- result.set_rotation(display::Display::ROTATE_0);
- break;
- case mus::mojom::Rotation::VALUE_90:
- result.set_rotation(display::Display::ROTATE_90);
- break;
- case mus::mojom::Rotation::VALUE_180:
- result.set_rotation(display::Display::ROTATE_180);
- break;
- case mus::mojom::Rotation::VALUE_270:
- result.set_rotation(display::Display::ROTATE_270);
- break;
- }
- switch (input->touch_support) {
- case mus::mojom::TouchSupport::UNKNOWN:
- result.set_touch_support(display::Display::TOUCH_SUPPORT_UNKNOWN);
- break;
- case mus::mojom::TouchSupport::AVAILABLE:
- result.set_touch_support(display::Display::TOUCH_SUPPORT_AVAILABLE);
- break;
- case mus::mojom::TouchSupport::UNAVAILABLE:
- result.set_touch_support(display::Display::TOUCH_SUPPORT_UNAVAILABLE);
- break;
- }
- return result;
-}
-
-} // namespace mojo
« no previous file with comments | « ui/mojo/display/display_type_converters.h ('k') | ui/mojo/display/mojo_display_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698