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_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // AttemptToClosePage. This is called before a cross-site request or before | 83 // AttemptToClosePage. This is called before a cross-site request or before |
84 // a tab/window is closed (as indicated by the first parameter) to allow the | 84 // a tab/window is closed (as indicated by the first parameter) to allow the |
85 // appropriate renderer to approve or deny the request. |proceed| indicates | 85 // appropriate renderer to approve or deny the request. |proceed| indicates |
86 // whether the user chose to proceed. |proceed_time| is the time when the | 86 // whether the user chose to proceed. |proceed_time| is the time when the |
87 // request was allowed to proceed. | 87 // request was allowed to proceed. |
88 virtual void ShouldClosePage( | 88 virtual void ShouldClosePage( |
89 bool for_cross_site_transition, | 89 bool for_cross_site_transition, |
90 bool proceed, | 90 bool proceed, |
91 const base::TimeTicks& proceed_time) = 0; | 91 const base::TimeTicks& proceed_time) = 0; |
92 | 92 |
93 // Called by ResourceDispatcherHost when a response for a pending cross-site | |
94 // request is received. The ResourceDispatcherHost will pause the response | |
95 // until the onunload handler of the previous renderer is run. | |
96 virtual void OnCrossSiteResponse(int new_render_process_host_id, | |
97 int new_request_id) = 0; | |
98 | |
99 protected: | 93 protected: |
100 virtual ~RendererManagement() {} | 94 virtual ~RendererManagement() {} |
101 }; | 95 }; |
102 | 96 |
103 // --------------------------------------------------------------------------- | 97 // --------------------------------------------------------------------------- |
104 | 98 |
105 // Returns the current delegate associated with a feature. May return NULL if | 99 // Returns the current delegate associated with a feature. May return NULL if |
106 // there is no corresponding delegate. | 100 // there is no corresponding delegate. |
107 virtual RenderViewHostDelegateView* GetDelegateView(); | 101 virtual RenderViewHostDelegateView* GetDelegateView(); |
108 virtual RendererManagement* GetRendererManagementDelegate(); | 102 virtual RendererManagement* GetRendererManagementDelegate(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // The page's encoding was changed and should be updated. | 176 // The page's encoding was changed and should be updated. |
183 virtual void UpdateEncoding(RenderViewHost* render_view_host, | 177 virtual void UpdateEncoding(RenderViewHost* render_view_host, |
184 const std::string& encoding) {} | 178 const std::string& encoding) {} |
185 | 179 |
186 // The destination URL has changed should be updated | 180 // The destination URL has changed should be updated |
187 virtual void UpdateTargetURL(int32 page_id, const GURL& url) {} | 181 virtual void UpdateTargetURL(int32 page_id, const GURL& url) {} |
188 | 182 |
189 // The page is trying to close the RenderView's representation in the client. | 183 // The page is trying to close the RenderView's representation in the client. |
190 virtual void Close(RenderViewHost* render_view_host) {} | 184 virtual void Close(RenderViewHost* render_view_host) {} |
191 | 185 |
| 186 // This pending RenderViewHost is ready to commit a page. The delegate should |
| 187 // ensure that the old RenderViewHost runs its unload handler. |
| 188 virtual void OnCrossSiteResponse(RenderViewHost* pending_render_view_host, |
| 189 const GlobalRequestID& global_request_id) {} |
| 190 |
192 // The RenderViewHost has been swapped out. | 191 // The RenderViewHost has been swapped out. |
193 virtual void SwappedOut(RenderViewHost* render_view_host) {} | 192 virtual void SwappedOut(RenderViewHost* render_view_host) {} |
194 | 193 |
195 // The page is trying to move the RenderView's representation in the client. | 194 // The page is trying to move the RenderView's representation in the client. |
196 virtual void RequestMove(const gfx::Rect& new_bounds) {} | 195 virtual void RequestMove(const gfx::Rect& new_bounds) {} |
197 | 196 |
198 // The RenderView began loading a new page. This corresponds to WebKit's | 197 // The RenderView began loading a new page. This corresponds to WebKit's |
199 // notion of the throbber starting. | 198 // notion of the throbber starting. |
200 virtual void DidStartLoading(RenderViewHost* render_view_host) {} | 199 virtual void DidStartLoading(RenderViewHost* render_view_host) {} |
201 | 200 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 const MediaStreamRequest& request, | 413 const MediaStreamRequest& request, |
415 const MediaResponseCallback& callback) {} | 414 const MediaResponseCallback& callback) {} |
416 | 415 |
417 protected: | 416 protected: |
418 virtual ~RenderViewHostDelegate() {} | 417 virtual ~RenderViewHostDelegate() {} |
419 }; | 418 }; |
420 | 419 |
421 } // namespace content | 420 } // namespace content |
422 | 421 |
423 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 422 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
OLD | NEW |