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