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

Side by Side Diff: services/ui/public/interfaces/display/display_struct_traits.h

Issue 2253293002: Mojo C++ bindings: change the first template parameter of StructTraits and UnionTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@91_extra
Patch Set: rebase Created 4 years, 4 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
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
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_
OLDNEW
« no previous file with comments | « services/shell/public/cpp/identity_struct_traits.h ('k') | services/ui/public/interfaces/display/display_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698