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

Side by Side Diff: content/common/push_messaging_param_traits.h

Issue 2690203003: Convert push_messaging IPC msgs into mojo interfaces (Closed)
Patch Set: code rebase Created 3 years, 10 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
« no previous file with comments | « content/common/push_messaging_messages.h ('k') | content/common/push_messaging_param_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CONTENT_COMMON_PUSH_MESSAGING_PARAM_TRAITS_H_
6 #define CONTENT_COMMON_PUSH_MESSAGING_PARAM_TRAITS_H_
7
8 #include <stddef.h>
9
10 #include "content/common/push_messaging.mojom.h"
11 #include "mojo/public/cpp/bindings/struct_traits.h"
12
13 namespace mojo {
14
15 template <>
16 struct StructTraits<content::mojom::PushSubscriptionOptionsDataView,
17 content::PushSubscriptionOptions> {
18 static bool user_visible_only(const content::PushSubscriptionOptions& r) {
19 return r.user_visible_only;
20 }
21 static const std::string& sender_info(
22 const content::PushSubscriptionOptions& r) {
23 return r.sender_info;
24 }
25 static bool Read(content::mojom::PushSubscriptionOptionsDataView data,
26 content::PushSubscriptionOptions* out);
27 };
28
29 template <>
30 struct EnumTraits<content::mojom::PushRegistrationStatus,
31 content::PushRegistrationStatus> {
32 static content::mojom::PushRegistrationStatus ToMojom(
33 content::PushRegistrationStatus input);
34 static bool FromMojom(content::mojom::PushRegistrationStatus input,
35 content::PushRegistrationStatus* output);
36 };
37
38 template <>
39 struct EnumTraits<content::mojom::PushErrorType,
40 blink::WebPushError::ErrorType> {
41 static content::mojom::PushErrorType ToMojom(
42 blink::WebPushError::ErrorType input);
43 static bool FromMojom(content::mojom::PushErrorType input,
44 blink::WebPushError::ErrorType* output);
45 };
46
47 template <>
48 struct EnumTraits<content::mojom::PushGetRegistrationStatus,
49 content::PushGetRegistrationStatus> {
50 static content::mojom::PushGetRegistrationStatus ToMojom(
51 content::PushGetRegistrationStatus input);
52 static bool FromMojom(content::mojom::PushGetRegistrationStatus input,
53 content::PushGetRegistrationStatus* output);
54 };
55
56 template <>
57 struct EnumTraits<content::mojom::PushPermissionStatus,
58 blink::WebPushPermissionStatus> {
59 static content::mojom::PushPermissionStatus ToMojom(
60 blink::WebPushPermissionStatus input);
61 static bool FromMojom(content::mojom::PushPermissionStatus input,
62 blink::WebPushPermissionStatus* output);
63 };
64
65 } // namespace mojo
66
67 #endif // CONTENT_COMMON_PUSH_MESSAGING_PARAM_TRAITS_H_
OLDNEW
« no previous file with comments | « content/common/push_messaging_messages.h ('k') | content/common/push_messaging_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698