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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/push_messaging_param_traits.h
diff --git a/content/common/push_messaging_param_traits.h b/content/common/push_messaging_param_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..1fd16a64aad821b20d1d8fb4f23d60fd8321a366
--- /dev/null
+++ b/content/common/push_messaging_param_traits.h
@@ -0,0 +1,67 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_PUSH_MESSAGING_PARAM_TRAITS_H_
+#define CONTENT_COMMON_PUSH_MESSAGING_PARAM_TRAITS_H_
+
+#include <stddef.h>
+
+#include "content/common/push_messaging.mojom.h"
+#include "mojo/public/cpp/bindings/struct_traits.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<content::mojom::PushSubscriptionOptionsDataView,
+ content::PushSubscriptionOptions> {
+ static bool user_visible_only(const content::PushSubscriptionOptions& r) {
+ return r.user_visible_only;
+ }
+ static const std::string& sender_info(
+ const content::PushSubscriptionOptions& r) {
+ return r.sender_info;
+ }
+ static bool Read(content::mojom::PushSubscriptionOptionsDataView data,
+ content::PushSubscriptionOptions* out);
+};
+
+template <>
+struct EnumTraits<content::mojom::PushRegistrationStatus,
+ content::PushRegistrationStatus> {
+ static content::mojom::PushRegistrationStatus ToMojom(
+ content::PushRegistrationStatus input);
+ static bool FromMojom(content::mojom::PushRegistrationStatus input,
+ content::PushRegistrationStatus* output);
+};
+
+template <>
+struct EnumTraits<content::mojom::PushErrorType,
+ blink::WebPushError::ErrorType> {
+ static content::mojom::PushErrorType ToMojom(
+ blink::WebPushError::ErrorType input);
+ static bool FromMojom(content::mojom::PushErrorType input,
+ blink::WebPushError::ErrorType* output);
+};
+
+template <>
+struct EnumTraits<content::mojom::PushGetRegistrationStatus,
+ content::PushGetRegistrationStatus> {
+ static content::mojom::PushGetRegistrationStatus ToMojom(
+ content::PushGetRegistrationStatus input);
+ static bool FromMojom(content::mojom::PushGetRegistrationStatus input,
+ content::PushGetRegistrationStatus* output);
+};
+
+template <>
+struct EnumTraits<content::mojom::PushPermissionStatus,
+ blink::WebPushPermissionStatus> {
+ static content::mojom::PushPermissionStatus ToMojom(
+ blink::WebPushPermissionStatus input);
+ static bool FromMojom(content::mojom::PushPermissionStatus input,
+ blink::WebPushPermissionStatus* output);
+};
+
+} // namespace mojo
+
+#endif // CONTENT_COMMON_PUSH_MESSAGING_PARAM_TRAITS_H_
« 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