OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 JINGLE_NOTIFIER_BASE_NOTIFICATION_METHOD_H_ | 5 #ifndef JINGLE_NOTIFIER_BASE_NOTIFICATION_METHOD_H_ |
6 #define JINGLE_NOTIFIER_BASE_NOTIFICATION_METHOD_H_ | 6 #define JINGLE_NOTIFIER_BASE_NOTIFICATION_METHOD_H_ |
7 #pragma once | |
8 | 7 |
9 #include <string> | 8 #include <string> |
10 | 9 |
11 namespace notifier { | 10 namespace notifier { |
12 | 11 |
13 enum NotificationMethod { | 12 enum NotificationMethod { |
14 // Old peer-to-peer notification method. Currently only used for | 13 // Old peer-to-peer notification method. Currently only used for |
15 // testing. | 14 // testing. |
16 NOTIFICATION_P2P, | 15 NOTIFICATION_P2P, |
17 // Server-issued notifications. The default. | 16 // Server-issued notifications. The default. |
18 NOTIFICATION_SERVER, | 17 NOTIFICATION_SERVER, |
19 }; | 18 }; |
20 | 19 |
21 extern const NotificationMethod kDefaultNotificationMethod; | 20 extern const NotificationMethod kDefaultNotificationMethod; |
22 | 21 |
23 std::string NotificationMethodToString( | 22 std::string NotificationMethodToString( |
24 NotificationMethod notification_method); | 23 NotificationMethod notification_method); |
25 | 24 |
26 // If the given string is not one of "p2p" or "server", returns | 25 // If the given string is not one of "p2p" or "server", returns |
27 // kDefaultNotificationMethod. | 26 // kDefaultNotificationMethod. |
28 NotificationMethod StringToNotificationMethod(const std::string& str); | 27 NotificationMethod StringToNotificationMethod(const std::string& str); |
29 | 28 |
30 } // namespace notifier | 29 } // namespace notifier |
31 | 30 |
32 #endif // JINGLE_NOTIFIER_BASE_NOTIFICATION_METHOD_H_ | 31 #endif // JINGLE_NOTIFIER_BASE_NOTIFICATION_METHOD_H_ |
33 | 32 |
OLD | NEW |