| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ | 5 #ifndef MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ |
| 6 #define MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ | 6 #define MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ |
| 7 | 7 |
| 8 #include "mojo/geometry/mojo_geometry_export.h" | 8 #include "mojo/geometry/mojo_geometry_export.h" |
| 9 #include "mojo/public/interfaces/geometry/geometry.mojom.h" | 9 #include "mojo/public/interfaces/geometry/geometry.mojom.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| 11 | 11 |
| 12 namespace mojo { | 12 namespace mojo { |
| 13 | 13 |
| 14 template<> | 14 template<> |
| 15 class MOJO_GEOMETRY_EXPORT TypeConverter<Point, gfx::Point> { | 15 class MOJO_GEOMETRY_EXPORT TypeConverter<PointPtr, gfx::Point> { |
| 16 public: | 16 public: |
| 17 static Point ConvertFrom(const gfx::Point& input, Buffer* buf); | 17 static PointPtr ConvertFrom(const gfx::Point& input); |
| 18 static gfx::Point ConvertTo(const Point& input); | 18 static gfx::Point ConvertTo(const PointPtr& input); |
| 19 | |
| 20 MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION(); | |
| 21 }; | 19 }; |
| 22 | 20 |
| 23 template<> | 21 template<> |
| 24 class MOJO_GEOMETRY_EXPORT TypeConverter<Size, gfx::Size> { | 22 class MOJO_GEOMETRY_EXPORT TypeConverter<SizePtr, gfx::Size> { |
| 25 public: | 23 public: |
| 26 static Size ConvertFrom(const gfx::Size& input, Buffer* buf); | 24 static SizePtr ConvertFrom(const gfx::Size& input); |
| 27 static gfx::Size ConvertTo(const Size& input); | 25 static gfx::Size ConvertTo(const SizePtr& input); |
| 28 | |
| 29 MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION(); | |
| 30 }; | 26 }; |
| 31 | 27 |
| 32 template<> | 28 template<> |
| 33 class MOJO_GEOMETRY_EXPORT TypeConverter<Rect, gfx::Rect> { | 29 class MOJO_GEOMETRY_EXPORT TypeConverter<RectPtr, gfx::Rect> { |
| 34 public: | 30 public: |
| 35 static Rect ConvertFrom(const gfx::Rect& input, Buffer* buf); | 31 static RectPtr ConvertFrom(const gfx::Rect& input); |
| 36 static gfx::Rect ConvertTo(const Rect& input); | 32 static gfx::Rect ConvertTo(const RectPtr& input); |
| 37 | |
| 38 MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION(); | |
| 39 }; | 33 }; |
| 40 | 34 |
| 41 } // namespace mojo | 35 } // namespace mojo |
| 42 | 36 |
| 43 #endif // MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ | 37 #endif // MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ |
| OLD | NEW |