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

Unified Diff: mojo/services/native_viewport/geometry_conversions.h

Issue 298563003: Move geometry types to a more central location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | « mojo/services/native_viewport/DEPS ('k') | mojo/services/native_viewport/native_viewport.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/geometry_conversions.h
diff --git a/mojo/services/native_viewport/geometry_conversions.h b/mojo/services/native_viewport/geometry_conversions.h
deleted file mode 100644
index 27e9c5a99f51587a75fad4663b90aeee603d6cd4..0000000000000000000000000000000000000000
--- a/mojo/services/native_viewport/geometry_conversions.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_
-#define MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_
-
-#include "mojo/services/native_viewport/native_viewport.mojom.h"
-#include "ui/gfx/rect.h"
-
-namespace mojo {
-
-template<>
-class TypeConverter<Point, gfx::Point> {
-public:
- static Point ConvertFrom(const gfx::Point& input, Buffer* buf) {
- Point::Builder point(buf);
- point.set_x(input.x());
- point.set_y(input.y());
- return point.Finish();
- }
- static gfx::Point ConvertTo(const Point& input) {
- return gfx::Point(input.x(), input.y());
- }
-
- MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION();
-};
-
-template<>
-class TypeConverter<Size, gfx::Size> {
-public:
- static Size ConvertFrom(const gfx::Size& input, Buffer* buf) {
- Size::Builder size(buf);
- size.set_width(input.width());
- size.set_height(input.height());
- return size.Finish();
- }
- static gfx::Size ConvertTo(const Size& input) {
- return gfx::Size(input.width(), input.height());
- }
-
- MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION();
-};
-
-template<>
-class TypeConverter<Rect, gfx::Rect> {
- public:
- static Rect ConvertFrom(const gfx::Rect& input, Buffer* buf) {
- Rect::Builder rect(buf);
- rect.set_position(input.origin());
- rect.set_size(input.size());
- return rect.Finish();
- }
- static gfx::Rect ConvertTo(const Rect& input) {
- return gfx::Rect(input.position().x(), input.position().y(),
- input.size().width(), input.size().height());
- }
-
- MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION();
-};
-
-} // namespace mojo
-
-#endif // MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/services/native_viewport/native_viewport.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698