summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/public/platform/modules/notifications/web_notification_data.h
blob: 1ab0e9aac45955819961f9cef906eb97f9205ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2014 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 THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_NOTIFICATIONS_WEB_NOTIFICATION_DATA_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_NOTIFICATIONS_WEB_NOTIFICATION_DATA_H_

#include "third_party/blink/public/mojom/notifications/notification.mojom-shared.h"
#include "third_party/blink/public/platform/modules/notifications/web_notification_action.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_vector.h"

namespace blink {

// Structure representing the data associated with a Web Notification.
// Currently we're using the corresponding mojom struct
// blink::mojom::blink::NotificationData everywhere inside Blink,
// WebNotificationData is only used to carry notification data across the
// boundary between Content layer and Blink (the only two functions:
// WebServiceWorkerContextProxy::DispatchNotification{Click, Close}Event),
// ultimately WebNotificationData will also be replaced by the mojom one there
// via Onion Soup effort.
struct WebNotificationData {
  WebString title;
  mojom::NotificationDirection direction =
      mojom::NotificationDirection::LEFT_TO_RIGHT;
  WebString lang;
  WebString body;
  WebString tag;
  WebURL image;
  WebURL icon;
  WebURL badge;
  WebVector<int> vibrate;
  double timestamp = 0;
  bool renotify = false;
  bool silent = false;
  bool require_interaction = false;
  WebVector<char> data;
  WebVector<WebNotificationAction> actions;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_NOTIFICATIONS_WEB_NOTIFICATION_DATA_H_