Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: extensions/browser/notification_types.h

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (extension-notifications) rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « extensions/browser/lazy_background_task_queue.cc ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
6 #define EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
7
8 #include "content/public/browser/notification_types.h"
9
10 namespace extensions {
11
12 // Only notifications fired by the extensions module should be here. The
13 // extensions module should not listen to notifications fired by the
14 // embedder.
15 enum NotificationType {
16 NOTIFICATION_EXTENSIONS_START = content::NOTIFICATION_CONTENT_END,
17
18 // Sent when a CrxInstaller finishes. Source is the CrxInstaller that
19 // finished. The details are the extension which was installed.
20 NOTIFICATION_CRX_INSTALLER_DONE = NOTIFICATION_EXTENSIONS_START,
21
22 // Sent when the known installed extensions have all been loaded. In
23 // testing scenarios this can happen multiple times if extensions are
24 // unloaded and reloaded. The source is a BrowserContext*.
25 //
26 // DEPRECATED: Use ExtensionSystem::Get(browser_context)->ready().Post().
27 NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
28
29 // Sent when a new extension is loaded. The details are an Extension, and
30 // the source is a BrowserContext*.
31 //
32 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
33 NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
34
35 // An error occured while attempting to load an extension. The details are a
36 // string with details about why the load failed.
37 NOTIFICATION_EXTENSION_LOAD_ERROR,
38
39 // Sent when an extension is enabled. Under most circumstances, listeners will
40 // want to use ExtensionRegistryObserver::OnExtensionLoaded(). This
41 // notification is only fired when the "Enable" button is hit in the
42 // extensions tab. The details are an Extension, and the source is a
43 // BrowserContext*.
44 NOTIFICATION_EXTENSION_ENABLED,
45
46 // Sent when attempting to load a new extension, but they are disabled. The
47 // details are an Extension, and the source is a BrowserContext*.
48 NOTIFICATION_EXTENSION_UPDATE_DISABLED,
49
50 // Sent when an extension's permissions change. The details are an
51 // UpdatedExtensionPermissionsInfo, and the source is a BrowserContext*.
52 NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
53
54 // Sent immediately before new extensions are installed or existing
55 // extensions are updated. The details are an InstalledExtensionInfo, and the
56 // source is a BrowserContext*.
57 //
58 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
59 NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
60
61 // An error occured during extension install. The details are a string with
62 // details about why the install failed.
63 NOTIFICATION_EXTENSION_INSTALL_ERROR,
64
65 // Sent when an extension has been uninstalled. The details are an Extension,
66 // and the source is a BrowserContext*.
67 //
68 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
69 NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
70
71 // Sent when an extension uninstall is not allowed because the extension is
72 // not user manageable. The details are an Extension, and the source is a
73 // BrowserContext*.
74 NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
75
76 // Sent when an extension is unloaded. This happens when an extension is
77 // uninstalled or disabled. The details are an UnloadedExtensionInfo, and the
78 // source is a BrowserContext*.
79 //
80 // Note that when this notification is sent, the ExtensionService and the
81 // ExtensionRegistry have already removed the extension from their internal
82 // state.
83 //
84 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
85 NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
86
87 // Sent when an Extension object is removed from ExtensionService. This
88 // can happen when an extension is uninstalled, upgraded, or blacklisted,
89 // including all cases when the Extension is deleted. The details are an
90 // Extension, and the source is a BrowserContext*.
91 NOTIFICATION_EXTENSION_REMOVED,
92
93 // Sent after a new ExtensionHost* is created. The details are
94 // an ExtensionHost* and the source is a BrowserContext*.
95 NOTIFICATION_EXTENSION_HOST_CREATED,
96
97 // Sent before an ExtensionHost* is destroyed. The details are
98 // an ExtensionHost* and the source is a BrowserContext*.
99 NOTIFICATION_EXTENSION_HOST_DESTROYED,
100
101 // Sent by an ExtensionHost* when it has finished its initial page load,
102 // including any external resources.
103 // The details are an ExtensionHost* and the source is a BrowserContext*.
104 NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
105
106 // Sent by an ExtensionHost* when its render view requests closing through
107 // window.close(). The details are an ExtensionHost* and the source is a
108 // BrowserContext*.
109 NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
110
111 // Sent when extension render process ends (whether it crashes or closes). The
112 // details are an ExtensionHost* and the source is a BrowserContext*. Not sent
113 // during browser shutdown.
114 NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
115
116 // Sent when a background page is ready so other components can load.
117 NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
118
119 // Sent when a browser action's state has changed. The source is the
120 // ExtensionAction* that changed. The details are the BrowserContext* that the
121 // browser action belongs to.
122 NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
123
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,
128
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,
133
134 // Sent when a page action's visibility has changed. The source is the
135 // ExtensionAction* that changed. The details are a WebContents*.
136 NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
137
138 // Sent when a system indicator action's state has changed. The source is the
139 // BrowserContext* that the browser action belongs to. The details are the
140 // ExtensionAction* that changed.
141 NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
142
143 // Sent when an extension command has been removed. The source is the
144 // BrowserContext* and the details is a std::pair of two std::string objects
145 // (an extension ID and the name of the command being removed).
146 NOTIFICATION_EXTENSION_COMMAND_REMOVED,
147
148 // Sent when an extension command has been added. The source is the
149 // BrowserContext* and the details is a std::pair of two std::string objects
150 // (an extension ID and the name of the command being added).
151 NOTIFICATION_EXTENSION_COMMAND_ADDED,
152
153 // Sent when an extension command shortcut for a browser action is activated
154 // on Mac. The source is the BrowserContext* and the details is a std::pair of
155 // a std::string containing an extension ID and a gfx::NativeWindow for the
156 // associated window.
157 NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC,
158
159 // Sent when an extension command shortcut for a page action is activated
160 // on Mac. The source is the BrowserContext* and the details is a std::pair of
161 // a
162 // std::string containing an extension ID and a gfx::NativeWindow for the
163 // associated window.
164 NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC,
165
166 // A new extension RenderViewHost has been registered. The details are
167 // the RenderViewHost*.
168 NOTIFICATION_EXTENSION_VIEW_REGISTERED,
169
170 // An extension RenderViewHost has been unregistered. The details are
171 // the RenderViewHost*.
172 NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
173
174 // Sent by an extension to notify the browser about the results of a unit
175 // test.
176 NOTIFICATION_EXTENSION_TEST_PASSED,
177 NOTIFICATION_EXTENSION_TEST_FAILED,
178
179 // Sent by extension test javascript code, typically in a browser test. The
180 // sender is a std::string representing the extension id, and the details
181 // are a std::string with some message. This is particularly useful when you
182 // want to have C++ code wait for javascript code to do something.
183 NOTIFICATION_EXTENSION_TEST_MESSAGE,
184
185 // Sent when an bookmarks extensions API function was successfully invoked.
186 // The source is the id of the extension that invoked the function, and the
187 // details are a pointer to the const BookmarksFunction in question.
188 NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
189
190 // Sent when a downloads extensions API event is fired. The source is an
191 // ExtensionDownloadsEventRouter::NotificationSource, and the details is a
192 // std::string containing json. Used for testing.
193 NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
194
195 // Sent when an omnibox extension has sent back omnibox suggestions. The
196 // source is the BrowserContext*, and the details are an
197 // extensions::api::omnibox::SendSuggestions::Params object.
198 NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
199
200 // Sent when the user accepts the input in an extension omnibox keyword
201 // session. The source is the BrowserContext*.
202 NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
203
204 // Sent when an omnibox extension has updated the default suggestion. The
205 // source is the BrowserContext*.
206 NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
207
208 // Sent when the extension updater starts checking for updates to installed
209 // extensions. The source is a BrowserContext*, and there are no details.
210 NOTIFICATION_EXTENSION_UPDATING_STARTED,
211
212 // The extension updater found an update and will attempt to download and
213 // install it. The source is a BrowserContext*, and the details are an
214 // extensions::UpdateDetails object with the extension id and version of the
215 // found update.
216 NOTIFICATION_EXTENSION_UPDATE_FOUND,
217
218 // Sent when there are new user scripts available. The details are a
219 // pointer to SharedMemory containing the new scripts.
220 NOTIFICATION_USER_SCRIPTS_UPDATED,
221 NOTIFICATION_EXTENSIONS_END
222 };
223
224 } // namespace extensions
225
226 #endif // EXTENSIONS_BROWSER_NOTIFICATION_TYPES_H_
OLDNEW
« no previous file with comments | « extensions/browser/lazy_background_task_queue.cc ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698