OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
7 | 7 |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // was created. | 171 // was created. |
172 virtual void DocumentAvailableInMainFrame() {} | 172 virtual void DocumentAvailableInMainFrame() {} |
173 | 173 |
174 // This method is invoked once the onload handler of the main frame has | 174 // This method is invoked once the onload handler of the main frame has |
175 // completed. | 175 // completed. |
176 virtual void DocumentOnLoadCompletedInMainFrame() {} | 176 virtual void DocumentOnLoadCompletedInMainFrame() {} |
177 | 177 |
178 // This method is invoked when the document in the given frame finished | 178 // This method is invoked when the document in the given frame finished |
179 // loading. At this point, scripts marked as defer were executed, and | 179 // loading. At this point, scripts marked as defer were executed, and |
180 // content scripts marked "document_end" get injected into the frame. | 180 // content scripts marked "document_end" get injected into the frame. |
181 virtual void DocumentLoadedInFrame(int64 frame_id, | 181 virtual void DocumentLoadedInFrame(RenderFrameHost* render_frame_host) {} |
182 RenderViewHost* render_view_host) {} | |
183 | 182 |
184 // This method is invoked when the navigation is done, i.e. the spinner of | 183 // This method is invoked when the navigation is done, i.e. the spinner of |
185 // the tab will stop spinning, and the onload event was dispatched. | 184 // the tab will stop spinning, and the onload event was dispatched. |
186 // | 185 // |
187 // If the WebContents is displaying replacement content, e.g. network error | 186 // If the WebContents is displaying replacement content, e.g. network error |
188 // pages, DidFinishLoad is invoked for frames that were not sending | 187 // pages, DidFinishLoad is invoked for frames that were not sending |
189 // navigational events before. It is safe to ignore these events. | 188 // navigational events before. It is safe to ignore these events. |
190 virtual void DidFinishLoad(int64 frame_id, | 189 virtual void DidFinishLoad(RenderFrameHost* render_frame_host, |
191 const GURL& validated_url, | 190 const GURL& validated_url) {} |
192 bool is_main_frame, | |
193 RenderViewHost* render_view_host) {} | |
194 | 191 |
195 // This method is like DidFinishLoad, but when the load failed or was | 192 // This method is like DidFinishLoad, but when the load failed or was |
196 // cancelled, e.g. window.stop() is invoked. | 193 // cancelled, e.g. window.stop() is invoked. |
197 virtual void DidFailLoad(int64 frame_id, | 194 virtual void DidFailLoad(RenderFrameHost* render_frame_host, |
198 const GURL& validated_url, | 195 const GURL& validated_url, |
199 bool is_main_frame, | |
200 int error_code, | 196 int error_code, |
201 const base::string16& error_description, | 197 const base::string16& error_description) {} |
202 RenderViewHost* render_view_host) {} | |
203 | 198 |
204 // This method is invoked when content was loaded from an in-memory cache. | 199 // This method is invoked when content was loaded from an in-memory cache. |
205 virtual void DidLoadResourceFromMemoryCache( | 200 virtual void DidLoadResourceFromMemoryCache( |
206 const LoadFromMemoryCacheDetails& details) {} | 201 const LoadFromMemoryCacheDetails& details) {} |
207 | 202 |
208 // This method is invoked when a response has been received for a resource | 203 // This method is invoked when a response has been received for a resource |
209 // request. | 204 // request. |
210 virtual void DidGetResourceResponseStart( | 205 virtual void DidGetResourceResponseStart( |
211 const ResourceRequestDetails& details) {} | 206 const ResourceRequestDetails& details) {} |
212 | 207 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 void ResetWebContents(); | 359 void ResetWebContents(); |
365 | 360 |
366 WebContentsImpl* web_contents_; | 361 WebContentsImpl* web_contents_; |
367 | 362 |
368 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 363 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
369 }; | 364 }; |
370 | 365 |
371 } // namespace content | 366 } // namespace content |
372 | 367 |
373 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 368 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |