OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_PUBLIC_INTERFACES_DISPLAY_DISPLAY_STRUCT_TRAITS_H_ | 5 #ifndef SERVICES_UI_PUBLIC_INTERFACES_DISPLAY_DISPLAY_STRUCT_TRAITS_H_ |
6 #define SERVICES_UI_PUBLIC_INTERFACES_DISPLAY_DISPLAY_STRUCT_TRAITS_H_ | 6 #define SERVICES_UI_PUBLIC_INTERFACES_DISPLAY_DISPLAY_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "ui/display/display.h" | 8 #include "ui/display/display.h" |
9 #include "services/ui/public/interfaces/display/display.mojom.h" | 9 #include "services/ui/public/interfaces/display/display.mojom.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 template <> | 13 template <> |
14 struct EnumTraits<display::mojom::Rotation, display::Display::Rotation> { | 14 struct EnumTraits<display::mojom::Rotation, display::Display::Rotation> { |
15 static display::mojom::Rotation ToMojom(display::Display::Rotation type); | 15 static display::mojom::Rotation ToMojom(display::Display::Rotation type); |
16 static bool FromMojom(display::mojom::Rotation type, | 16 static bool FromMojom(display::mojom::Rotation type, |
17 display::Display::Rotation* output); | 17 display::Display::Rotation* output); |
18 }; | 18 }; |
19 | 19 |
20 template <> | 20 template <> |
21 struct EnumTraits<display::mojom::TouchSupport, | 21 struct EnumTraits<display::mojom::TouchSupport, |
22 display::Display::TouchSupport> { | 22 display::Display::TouchSupport> { |
23 static display::mojom::TouchSupport ToMojom( | 23 static display::mojom::TouchSupport ToMojom( |
24 display::Display::TouchSupport type); | 24 display::Display::TouchSupport type); |
25 static bool FromMojom(display::mojom::TouchSupport type, | 25 static bool FromMojom(display::mojom::TouchSupport type, |
26 display::Display::TouchSupport* output); | 26 display::Display::TouchSupport* output); |
27 }; | 27 }; |
28 | 28 |
29 template <> | 29 template <> |
30 struct StructTraits<display::mojom::Display, display::Display> { | 30 struct StructTraits<display::mojom::DisplayDataView, display::Display> { |
31 static int64_t id(const display::Display& display) { return display.id(); } | 31 static int64_t id(const display::Display& display) { return display.id(); } |
32 | 32 |
33 static const gfx::Rect& bounds(const display::Display& display) { | 33 static const gfx::Rect& bounds(const display::Display& display) { |
34 return display.bounds(); | 34 return display.bounds(); |
35 } | 35 } |
36 | 36 |
37 static const gfx::Rect& work_area(const display::Display& display) { | 37 static const gfx::Rect& work_area(const display::Display& display) { |
38 return display.work_area(); | 38 return display.work_area(); |
39 } | 39 } |
40 | 40 |
(...skipping 13 matching lines...) Expand all Loading... |
54 static const gfx::Size& maximum_cursor_size(const display::Display& display) { | 54 static const gfx::Size& maximum_cursor_size(const display::Display& display) { |
55 return display.maximum_cursor_size(); | 55 return display.maximum_cursor_size(); |
56 } | 56 } |
57 | 57 |
58 static bool Read(display::mojom::DisplayDataView data, display::Display* out); | 58 static bool Read(display::mojom::DisplayDataView data, display::Display* out); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace mojo | 61 } // namespace mojo |
62 | 62 |
63 #endif // SERVICES_UI_PUBLIC_INTERFACES_DISPLAY_DISPLAY_STRUCT_TRAITS_H_ | 63 #endif // SERVICES_UI_PUBLIC_INTERFACES_DISPLAY_DISPLAY_STRUCT_TRAITS_H_ |
OLD | NEW |