| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 // This file describes various types used to describe and filter notifications | 8 // This file describes various types used to describe and filter notifications |
| 9 // that pass through the NotificationService. | 9 // that pass through the NotificationService. |
| 10 // | 10 // |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 // Sent before the repost form warning is brought up. | 957 // Sent before the repost form warning is brought up. |
| 958 // The source is a NavigationController. | 958 // The source is a NavigationController. |
| 959 REPOST_WARNING_SHOWN, | 959 REPOST_WARNING_SHOWN, |
| 960 | 960 |
| 961 #if defined(TOOLKIT_VIEWS) | 961 #if defined(TOOLKIT_VIEWS) |
| 962 // Sent when a bookmark's context menu is shown. Used to notify | 962 // Sent when a bookmark's context menu is shown. Used to notify |
| 963 // tests that the context menu has been created and shown. | 963 // tests that the context menu has been created and shown. |
| 964 BOOKMARK_CONTEXT_MENU_SHOWN, | 964 BOOKMARK_CONTEXT_MENU_SHOWN, |
| 965 #endif | 965 #endif |
| 966 | 966 |
| 967 // Password Store ---------------------------------------------------------- | |
| 968 // This notification is sent whenenever login entries stored in the password | |
| 969 // store are changed. The detail of this notification is a list of changes | |
| 970 // represented by a vector of PasswordStoreChange. Each change includes a | |
| 971 // change type (ADD, UPDATE, or REMOVE) as well as the | |
| 972 // |webkit_glue::PasswordForm|s that were affected. | |
| 973 LOGINS_CHANGED, | |
| 974 | |
| 975 // Count (must be last) ---------------------------------------------------- | 967 // Count (must be last) ---------------------------------------------------- |
| 976 // Used to determine the number of notification types. Not valid as | 968 // Used to determine the number of notification types. Not valid as |
| 977 // a type parameter when registering for or posting notifications. | 969 // a type parameter when registering for or posting notifications. |
| 978 NOTIFICATION_TYPE_COUNT | 970 NOTIFICATION_TYPE_COUNT |
| 979 }; | 971 }; |
| 980 | 972 |
| 981 // TODO(erg): Our notification system relies on implicit conversion. | 973 // TODO(erg): Our notification system relies on implicit conversion. |
| 982 NotificationType(Type v) : value(v) {} // NOLINT | 974 NotificationType(Type v) : value(v) {} // NOLINT |
| 983 | 975 |
| 984 bool operator==(NotificationType t) const { return value == t.value; } | 976 bool operator==(NotificationType t) const { return value == t.value; } |
| 985 bool operator!=(NotificationType t) const { return value != t.value; } | 977 bool operator!=(NotificationType t) const { return value != t.value; } |
| 986 | 978 |
| 987 // Comparison to explicit enum values. | 979 // Comparison to explicit enum values. |
| 988 bool operator==(Type v) const { return value == v; } | 980 bool operator==(Type v) const { return value == v; } |
| 989 bool operator!=(Type v) const { return value != v; } | 981 bool operator!=(Type v) const { return value != v; } |
| 990 | 982 |
| 991 Type value; | 983 Type value; |
| 992 }; | 984 }; |
| 993 | 985 |
| 994 inline bool operator==(NotificationType::Type a, NotificationType b) { | 986 inline bool operator==(NotificationType::Type a, NotificationType b) { |
| 995 return a == b.value; | 987 return a == b.value; |
| 996 } | 988 } |
| 997 inline bool operator!=(NotificationType::Type a, NotificationType b) { | 989 inline bool operator!=(NotificationType::Type a, NotificationType b) { |
| 998 return a != b.value; | 990 return a != b.value; |
| 999 } | 991 } |
| 1000 | 992 |
| 1001 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ | 993 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ |
| OLD | NEW |