Chromium Code Reviews| Index: components/arc/ime/arc_ime_struct_traits.h |
| diff --git a/components/arc/ime/arc_ime_struct_traits.h b/components/arc/ime/arc_ime_struct_traits.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8b408762a5f90efc78301e7f9a56ab1bf5bbb0ba |
| --- /dev/null |
| +++ b/components/arc/ime/arc_ime_struct_traits.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
Robert Sesek
2017/05/17 22:04:32
2017 and in the .cc
yhanada
2017/05/18 04:03:11
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_ARC_IME_ARC_IME_STRUCT_TRAITS_H_ |
| +#define COMPONENTS_ARC_IME_ARC_IME_STRUCT_TRAITS_H_ |
| + |
| +#include "components/arc/common/ime.mojom.h" |
| +#include "ui/gfx/geometry/rect.h" |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct StructTraits<arc::mojom::CursorRectDataView, gfx::Rect> { |
| + static int32_t left(const gfx::Rect& r) { return r.x(); } |
| + static int32_t top(const gfx::Rect& r) { return r.y(); } |
| + static int32_t right(const gfx::Rect& r) { return r.right(); } |
| + static int32_t bottom(const gfx::Rect& r) { return r.bottom(); } |
| + |
| + static bool Read(arc::mojom::CursorRectDataView data, gfx::Rect* out); |
| +}; |
| + |
| +template <> |
| +struct StructTraits<arc::mojom::TextRangeDataView, gfx::Range> { |
| + static uint32_t start(const gfx::Range& r) { return r.start(); } |
| + static uint32_t end(const gfx::Range& r) { return r.end(); } |
| + |
| + static bool Read(arc::mojom::TextRangeDataView data, gfx::Range* out); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // COMPONENTS_ARC_IME_ARC_IME_STRUCT_TRAITS_H_ |