| 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_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_ | 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_ |
| 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_ | 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_ |
| 7 | 7 |
| 8 #include "mojom/native_viewport.h" | 8 #include "mojo/services/native_viewport/native_viewport.mojom.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 | 10 |
| 11 namespace mojo { | 11 namespace mojo { |
| 12 | 12 |
| 13 template<> | 13 template<> |
| 14 class TypeConverter<Point, gfx::Point> { | 14 class TypeConverter<Point, gfx::Point> { |
| 15 public: | 15 public: |
| 16 static Point ConvertFrom(const gfx::Point& input, Buffer* buf) { | 16 static Point ConvertFrom(const gfx::Point& input, Buffer* buf) { |
| 17 Point::Builder point(buf); | 17 Point::Builder point(buf); |
| 18 point.set_x(input.x()); | 18 point.set_x(input.x()); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 49 } | 49 } |
| 50 static gfx::Rect ConvertTo(const Rect& input) { | 50 static gfx::Rect ConvertTo(const Rect& input) { |
| 51 return gfx::Rect(input.position().x(), input.position().y(), | 51 return gfx::Rect(input.position().x(), input.position().y(), |
| 52 input.size().width(), input.size().height()); | 52 input.size().width(), input.size().height()); |
| 53 } | 53 } |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace mojo | 56 } // namespace mojo |
| 57 | 57 |
| 58 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_ | 58 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_GEOMETRY_CONVERSIONS_H_ |
| OLD | NEW |