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 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 | 1284 |
1285 // Configuration Policy ---------------------------------------------------- | 1285 // Configuration Policy ---------------------------------------------------- |
1286 // This notification is sent whenever the administrator changes policy. | 1286 // This notification is sent whenever the administrator changes policy. |
1287 // The detail of this notification is not used. | 1287 // The detail of this notification is not used. |
1288 POLICY_CHANGED, | 1288 POLICY_CHANGED, |
1289 | 1289 |
1290 // This notification is sent whenever the device token becomes available | 1290 // This notification is sent whenever the device token becomes available |
1291 // that the policy subsystem uses to fetch policy from the cloud. | 1291 // that the policy subsystem uses to fetch policy from the cloud. |
1292 DEVICE_TOKEN_AVAILABLE, | 1292 DEVICE_TOKEN_AVAILABLE, |
1293 | 1293 |
1294 // This notification is sent whenever cloud policies are fetched and | |
1295 // updated. The detail of this notification is not used. | |
1296 CLOUD_POLICY_UPDATE, | |
1297 | |
1298 // Count (must be last) ---------------------------------------------------- | 1294 // Count (must be last) ---------------------------------------------------- |
1299 // Used to determine the number of notification types. Not valid as | 1295 // Used to determine the number of notification types. Not valid as |
1300 // a type parameter when registering for or posting notifications. | 1296 // a type parameter when registering for or posting notifications. |
1301 NOTIFICATION_TYPE_COUNT | 1297 NOTIFICATION_TYPE_COUNT |
1302 }; | 1298 }; |
1303 | 1299 |
1304 // TODO(erg): Our notification system relies on implicit conversion. | 1300 // TODO(erg): Our notification system relies on implicit conversion. |
1305 NotificationType(Type v) : value(v) {} // NOLINT | 1301 NotificationType(Type v) : value(v) {} // NOLINT |
1306 | 1302 |
1307 bool operator==(NotificationType t) const { return value == t.value; } | 1303 bool operator==(NotificationType t) const { return value == t.value; } |
1308 bool operator!=(NotificationType t) const { return value != t.value; } | 1304 bool operator!=(NotificationType t) const { return value != t.value; } |
1309 | 1305 |
1310 // Comparison to explicit enum values. | 1306 // Comparison to explicit enum values. |
1311 bool operator==(Type v) const { return value == v; } | 1307 bool operator==(Type v) const { return value == v; } |
1312 bool operator!=(Type v) const { return value != v; } | 1308 bool operator!=(Type v) const { return value != v; } |
1313 | 1309 |
1314 Type value; | 1310 Type value; |
1315 }; | 1311 }; |
1316 | 1312 |
1317 inline bool operator==(NotificationType::Type a, NotificationType b) { | 1313 inline bool operator==(NotificationType::Type a, NotificationType b) { |
1318 return a == b.value; | 1314 return a == b.value; |
1319 } | 1315 } |
1320 inline bool operator!=(NotificationType::Type a, NotificationType b) { | 1316 inline bool operator!=(NotificationType::Type a, NotificationType b) { |
1321 return a != b.value; | 1317 return a != b.value; |
1322 } | 1318 } |
1323 | 1319 |
1324 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ | 1320 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ |
OLD | NEW |