Add testing/scripts/OWNERS
[chromium-blink-merge.git] / extensions / browser / notification_types.h
blob6eee02e235b6e2f82c7c6d55c34b8e8498cb18f0
1 // Copyright 2014 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 EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
6 #define EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
8 #include "content/public/browser/notification_types.h"
10 #if !defined(ENABLE_EXTENSIONS)
11 #error "Extensions must be enabled"
12 #endif
14 namespace extensions {
16 // Only notifications fired by the extensions module should be here. The
17 // extensions module should not listen to notifications fired by the
18 // embedder.
19 enum NotificationType {
20 // WARNING: This need to match chrome/browser/chrome_notification_types.h.
21 NOTIFICATION_EXTENSIONS_START = content::NOTIFICATION_CONTENT_END,
23 // Sent when a CrxInstaller finishes. Source is the CrxInstaller that
24 // finished. The details are the extension which was installed.
25 NOTIFICATION_CRX_INSTALLER_DONE = NOTIFICATION_EXTENSIONS_START,
27 // Sent when the known installed extensions have all been loaded. In
28 // testing scenarios this can happen multiple times if extensions are
29 // unloaded and reloaded. The source is a BrowserContext*.
31 // DEPRECATED: Use ExtensionSystem::Get(browser_context)->ready().Post().
32 NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
34 // Sent when a new extension is loaded. The details are an Extension, and
35 // the source is a BrowserContext*.
37 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
38 NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
40 // An error occured while attempting to load an extension. The details are a
41 // string with details about why the load failed.
42 NOTIFICATION_EXTENSION_LOAD_ERROR,
44 // Sent when an extension is enabled. Under most circumstances, listeners will
45 // want to use ExtensionRegistryObserver::OnExtensionLoaded(). This
46 // notification is only fired when the "Enable" button is hit in the
47 // extensions tab. The details are an Extension, and the source is a
48 // BrowserContext*.
49 NOTIFICATION_EXTENSION_ENABLED,
51 // Sent when attempting to load a new extension, but they are disabled. The
52 // details are an Extension, and the source is a BrowserContext*.
53 NOTIFICATION_EXTENSION_UPDATE_DISABLED,
55 // Sent when an extension's permissions change. The details are an
56 // UpdatedExtensionPermissionsInfo, and the source is a BrowserContext*.
57 NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
59 // Sent immediately before new extensions are installed or existing
60 // extensions are updated. The details are an InstalledExtensionInfo, and the
61 // source is a BrowserContext*.
63 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
64 NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
66 // An error occured during extension install. The details are a string with
67 // details about why the install failed.
68 NOTIFICATION_EXTENSION_INSTALL_ERROR,
70 // Sent when an extension has been uninstalled. The details are an Extension,
71 // and the source is a BrowserContext*.
73 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
74 NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
76 // Sent when an extension uninstall is not allowed because the extension is
77 // not user manageable. The details are an Extension, and the source is a
78 // BrowserContext*.
79 NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
81 // Sent when an extension is unloaded. This happens when an extension is
82 // uninstalled or disabled. The details are an UnloadedExtensionInfo, and the
83 // source is a BrowserContext*.
85 // Note that when this notification is sent, the ExtensionService and the
86 // ExtensionRegistry have already removed the extension from their internal
87 // state.
89 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
90 NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
92 // Sent when an Extension object is removed from ExtensionService. This
93 // can happen when an extension is uninstalled, upgraded, or blacklisted,
94 // including all cases when the Extension is deleted. The details are an
95 // Extension, and the source is a BrowserContext*.
96 NOTIFICATION_EXTENSION_REMOVED,
98 // Sent after a new ExtensionHost* is created. The details are
99 // an ExtensionHost* and the source is a BrowserContext*.
100 NOTIFICATION_EXTENSION_HOST_CREATED,
102 // Sent before an ExtensionHost* is destroyed. The details are
103 // an ExtensionHost* and the source is a BrowserContext*.
104 NOTIFICATION_EXTENSION_HOST_DESTROYED,
106 // Sent by an ExtensionHost* when it has finished its initial page load,
107 // including any external resources.
108 // The details are an ExtensionHost* and the source is a BrowserContext*.
109 NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
111 // Sent by an ExtensionHost* when its render view requests closing through
112 // window.close(). The details are an ExtensionHost* and the source is a
113 // BrowserContext*.
114 NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
116 // Sent when extension render process ends (whether it crashes or closes). The
117 // details are an ExtensionHost* and the source is a BrowserContext*. Not sent
118 // during browser shutdown.
119 NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
121 // Sent when a background page is ready so other components can load.
122 NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
124 // Sent when the count of page actions has changed. Note that some of them
125 // may not apply to the current page. The source is a LocationBar*. There
126 // are no details.
127 NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED,
129 // Sent when a browser action's visibility has changed. The source is the
130 // ExtensionPrefs* that changed, and the details are a std::string with the
131 // extension's ID.
132 NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
134 // Sent when an extension command has been removed. The source is the
135 // BrowserContext* and the details is a std::pair of two std::string objects
136 // (an extension ID and the name of the command being removed).
137 NOTIFICATION_EXTENSION_COMMAND_REMOVED,
139 // Sent when an extension command has been added. The source is the
140 // BrowserContext* and the details is a std::pair of two std::string objects
141 // (an extension ID and the name of the command being added).
142 NOTIFICATION_EXTENSION_COMMAND_ADDED,
144 // Sent when an extension command shortcut for a browser action is activated
145 // on Mac. The source is the BrowserContext* and the details is a std::pair of
146 // a std::string containing an extension ID and a gfx::NativeWindow for the
147 // associated window.
148 NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC,
150 // Sent when an extension command shortcut for a page action is activated
151 // on Mac. The source is the BrowserContext* and the details is a std::pair of
152 // a
153 // std::string containing an extension ID and a gfx::NativeWindow for the
154 // associated window.
155 NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC,
157 // A new extension RenderViewHost has been registered. The details are
158 // the RenderViewHost*.
159 NOTIFICATION_EXTENSION_VIEW_REGISTERED,
161 // An extension RenderViewHost has been unregistered. The details are
162 // the RenderViewHost*.
163 NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
165 // Sent by an extension to notify the browser about the results of a unit
166 // test.
167 NOTIFICATION_EXTENSION_TEST_PASSED,
168 NOTIFICATION_EXTENSION_TEST_FAILED,
170 // Sent by extension test javascript code, typically in a browser test. The
171 // sender is a std::string representing the extension id, and the details
172 // are a std::string with some message. This is particularly useful when you
173 // want to have C++ code wait for javascript code to do something.
174 NOTIFICATION_EXTENSION_TEST_MESSAGE,
176 // Sent when an bookmarks extensions API function was successfully invoked.
177 // The source is the id of the extension that invoked the function, and the
178 // details are a pointer to the const BookmarksFunction in question.
179 NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
181 // Sent when a downloads extensions API event is fired. The source is an
182 // ExtensionDownloadsEventRouter::NotificationSource, and the details is a
183 // std::string containing json. Used for testing.
184 NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
186 // Sent when an omnibox extension has sent back omnibox suggestions. The
187 // source is the BrowserContext*, and the details are an
188 // extensions::api::omnibox::SendSuggestions::Params object.
189 NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
191 // Sent when the user accepts the input in an extension omnibox keyword
192 // session. The source is the BrowserContext*.
193 NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
195 // Sent when an omnibox extension has updated the default suggestion. The
196 // source is the BrowserContext*.
197 NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
199 // Sent when the extension updater starts checking for updates to installed
200 // extensions. The source is a BrowserContext*, and there are no details.
201 NOTIFICATION_EXTENSION_UPDATING_STARTED,
203 // The extension updater found an update and will attempt to download and
204 // install it. The source is a BrowserContext*, and the details are an
205 // extensions::UpdateDetails object with the extension id and version of the
206 // found update.
207 NOTIFICATION_EXTENSION_UPDATE_FOUND,
209 // Sent when there are new user scripts available. The details are a
210 // pointer to SharedMemory containing the new scripts.
211 NOTIFICATION_USER_SCRIPTS_UPDATED,
212 NOTIFICATION_EXTENSIONS_END
215 } // namespace extensions
217 #endif // EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_