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

Side by Side Diff: components/arc/ime/arc_ime_struct_traits.h

Issue 2876693004: Implement GetTextFromRange(), GetTextRange() and GetSelectionRange() for ArcImeService. (Closed)
Patch Set: add TODOs in ime.mojom Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ARC_IME_ARC_IME_STRUCT_TRAITS_H_
6 #define COMPONENTS_ARC_IME_ARC_IME_STRUCT_TRAITS_H_
7
8 #include "components/arc/common/ime.mojom.h"
9 #include "ui/gfx/geometry/rect.h"
10
11 namespace mojo {
12
13 template <>
14 struct StructTraits<arc::mojom::CursorRectDataView, gfx::Rect> {
15 static int32_t left(const gfx::Rect& r) { return r.x(); }
16 static int32_t top(const gfx::Rect& r) { return r.y(); }
17 static int32_t right(const gfx::Rect& r) { return r.right(); }
18 static int32_t bottom(const gfx::Rect& r) { return r.bottom(); }
19
20 static bool Read(arc::mojom::CursorRectDataView data, gfx::Rect* out);
21 };
22
23 template <>
24 struct StructTraits<arc::mojom::TextRangeDataView, gfx::Range> {
25 static uint32_t start(const gfx::Range& r) { return r.start(); }
26 static uint32_t end(const gfx::Range& r) { return r.end(); }
27
28 static bool Read(arc::mojom::TextRangeDataView data, gfx::Range* out);
29 };
30
31 } // namespace mojo
32
33 #endif // COMPONENTS_ARC_IME_ARC_IME_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « components/arc/ime/arc_ime_service_unittest.cc ('k') | components/arc/ime/arc_ime_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698