1 // Copyright (c) 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 CONTENT_PUBLIC_BROWSER_NOTIFICATION_TYPES_H_
6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_TYPES_H_
8 // This file describes various types used to describe and filter notifications
9 // that pass through the NotificationService.
11 // Only notifications that are fired from the content module should be here. We
12 // should never have a notification that is fired by the embedder and listened
16 enum NotificationType
{
17 NOTIFICATION_CONTENT_START
= 0,
19 // General -----------------------------------------------------------------
21 // Special signal value to represent an interest in all notifications.
22 // Not valid when posting a notification.
23 NOTIFICATION_ALL
= NOTIFICATION_CONTENT_START
,
25 // NavigationController ----------------------------------------------------
27 // A new pending navigation has been created. Pending entries are created
28 // when the user requests the navigation. We don't know if it will actually
29 // happen until it does (at this point, it will be "committed." Note that
30 // renderer- initiated navigations such as link clicks will never be
33 // This notification is called after the pending entry is created, but
34 // before we actually try to navigate. The source will be the
35 // NavigationController that owns the pending entry, and the details
36 // will be a NavigationEntry.
37 NOTIFICATION_NAV_ENTRY_PENDING
,
39 // A new non-pending navigation entry has been created. This will
40 // correspond to one NavigationController entry being created (in the case
41 // of new navigations) or renavigated to (for back/forward navigations).
43 // The source will be the navigation controller doing the commit. The
44 // details will be NavigationController::LoadCommittedDetails.
45 // DEPRECATED: Use WebContentsObserver::NavigationEntryCommitted()
46 NOTIFICATION_NAV_ENTRY_COMMITTED
,
48 // Indicates that the NavigationController given in the Source has
49 // decreased its back/forward list count by removing entries from either
50 // the front or back of its list. This is usually the result of going back
51 // and then doing a new navigation, meaning all the "forward" items are
54 // This normally happens as a result of a new navigation. It will be
55 // followed by a NAV_ENTRY_COMMITTED message for the new page that
56 // caused the pruning. It could also be a result of removing an item from
57 // the list to fix up after interstitials.
59 // The details are NavigationController::PrunedDetails.
60 NOTIFICATION_NAV_LIST_PRUNED
,
62 // Indicates that a NavigationEntry has changed. The source will be the
63 // NavigationController that owns the NavigationEntry. The details will be
64 // a NavigationController::EntryChangedDetails struct.
66 // This will NOT be sent on navigation, interested parties should also
67 // listen for NAV_ENTRY_COMMITTED to handle that case. This will be
68 // sent when the entry is updated outside of navigation (like when a new
70 NOTIFICATION_NAV_ENTRY_CHANGED
,
72 // Other load-related (not from NavigationController) ----------------------
74 // Corresponds to ViewHostMsg_DocumentOnLoadCompletedInMainFrame. The source
75 // is the WebContents.
76 // DEPRECATED: Use WebContentsObserver::DocumentOnLoadCompletedInMainFrame()
77 NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME
,
79 // A content load is starting. The source will be a
80 // Source<NavigationController> corresponding to the tab in which the load
81 // is occurring. No details are expected for this notification.
82 // DEPRECATED: Use WebContentsObserver::DidStartLoading()
83 NOTIFICATION_LOAD_START
,
85 // A content load has stopped. The source will be a
86 // Source<NavigationController> corresponding to the tab in which the load
87 // is occurring. Details in the form of a LoadNotificationDetails object
89 // DEPRECATED: Use WebContentsObserver::DidStopLoading()
90 NOTIFICATION_LOAD_STOP
,
92 // A response has been received for a resource request. The source will be
93 // a Source<WebContents> corresponding to the tab in which the request was
94 // issued. Details in the form of a ResourceRequestDetails object are
96 // DEPRECATED: Use WebContentsObserver::DidGetResourceResponseStart()
97 NOTIFICATION_RESOURCE_RESPONSE_STARTED
,
99 // A redirect was received while requesting a resource. The source will be
100 // a Source<WebContents> corresponding to the tab in which the request was
101 // issued. Details in the form of a ResourceRedirectDetails are provided.
102 // DEPRECATED: Use WebContentsObserver::DidGetRedirectForResourceRequest()
103 NOTIFICATION_RESOURCE_RECEIVED_REDIRECT
,
105 // WebContents ---------------------------------------------------------------
107 // This notification is sent when a render view host has connected to a
108 // renderer process. The source is a Source<WebContents> with a pointer to
109 // the WebContents. A WEB_CONTENTS_DISCONNECTED notification is
110 // guaranteed before the source pointer becomes junk. No details are
112 // DEPRECATED: Use WebContentsObserver::RenderViewReady()
113 NOTIFICATION_WEB_CONTENTS_CONNECTED
,
115 // This message is sent after a WebContents is disconnected from the
116 // renderer process. The source is a Source<WebContents> with a pointer to
117 // the WebContents (the pointer is usable). No details are expected.
118 // DEPRECATED: This is fired in two situations: when the render process
119 // crashes, in which case use WebContentsObserver::RenderProcessGone, and when
120 // the WebContents is being torn down, in which case use
121 // WebContentsObserver::WebContentsDestroyed()
122 NOTIFICATION_WEB_CONTENTS_DISCONNECTED
,
124 // This notification is sent after WebContents' title is updated. The source
125 // is a Source<WebContents> with a pointer to the WebContents. The details
126 // is a std::pair<NavigationEntry*, bool> that contains more information.
127 // DEPRECATED: Use WebContentsObserver::TitleWasSet()
128 NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED
,
130 // This notification is sent when a WebContents is being destroyed. Any
131 // object holding a reference to a WebContents can listen to that
132 // notification to properly reset the reference. The source is a
133 // Source<WebContents>.
134 // DEPRECATED: Use WebContentsObserver::WebContentsDestroyed()
135 NOTIFICATION_WEB_CONTENTS_DESTROYED
,
137 // A RenderViewHost was created for a WebContents. The source is the
138 // associated WebContents, and the details is the RenderViewHost
140 NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED
,
142 // Indicates that a RenderProcessHost was created and its handle is now
143 // available. The source will be the RenderProcessHost that corresponds to
145 NOTIFICATION_RENDERER_PROCESS_CREATED
,
147 // Indicates that a RenderProcessHost is destructing. The source will be the
148 // RenderProcessHost that corresponds to the process.
149 NOTIFICATION_RENDERER_PROCESS_TERMINATED
,
151 // Indicates that a render process is starting to exit, such that it should
152 // not be used for future navigations. The source will be the
153 // RenderProcessHost that corresponds to the process.
154 NOTIFICATION_RENDERER_PROCESS_CLOSING
,
156 // Indicates that a render process was closed (meaning it exited, but the
157 // RenderProcessHost might be reused). The source will be the corresponding
158 // RenderProcessHost. The details will be a RendererClosedDetails struct.
159 // This may get sent along with RENDERER_PROCESS_TERMINATED.
160 NOTIFICATION_RENDERER_PROCESS_CLOSED
,
162 // Indicates that a RenderWidgetHost has become unresponsive for a period of
163 // time. The source will be the RenderWidgetHost that corresponds to the
164 // hung view, and no details are expected.
165 NOTIFICATION_RENDER_WIDGET_HOST_HANG
,
167 // This is sent when a RenderWidgetHost is being destroyed. The source is
168 // the RenderWidgetHost, the details are not used.
169 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED
,
171 // Sent after the backing store has been updated but before the widget has
172 // painted. The source is the RenderWidgetHost, the details are not used.
173 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE
,
175 // This notifies the observer that a HandleInputEventACK was received. The
176 // source is the RenderWidgetHost, the details are the type of event
178 // Note: The RenderWidgetHost may be deallocated at this point.
179 // Used only in testing.
180 NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_INPUT_EVENT_ACK
,
182 // Sent from RenderViewHost::ClosePage. The hosted RenderView has
183 // processed the onbeforeunload handler and is about to be sent a
184 // ViewMsg_ClosePage message to complete the tear-down process. The source
185 // is the RenderViewHost sending the message, and no details are provided.
186 // Note: This message is not sent in response to RenderView closure
187 // initiated by window.close().
188 NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW
,
190 // This notifies the observer that the drag operation ack in a drag and
191 // drop operation was received. The source is the RenderViewHost.
192 // Note: Used only in testing.
193 NOTIFICATION_RENDER_VIEW_HOST_DID_RECEIVE_DRAG_TARGET_DROP_ACK
,
195 // Indicates a RenderWidgetHost has been hidden or restored. The source is
196 // the RWH whose visibility changed, the details is a bool set to true if
197 // the new state is "visible."
198 NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED
,
200 // The focused element inside a page has changed. The source is the
201 // RenderViewHost. The details is a Details<const bool> that indicates whether
202 // or not an editable node was focused.
203 NOTIFICATION_FOCUS_CHANGED_IN_PAGE
,
205 // Notification from WebContents that we have received a response from the
206 // renderer in response to a dom automation controller action. The source is
207 // the RenderViewHost, and the details is a DomOperationNotificationDetails.
208 NOTIFICATION_DOM_OPERATION_RESPONSE
,
210 // Custom notifications used by the embedder should start from here.
211 NOTIFICATION_CONTENT_END
,
214 } // namespace content
216 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_TYPES_H_