OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 SYNC_NOTIFIER_NOTIFICATIONS_DISABLED_REASON_H_ | 5 #ifndef SYNC_NOTIFIER_NOTIFICATIONS_DISABLED_REASON_H_ |
6 #define SYNC_NOTIFIER_NOTIFICATIONS_DISABLED_REASON_H_ | 6 #define SYNC_NOTIFIER_NOTIFICATIONS_DISABLED_REASON_H_ |
7 #pragma once | |
8 | 7 |
9 #include "jingle/notifier/listener/push_client_observer.h" | 8 #include "jingle/notifier/listener/push_client_observer.h" |
10 | 9 |
11 namespace syncer { | 10 namespace syncer { |
12 | 11 |
13 enum NotificationsDisabledReason { | 12 enum NotificationsDisabledReason { |
14 // There is an underlying transient problem (e.g., network- or | 13 // There is an underlying transient problem (e.g., network- or |
15 // XMPP-related). | 14 // XMPP-related). |
16 TRANSIENT_NOTIFICATION_ERROR, | 15 TRANSIENT_NOTIFICATION_ERROR, |
17 DEFAULT_NOTIFICATION_ERROR = TRANSIENT_NOTIFICATION_ERROR, | 16 DEFAULT_NOTIFICATION_ERROR = TRANSIENT_NOTIFICATION_ERROR, |
18 // Our credentials have been rejected. | 17 // Our credentials have been rejected. |
19 NOTIFICATION_CREDENTIALS_REJECTED, | 18 NOTIFICATION_CREDENTIALS_REJECTED, |
20 // No error (useful as a default value or to avoid keeping a | 19 // No error (useful as a default value or to avoid keeping a |
21 // separate bool for notifications enabled/disabled). | 20 // separate bool for notifications enabled/disabled). |
22 NO_NOTIFICATION_ERROR | 21 NO_NOTIFICATION_ERROR |
23 }; | 22 }; |
24 | 23 |
25 const char* NotificationsDisabledReasonToString( | 24 const char* NotificationsDisabledReasonToString( |
26 NotificationsDisabledReason reason); | 25 NotificationsDisabledReason reason); |
27 | 26 |
28 NotificationsDisabledReason FromNotifierReason( | 27 NotificationsDisabledReason FromNotifierReason( |
29 notifier::NotificationsDisabledReason reason); | 28 notifier::NotificationsDisabledReason reason); |
30 | 29 |
31 } // namespace syncer | 30 } // namespace syncer |
32 | 31 |
33 #endif // SYNC_NOTIFIER_NOTIFICATIONS_DISABLED_REASON_H_ | 32 #endif // SYNC_NOTIFIER_NOTIFICATIONS_DISABLED_REASON_H_ |
OLD | NEW |