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 | 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // This message is sent when a browser is closing. The source is a | 191 // This message is sent when a browser is closing. The source is a |
192 // Source<Browser> containing the affected Browser. Details is a boolean | 192 // Source<Browser> containing the affected Browser. Details is a boolean |
193 // that if true indicates that the application will be closed as a result of | 193 // that if true indicates that the application will be closed as a result of |
194 // this browser window closure (i.e. this was the last opened browser | 194 // this browser window closure (i.e. this was the last opened browser |
195 // window on win/linux). This is sent prior to BROWSER_CLOSED, and may be | 195 // window on win/linux). This is sent prior to BROWSER_CLOSED, and may be |
196 // sent more than once for a particular browser. | 196 // sent more than once for a particular browser. |
197 BROWSER_CLOSING, | 197 BROWSER_CLOSING, |
198 | 198 |
199 // This message is sent after a window has been closed. The source is a | 199 // This message is sent after a window has been closed. The source is a |
200 // Source<Browser> containing the affected Browser. Details is a boolean | 200 // Source<Browser> containing the affected Browser. Details is a boolean |
201 // that if true indicates that the application will be closed as a result of | 201 // that if true indicates that the last browser window has closed - this |
202 // this browser window closure (i.e. this was the last opened browser | 202 // does not indicate that the application is exiting (observers should |
203 // window on win/linux). Note that the boolean pointed to by details is | 203 // listen for APP_TERMINATING if they want to detect when the application |
204 // only valid for the duration of this call. | 204 // will shut down). Note that the boolean pointed to by details is only |
| 205 // valid for the duration of this call. |
205 BROWSER_CLOSED, | 206 BROWSER_CLOSED, |
206 | 207 |
207 // This message is sent when the last window considered to be an | 208 // This message is sent when the last window considered to be an |
208 // "application window" has been closed. Dependent/dialog/utility windows | 209 // "application window" has been closed. Dependent/dialog/utility windows |
209 // can use this as a way to know that they should also close. No source or | 210 // can use this as a way to know that they should also close. No source or |
210 // details are passed. | 211 // details are passed. |
211 ALL_APPWINDOWS_CLOSED, | 212 ALL_APPWINDOWS_CLOSED, |
212 | 213 |
213 #if defined(OS_MACOSX) | 214 #if defined(OS_MACOSX) |
214 // This message is sent when the application is made active (Mac OS X only | 215 // This message is sent when the application is made active (Mac OS X only |
215 // at present). No source or details are passed. | 216 // at present). No source or details are passed. |
216 APP_ACTIVATED, | 217 APP_ACTIVATED, |
| 218 #endif |
217 | 219 |
218 // This message is sent when the application is terminating (Mac OS X only | 220 // This message is sent when the application is terminating (the last |
219 // at present). No source or details are passed. | 221 // browser window has shutdown as part of an explicit user-initiated exit, |
| 222 // or the user closed the last browser window on Windows/Linux and there are |
| 223 // no BackgroundContents keeping the browser running). No source or details |
| 224 // are passed. |
220 APP_TERMINATING, | 225 APP_TERMINATING, |
221 | 226 |
| 227 #if defined(OS_MACOSX) |
222 // This notification is sent when the app has no key window, such as when | 228 // This notification is sent when the app has no key window, such as when |
223 // all windows are closed but the app is still active. No source or details | 229 // all windows are closed but the app is still active. No source or details |
224 // are provided. | 230 // are provided. |
225 NO_KEY_WINDOW, | 231 NO_KEY_WINDOW, |
226 #endif | 232 #endif |
227 | 233 |
228 // This is sent when the user has chosen to exit the app, but before any | 234 // This is sent when the user has chosen to exit the app, but before any |
229 // browsers have closed. This is only sent if the user chooses the exit menu | 235 // browsers have closed. This is only sent if the user chooses the exit menu |
230 // item, not if Chrome exists by some other means (such as the user closing | 236 // item, not if Chrome exists by some other means (such as the user closing |
231 // the last window). The source and details are unspecified. | 237 // the last window). The source and details are unspecified. |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 }; | 1109 }; |
1104 | 1110 |
1105 inline bool operator==(NotificationType::Type a, NotificationType b) { | 1111 inline bool operator==(NotificationType::Type a, NotificationType b) { |
1106 return a == b.value; | 1112 return a == b.value; |
1107 } | 1113 } |
1108 inline bool operator!=(NotificationType::Type a, NotificationType b) { | 1114 inline bool operator!=(NotificationType::Type a, NotificationType b) { |
1109 return a != b.value; | 1115 return a != b.value; |
1110 } | 1116 } |
1111 | 1117 |
1112 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ | 1118 #endif // CHROME_COMMON_NOTIFICATION_TYPE_H_ |
OLD | NEW |