Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / jingle / notifier / listener / notification_defines.h
blob5d4a0c83dc1c6603ad3077a5c4963ff3f115a6fb
1 // Copyright (c) 2012 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.
5 #ifndef JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_
6 #define JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_
8 #include <string>
9 #include <vector>
11 namespace notifier {
13 struct Subscription {
14 Subscription();
15 ~Subscription();
16 bool Equals(const Subscription& other) const;
18 // The name of the channel to subscribe to; usually but not always
19 // a URL.
20 std::string channel;
21 // A sender, which could be a domain or a bare JID, from which we
22 // will accept pushes.
23 std::string from;
26 typedef std::vector<Subscription> SubscriptionList;
28 bool SubscriptionListsEqual(const SubscriptionList& subscriptions1,
29 const SubscriptionList& subscriptions2);
31 // A structure representing a <recipient/> block within a push message.
32 struct Recipient {
33 Recipient();
34 ~Recipient();
35 bool Equals(const Recipient& other) const;
37 // The bare jid of the recipient.
38 std::string to;
39 // User-specific data for the recipient.
40 std::string user_specific_data;
43 typedef std::vector<Recipient> RecipientList;
45 bool RecipientListsEqual(const RecipientList& recipients1,
46 const RecipientList& recipients2);
48 struct Notification {
49 Notification();
50 ~Notification();
52 // The channel the notification is coming in on.
53 std::string channel;
54 // Recipients for this notification (may be empty).
55 RecipientList recipients;
56 // The notification data payload.
57 std::string data;
59 bool Equals(const Notification& other) const;
60 std::string ToString() const;
63 } // namespace notifier
65 #endif // JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_