OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_COMMON_NOTIFICATION_TYPE_H_ | 5 #ifndef CONTENT_COMMON_NOTIFICATION_TYPE_H_ |
6 #define CONTENT_COMMON_NOTIFICATION_TYPE_H_ | 6 #define CONTENT_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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 | 1308 |
1309 #if defined(TOUCH_UI) | 1309 #if defined(TOUCH_UI) |
1310 // Sent when an API for hiding the keyboard is invoked from JavaScript code. | 1310 // Sent when an API for hiding the keyboard is invoked from JavaScript code. |
1311 HIDE_KEYBOARD_INVOKED, | 1311 HIDE_KEYBOARD_INVOKED, |
1312 #endif | 1312 #endif |
1313 | 1313 |
1314 // Protocol Handler Registry ----------------------------------------------- | 1314 // Protocol Handler Registry ----------------------------------------------- |
1315 // Sent when a ProtocolHandlerRegistry is changed. | 1315 // Sent when a ProtocolHandlerRegistry is changed. |
1316 PROTOCOL_HANDLER_REGISTRY_CHANGED, | 1316 PROTOCOL_HANDLER_REGISTRY_CHANGED, |
1317 | 1317 |
| 1318 // Sent when a new profile is added. |
| 1319 PROFILE_ADDED, |
| 1320 |
1318 // Count (must be last) ---------------------------------------------------- | 1321 // Count (must be last) ---------------------------------------------------- |
1319 // Used to determine the number of notification types. Not valid as | 1322 // Used to determine the number of notification types. Not valid as |
1320 // a type parameter when registering for or posting notifications. | 1323 // a type parameter when registering for or posting notifications. |
1321 NOTIFICATION_TYPE_COUNT | 1324 NOTIFICATION_TYPE_COUNT |
1322 }; | 1325 }; |
1323 | 1326 |
1324 // TODO(erg): Our notification system relies on implicit conversion. | 1327 // TODO(erg): Our notification system relies on implicit conversion. |
1325 NotificationType(Type v) : value(v) {} // NOLINT | 1328 NotificationType(Type v) : value(v) {} // NOLINT |
1326 | 1329 |
1327 bool operator==(NotificationType t) const { return value == t.value; } | 1330 bool operator==(NotificationType t) const { return value == t.value; } |
1328 bool operator!=(NotificationType t) const { return value != t.value; } | 1331 bool operator!=(NotificationType t) const { return value != t.value; } |
1329 | 1332 |
1330 // Comparison to explicit enum values. | 1333 // Comparison to explicit enum values. |
1331 bool operator==(Type v) const { return value == v; } | 1334 bool operator==(Type v) const { return value == v; } |
1332 bool operator!=(Type v) const { return value != v; } | 1335 bool operator!=(Type v) const { return value != v; } |
1333 | 1336 |
1334 Type value; | 1337 Type value; |
1335 }; | 1338 }; |
1336 | 1339 |
1337 inline bool operator==(NotificationType::Type a, NotificationType b) { | 1340 inline bool operator==(NotificationType::Type a, NotificationType b) { |
1338 return a == b.value; | 1341 return a == b.value; |
1339 } | 1342 } |
1340 inline bool operator!=(NotificationType::Type a, NotificationType b) { | 1343 inline bool operator!=(NotificationType::Type a, NotificationType b) { |
1341 return a != b.value; | 1344 return a != b.value; |
1342 } | 1345 } |
1343 | 1346 |
1344 #endif // CONTENT_COMMON_NOTIFICATION_TYPE_H_ | 1347 #endif // CONTENT_COMMON_NOTIFICATION_TYPE_H_ |
OLD | NEW |