1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
6 #define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
8 #include "build/build_config.h"
9 #include "extensions/buildflags/buildflags.h"
11 #if BUILDFLAG(ENABLE_EXTENSIONS)
12 #include "extensions/browser/notification_types.h"
14 #include "content/public/browser/notification_types.h"
17 #if BUILDFLAG(ENABLE_EXTENSIONS)
18 #define PREVIOUS_END extensions::NOTIFICATION_EXTENSIONS_END
20 #define PREVIOUS_END content::NOTIFICATION_CONTENT_END
26 // ** The notification system is deprecated, obsolete, and is slowly being
27 // ** removed. See https://crbug.com/268984.
29 // ** Please don't add any new notification types, and please help migrate
30 // ** existing uses of the notification types below to use the Observer and
31 // ** Callback patterns.
36 enum NotificationType {
37 NOTIFICATION_CHROME_START = PREVIOUS_END,
39 // Browser-window ----------------------------------------------------------
41 // This message is sent after a window has been opened. The source is a
42 // Source<Browser> containing the affected Browser. No details are
44 // DEPRECATED: Use BrowserListObserver::OnBrowserAdded()
45 NOTIFICATION_BROWSER_OPENED = NOTIFICATION_CHROME_START,
47 // This message is sent when closing a browser has been cancelled, either by
48 // the user cancelling a beforeunload dialog, or IsClosingPermitted()
49 // disallowing closing. This notification implies that no BROWSER_CLOSING or
50 // BROWSER_CLOSED notification will be sent.
51 // The source is a Source<Browser> containing the affected browser. No details
53 NOTIFICATION_BROWSER_CLOSE_CANCELLED,
55 // Sent when the language (English, French...) for a page has been detected.
56 // The details Details<std::string> contain the ISO 639-1 language code and
57 // the source is Source<WebContents>.
58 NOTIFICATION_TAB_LANGUAGE_DETERMINED,
60 // The user has changed the browser theme. The source is a
61 // Source<ThemeService>. There are no details.
62 NOTIFICATION_BROWSER_THEME_CHANGED,
64 // Application-wide ----------------------------------------------------------
66 // This message is sent when the application is terminating (the last
67 // browser window has shutdown as part of an explicit user-initiated exit,
68 // or the user closed the last browser window on Windows/Linux and there are
69 // no BackgroundContents keeping the browser running). No source or details
71 NOTIFICATION_APP_TERMINATING,
73 #if defined(OS_MACOSX)
74 // This notification is sent when the app has no key window, such as when
75 // all windows are closed but the app is still active. No source or details
77 NOTIFICATION_NO_KEY_WINDOW,
80 // This is sent when the user has chosen to exit the app, but before any
81 // browsers have closed. This is sent if the user chooses to exit (via exit
82 // menu item or keyboard shortcut) or to restart the process (such as in flags
83 // page), not if Chrome exits by some other means (such as the user closing
84 // the last window). No source or details are passed.
86 // Note that receiving this notification does not necessarily mean the process
87 // will exit because the shutdown process can be cancelled by an unload
88 // handler. Use APP_TERMINATING for such needs.
89 NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
91 // Authentication ----------------------------------------------------------
93 // This is sent when a login prompt is shown. The source is the
94 // Source<NavigationController> for the tab in which the prompt is shown.
95 // Details are a LoginNotificationDetails which provide the LoginHandler
96 // that should be given authentication.
97 NOTIFICATION_AUTH_NEEDED,
99 // This is sent when authentication credentials have been supplied (either
100 // by the user or by an automation service), but before we've actually
101 // received another response from the server. The source is the
102 // Source<NavigationController> for the tab in which the prompt was shown.
103 // Details are an AuthSuppliedLoginNotificationDetails which provide the
104 // LoginHandler that should be given authentication as well as the supplied
105 // username and password.
106 NOTIFICATION_AUTH_SUPPLIED,
108 // This is sent when an authentication request has been dismissed without
109 // supplying credentials (either by the user or by an automation service).
110 // The source is the Source<NavigationController> for the tab in which the
111 // prompt was shown. Details are a LoginNotificationDetails which provide
112 // the LoginHandler that should be cancelled.
113 NOTIFICATION_AUTH_CANCELLED,
115 // Profiles -----------------------------------------------------------------
117 // Sent after a Profile has been created. This notification is sent both for
118 // normal and OTR profiles.
119 // The details are none and the source is the new profile.
120 NOTIFICATION_PROFILE_CREATED,
122 // Use ProfileManagerObserver::OnProfileAdded instead of this notification.
123 // Sent after a Profile has been added to ProfileManager.
124 // The details are none and the source is the new profile.
125 NOTIFICATION_PROFILE_ADDED,
127 // Use KeyedServiceShutdownNotifier instead this notification type (you did
128 // read the comment at the top of the file, didn't you?).
129 // Sent before a Profile is destroyed. This notification is sent both for
130 // normal and OTR profiles.
131 // The details are none and the source is a Profile*.
132 NOTIFICATION_PROFILE_DESTROYED,
134 // Printing ----------------------------------------------------------------
136 // Notification from PrintJob that an event occurred. It can be that a page
137 // finished printing or that the print job failed. Details is
138 // PrintJob::EventDetails. Source is a PrintJob.
139 NOTIFICATION_PRINT_JOB_EVENT,
141 // Sent when a PrintJob has been released.
142 // Source is the WebContents that holds the print job.
143 NOTIFICATION_PRINT_JOB_RELEASED,
145 // Misc --------------------------------------------------------------------
147 #if defined(OS_CHROMEOS)
148 // Sent immediately after the logged-in user's profile is ready.
149 // The details are a Profile object.
150 NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
152 // Sent when a network error message is displayed on the WebUI login screen.
153 // First paint event of this fires NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE.
154 NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
156 // Sent when the specific part of login/lock WebUI is considered to be
157 // visible. That moment is tracked as the first paint event after one of the:
158 // NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN
160 // Possible series of notifications:
161 // 1. Boot into fresh OOBE
162 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
163 // 2. Boot into user pods list (normal boot). Same for lock screen.
164 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
165 // 3. Boot into GAIA sign in UI (user pods display disabled or no users):
166 // if no network is connected or flaky network
167 // (NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN +
168 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE)
169 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
170 // 4. Boot into retail mode
171 // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
172 NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
174 // Send when kiosk auto-launch warning screen is visible.
175 NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE,
177 // Send when kiosk auto-launch warning screen had completed.
178 NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_COMPLETED,
180 // Send when consumer kiosk has been enabled.
181 NOTIFICATION_KIOSK_ENABLED,
183 // Sent when kiosk app list is loaded in UI.
184 NOTIFICATION_KIOSK_APPS_LOADED,
186 // Sent when the screen lock state has changed. The source is
187 // ScreenLocker and the details is a bool specifing that the
188 // screen is locked. When details is a false, the source object
189 // is being deleted, so the receiver shouldn't use the screen locker
191 NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
194 #if defined(TOOLKIT_VIEWS)
195 // Notification that the nested loop using during tab dragging has returned.
197 NOTIFICATION_TAB_DRAG_LOOP_DONE,
200 // Sent when the applications in the NTP app launcher have been reordered.
201 // The details, if not NoDetails, is the std::string ID of the extension that
203 NOTIFICATION_APP_LAUNCHER_REORDERED,
205 // Sent when an app is installed and an NTP has been shown. Source is the
206 // WebContents that was shown, and Details is the string ID of the extension
207 // which was installed.
208 NOTIFICATION_APP_INSTALLED_TO_NTP,
211 // Currently only Content and Chrome define and use notifications.
212 // Custom notifications not belonging to Content and Chrome should start
214 NOTIFICATION_CHROME_END,
217 } // namespace chrome
222 // ** The notification system is deprecated, obsolete, and is slowly being
223 // ** removed. See https://crbug.com/268984.
225 // ** Please don't add any new notification types, and please help migrate
226 // ** existing uses of the notification types below to use the Observer and
227 // ** Callback patterns.
230 #endif // CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_