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 CHROME_COMMON_NOTIFICATION_TYPE_H_ | 5 #ifndef CHROME_COMMON_NOTIFICATION_TYPE_H_ |
6 #define CHROME_COMMON_NOTIFICATION_TYPE_H_ | 6 #define CHROME_COMMON_NOTIFICATION_TYPE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // This file describes various types used to describe and filter notifications | 9 // This file describes various types used to describe and filter notifications |
10 // that pass through the NotificationService. | 10 // that pass through the NotificationService. |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 // represented by a vector of PasswordStoreChange. Each change includes a | 1223 // represented by a vector of PasswordStoreChange. Each change includes a |
1224 // change type (ADD, UPDATE, or REMOVE) as well as the | 1224 // change type (ADD, UPDATE, or REMOVE) as well as the |
1225 // |webkit_glue::PasswordForm|s that were affected. | 1225 // |webkit_glue::PasswordForm|s that were affected. |
1226 LOGINS_CHANGED, | 1226 LOGINS_CHANGED, |
1227 | 1227 |
1228 // Configuration Policy ---------------------------------------------------- | 1228 // Configuration Policy ---------------------------------------------------- |
1229 // This notification is sent whenever the administrator changes policy. | 1229 // This notification is sent whenever the administrator changes policy. |
1230 // The detail of this notification is not used. | 1230 // The detail of this notification is not used. |
1231 POLICY_CHANGED, | 1231 POLICY_CHANGED, |
1232 | 1232 |
| 1233 // This notification is sent whenever the device token becomes available |
| 1234 // that the policy subsystem uses to fetch policy from the cloud. |
| 1235 DEVICE_TOKEN_AVAILABLE, |
| 1236 |
1233 // Count (must be last) ---------------------------------------------------- | 1237 // Count (must be last) ---------------------------------------------------- |
1234 // Used to determine the number of notification types. Not valid as | 1238 // Used to determine the number of notification types. Not valid as |
1235 // a type parameter when registering for or posting notifications. | 1239 // a type parameter when registering for or posting notifications. |
1236 NOTIFICATION_TYPE_COUNT | 1240 NOTIFICATION_TYPE_COUNT |
1237 }; | 1241 }; |
1238 | 1242 |
1239 // TODO(erg): Our notification system relies on implicit conversion. | 1243 // TODO(erg): Our notification system relies on implicit conversion. |
1240 NotificationType(Type v) : value(v) {} // NOLINT | 1244 NotificationType(Type v) : value(v) {} // NOLINT |
1241 | 1245 |
1242 bool operator==(NotificationType t) const { return value == t.value; } | 1246 bool operator==(NotificationType t) const { return value == t.value; } |
1243 bool operator!=(NotificationType t) const { return value != t.value; } | 1247 bool operator!=(NotificationType t) const { return value != t.value; } |
1244 | 1248 |
1245 // Comparison to explicit enum values. | 1249 // Comparison to explicit enum values. |
1246 bool operator==(Type v) const { return value == v; } | 1250 bool operator==(Type v) const { return value == v; } |
1247 bool operator!=(Type v) const { return value != v; } | 1251 bool operator!=(Type v) const { return value != v; } |
1248 | 1252 |
1249 Type value; | 1253 Type value; |
1250 }; | 1254 }; |
1251 | 1255 |
1252 inline bool operator==(NotificationType::Type a, NotificationType b) { | 1256 inline bool operator==(NotificationType::Type a, NotificationType b) { |
1253 return a == b.value; | 1257 return a == b.value; |
1254 } | 1258 } |
1255 inline bool operator!=(NotificationType::Type a, NotificationType b) { | 1259 inline bool operator!=(NotificationType::Type a, NotificationType b) { |
1256 return a != b.value; | 1260 return a != b.value; |
1257 } | 1261 } |
1258 | 1262 |
1259 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ | 1263 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ |
OLD | NEW |