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