OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_RENDER_FRAME_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 | 84 |
85 // TODO(jam): this is a temporary getter until all the code is transitioned | 85 // TODO(jam): this is a temporary getter until all the code is transitioned |
86 // to using RenderFrame instead of RenderView. | 86 // to using RenderFrame instead of RenderView. |
87 RenderViewImpl* render_view() { return render_view_.get(); } | 87 RenderViewImpl* render_view() { return render_view_.get(); } |
88 | 88 |
89 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; } | 89 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; } |
90 | 90 |
91 // Returns the RenderWidget associated with this frame. | 91 // Returns the RenderWidget associated with this frame. |
92 RenderWidget* GetRenderWidget(); | 92 RenderWidget* GetRenderWidget(); |
93 | 93 |
94 // This is called right after creation with the WebFrame for this RenderFrame. | 94 // This is called right after creation with the WebFrame for this RenderFrame. |
Charlie Reis
2014/04/03 00:37:11
nit: WebLocalFrame
dcheng
2014/04/03 20:39:57
Done.
| |
95 void SetWebFrame(blink::WebFrame* web_frame); | 95 void SetWebFrame(blink::WebLocalFrame* web_frame); |
96 | 96 |
97 // Notification from RenderView. | 97 // Notification from RenderView. |
98 virtual void OnStop(); | 98 virtual void OnStop(); |
99 | 99 |
100 // Start/Stop loading notifications. | 100 // Start/Stop loading notifications. |
101 // TODO(nasko): Those are page-level methods at this time and come from | 101 // TODO(nasko): Those are page-level methods at this time and come from |
102 // WebViewClient. We should move them to be WebFrameClient calls and put | 102 // WebViewClient. We should move them to be WebFrameClient calls and put |
103 // logic in the browser side to balance starts/stops. | 103 // logic in the browser side to balance starts/stops. |
104 // |to_different_document| will be true unless the load is a fragment | 104 // |to_different_document| will be true unless the load is a fragment |
105 // navigation, or triggered by history.pushState/replaceState. | 105 // navigation, or triggered by history.pushState/replaceState. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 virtual blink::WebFrame* GetWebFrame() OVERRIDE; | 174 virtual blink::WebFrame* GetWebFrame() OVERRIDE; |
175 virtual WebPreferences& GetWebkitPreferences() OVERRIDE; | 175 virtual WebPreferences& GetWebkitPreferences() OVERRIDE; |
176 virtual int ShowContextMenu(ContextMenuClient* client, | 176 virtual int ShowContextMenu(ContextMenuClient* client, |
177 const ContextMenuParams& params) OVERRIDE; | 177 const ContextMenuParams& params) OVERRIDE; |
178 virtual void CancelContextMenu(int request_id) OVERRIDE; | 178 virtual void CancelContextMenu(int request_id) OVERRIDE; |
179 virtual blink::WebNode GetContextMenuNode() const OVERRIDE; | 179 virtual blink::WebNode GetContextMenuNode() const OVERRIDE; |
180 virtual blink::WebPlugin* CreatePlugin( | 180 virtual blink::WebPlugin* CreatePlugin( |
181 blink::WebFrame* frame, | 181 blink::WebFrame* frame, |
182 const WebPluginInfo& info, | 182 const WebPluginInfo& info, |
183 const blink::WebPluginParams& params) OVERRIDE; | 183 const blink::WebPluginParams& params) OVERRIDE; |
184 virtual void LoadURLExternally( | 184 virtual void LoadURLExternally(blink::WebLocalFrame* frame, |
185 blink::WebFrame* frame, | 185 const blink::WebURLRequest& request, |
186 const blink::WebURLRequest& request, | 186 blink::WebNavigationPolicy policy) OVERRIDE; |
187 blink::WebNavigationPolicy policy) OVERRIDE; | |
188 virtual void ExecuteJavaScript(const base::string16& javascript) OVERRIDE; | 187 virtual void ExecuteJavaScript(const base::string16& javascript) OVERRIDE; |
189 | 188 |
190 // blink::WebFrameClient implementation ------------------------------------- | 189 // blink::WebFrameClient implementation ------------------------------------- |
191 virtual blink::WebPlugin* createPlugin( | 190 virtual blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
192 blink::WebFrame* frame, | 191 const blink::WebPluginParams& params); |
193 const blink::WebPluginParams& params); | |
194 virtual blink::WebMediaPlayer* createMediaPlayer( | 192 virtual blink::WebMediaPlayer* createMediaPlayer( |
195 blink::WebFrame* frame, | 193 blink::WebLocalFrame* frame, |
196 const blink::WebURL& url, | 194 const blink::WebURL& url, |
197 blink::WebMediaPlayerClient* client); | 195 blink::WebMediaPlayerClient* client); |
198 virtual blink::WebContentDecryptionModule* createContentDecryptionModule( | 196 virtual blink::WebContentDecryptionModule* createContentDecryptionModule( |
199 blink::WebFrame* frame, | 197 blink::WebLocalFrame* frame, |
200 const blink::WebSecurityOrigin& security_origin, | 198 const blink::WebSecurityOrigin& security_origin, |
201 const blink::WebString& key_system); | 199 const blink::WebString& key_system); |
202 virtual blink::WebApplicationCacheHost* createApplicationCacheHost( | 200 virtual blink::WebApplicationCacheHost* createApplicationCacheHost( |
203 blink::WebFrame* frame, | 201 blink::WebLocalFrame* frame, |
204 blink::WebApplicationCacheHostClient* client); | 202 blink::WebApplicationCacheHostClient* client); |
205 virtual blink::WebWorkerPermissionClientProxy* | 203 virtual blink::WebWorkerPermissionClientProxy* |
206 createWorkerPermissionClientProxy(blink::WebFrame* frame); | 204 createWorkerPermissionClientProxy(blink::WebLocalFrame* frame); |
207 virtual blink::WebCookieJar* cookieJar(blink::WebFrame* frame); | 205 virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); |
208 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider( | 206 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider( |
209 blink::WebFrame* frame); | 207 blink::WebLocalFrame* frame); |
210 virtual void didAccessInitialDocument(blink::WebFrame* frame); | 208 virtual void didAccessInitialDocument(blink::WebLocalFrame* frame); |
211 virtual blink::WebFrame* createChildFrame(blink::WebFrame* parent, | 209 virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent, |
212 const blink::WebString& name); | 210 const blink::WebString& name); |
213 virtual void didDisownOpener(blink::WebFrame* frame); | 211 virtual void didDisownOpener(blink::WebLocalFrame* frame); |
214 virtual void frameDetached(blink::WebFrame* frame); | 212 virtual void frameDetached(blink::WebFrame* frame); |
215 virtual void frameFocused(); | 213 virtual void frameFocused(); |
216 virtual void willClose(blink::WebFrame* frame); | 214 virtual void willClose(blink::WebFrame* frame); |
217 virtual void didChangeName(blink::WebFrame* frame, | 215 virtual void didChangeName(blink::WebLocalFrame* frame, |
218 const blink::WebString& name); | 216 const blink::WebString& name); |
219 virtual void didMatchCSS( | 217 virtual void didMatchCSS( |
220 blink::WebFrame* frame, | 218 blink::WebLocalFrame* frame, |
221 const blink::WebVector<blink::WebString>& newly_matching_selectors, | 219 const blink::WebVector<blink::WebString>& newly_matching_selectors, |
222 const blink::WebVector<blink::WebString>& stopped_matching_selectors); | 220 const blink::WebVector<blink::WebString>& stopped_matching_selectors); |
223 virtual void loadURLExternally(blink::WebFrame* frame, | 221 virtual void loadURLExternally(blink::WebLocalFrame* frame, |
224 const blink::WebURLRequest& request, | 222 const blink::WebURLRequest& request, |
225 blink::WebNavigationPolicy policy); | 223 blink::WebNavigationPolicy policy); |
226 virtual void loadURLExternally( | 224 virtual void loadURLExternally(blink::WebLocalFrame* frame, |
227 blink::WebFrame* frame, | 225 const blink::WebURLRequest& request, |
228 const blink::WebURLRequest& request, | 226 blink::WebNavigationPolicy policy, |
229 blink::WebNavigationPolicy policy, | 227 const blink::WebString& suggested_name); |
230 const blink::WebString& suggested_name); | |
231 // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass. | 228 // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass. |
232 virtual blink::WebNavigationPolicy decidePolicyForNavigation( | 229 virtual blink::WebNavigationPolicy decidePolicyForNavigation( |
233 blink::WebFrame* frame, | 230 blink::WebLocalFrame* frame, |
234 blink::WebDataSource::ExtraData* extra_data, | 231 blink::WebDataSource::ExtraData* extra_data, |
235 const blink::WebURLRequest& request, | 232 const blink::WebURLRequest& request, |
236 blink::WebNavigationType type, | 233 blink::WebNavigationType type, |
237 blink::WebNavigationPolicy default_policy, | 234 blink::WebNavigationPolicy default_policy, |
238 bool is_redirect); | 235 bool is_redirect); |
239 virtual void willSendSubmitEvent(blink::WebFrame* frame, | 236 virtual void willSendSubmitEvent(blink::WebLocalFrame* frame, |
240 const blink::WebFormElement& form); | 237 const blink::WebFormElement& form); |
241 virtual void willSubmitForm(blink::WebFrame* frame, | 238 virtual void willSubmitForm(blink::WebLocalFrame* frame, |
242 const blink::WebFormElement& form); | 239 const blink::WebFormElement& form); |
243 virtual void didCreateDataSource(blink::WebFrame* frame, | 240 virtual void didCreateDataSource(blink::WebLocalFrame* frame, |
244 blink::WebDataSource* datasource); | 241 blink::WebDataSource* datasource); |
245 virtual void didStartProvisionalLoad(blink::WebFrame* frame); | 242 virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame); |
246 virtual void didReceiveServerRedirectForProvisionalLoad( | 243 virtual void didReceiveServerRedirectForProvisionalLoad( |
247 blink::WebFrame* frame); | 244 blink::WebLocalFrame* frame); |
248 virtual void didFailProvisionalLoad( | 245 virtual void didFailProvisionalLoad(blink::WebLocalFrame* frame, |
249 blink::WebFrame* frame, | 246 const blink::WebURLError& error); |
250 const blink::WebURLError& error); | 247 virtual void didCommitProvisionalLoad(blink::WebLocalFrame* frame, |
251 virtual void didCommitProvisionalLoad(blink::WebFrame* frame, | |
252 bool is_new_navigation); | 248 bool is_new_navigation); |
253 virtual void didClearWindowObject(blink::WebFrame* frame, int world_id); | 249 virtual void didClearWindowObject(blink::WebLocalFrame* frame, int world_id); |
254 virtual void didCreateDocumentElement(blink::WebFrame* frame); | 250 virtual void didCreateDocumentElement(blink::WebLocalFrame* frame); |
255 virtual void didReceiveTitle(blink::WebFrame* frame, | 251 virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
256 const blink::WebString& title, | 252 const blink::WebString& title, |
257 blink::WebTextDirection direction); | 253 blink::WebTextDirection direction); |
258 virtual void didChangeIcon(blink::WebFrame* frame, | 254 virtual void didChangeIcon(blink::WebLocalFrame* frame, |
259 blink::WebIconURL::Type icon_type); | 255 blink::WebIconURL::Type icon_type); |
260 virtual void didFinishDocumentLoad(blink::WebFrame* frame); | 256 virtual void didFinishDocumentLoad(blink::WebLocalFrame* frame); |
261 virtual void didHandleOnloadEvents(blink::WebFrame* frame); | 257 virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame); |
262 virtual void didFailLoad(blink::WebFrame* frame, | 258 virtual void didFailLoad(blink::WebLocalFrame* frame, |
263 const blink::WebURLError& error); | 259 const blink::WebURLError& error); |
264 virtual void didFinishLoad(blink::WebFrame* frame); | 260 virtual void didFinishLoad(blink::WebLocalFrame* frame); |
265 virtual void didNavigateWithinPage(blink::WebFrame* frame, | 261 virtual void didNavigateWithinPage(blink::WebLocalFrame* frame, |
266 bool is_new_navigation); | 262 bool is_new_navigation); |
267 virtual void didUpdateCurrentHistoryItem(blink::WebFrame* frame); | 263 virtual void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame); |
268 virtual void didChangeSelection(bool is_empty_selection); | 264 virtual void didChangeSelection(bool is_empty_selection); |
269 virtual void showContextMenu(const blink::WebContextMenuData& data); | 265 virtual void showContextMenu(const blink::WebContextMenuData& data); |
270 virtual void clearContextMenu(); | 266 virtual void clearContextMenu(); |
271 virtual void willRequestAfterPreconnect(blink::WebFrame* frame, | 267 virtual void willRequestAfterPreconnect(blink::WebLocalFrame* frame, |
272 blink::WebURLRequest& request); | 268 blink::WebURLRequest& request); |
273 virtual void willSendRequest( | 269 virtual void willSendRequest(blink::WebLocalFrame* frame, |
274 blink::WebFrame* frame, | 270 unsigned identifier, |
275 unsigned identifier, | 271 blink::WebURLRequest& request, |
276 blink::WebURLRequest& request, | 272 const blink::WebURLResponse& redirect_response); |
277 const blink::WebURLResponse& redirect_response); | 273 virtual void didReceiveResponse(blink::WebLocalFrame* frame, |
278 virtual void didReceiveResponse( | 274 unsigned identifier, |
279 blink::WebFrame* frame, | 275 const blink::WebURLResponse& response); |
280 unsigned identifier, | 276 virtual void didFinishResourceLoad(blink::WebLocalFrame* frame, |
281 const blink::WebURLResponse& response); | |
282 virtual void didFinishResourceLoad(blink::WebFrame* frame, | |
283 unsigned identifier); | 277 unsigned identifier); |
284 virtual void didLoadResourceFromMemoryCache( | 278 virtual void didLoadResourceFromMemoryCache( |
285 blink::WebFrame* frame, | 279 blink::WebLocalFrame* frame, |
286 const blink::WebURLRequest& request, | 280 const blink::WebURLRequest& request, |
287 const blink::WebURLResponse& response); | 281 const blink::WebURLResponse& response); |
288 virtual void didDisplayInsecureContent(blink::WebFrame* frame); | 282 virtual void didDisplayInsecureContent(blink::WebLocalFrame* frame); |
289 virtual void didRunInsecureContent(blink::WebFrame* frame, | 283 virtual void didRunInsecureContent(blink::WebLocalFrame* frame, |
290 const blink::WebSecurityOrigin& origin, | 284 const blink::WebSecurityOrigin& origin, |
291 const blink::WebURL& target); | 285 const blink::WebURL& target); |
292 virtual void didAbortLoading(blink::WebFrame* frame); | 286 virtual void didAbortLoading(blink::WebLocalFrame* frame); |
293 virtual void didCreateScriptContext(blink::WebFrame* frame, | 287 virtual void didCreateScriptContext(blink::WebLocalFrame* frame, |
294 v8::Handle<v8::Context> context, | 288 v8::Handle<v8::Context> context, |
295 int extension_group, | 289 int extension_group, |
296 int world_id); | 290 int world_id); |
297 virtual void willReleaseScriptContext(blink::WebFrame* frame, | 291 virtual void willReleaseScriptContext(blink::WebLocalFrame* frame, |
298 v8::Handle<v8::Context> context, | 292 v8::Handle<v8::Context> context, |
299 int world_id); | 293 int world_id); |
300 virtual void didFirstVisuallyNonEmptyLayout(blink::WebFrame* frame); | 294 virtual void didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame); |
301 virtual void didChangeContentsSize(blink::WebFrame* frame, | 295 virtual void didChangeContentsSize(blink::WebLocalFrame* frame, |
302 const blink::WebSize& size); | 296 const blink::WebSize& size); |
303 virtual void didChangeScrollOffset(blink::WebFrame* frame); | 297 virtual void didChangeScrollOffset(blink::WebLocalFrame* frame); |
304 virtual void willInsertBody(blink::WebFrame* frame); | 298 virtual void willInsertBody(blink::WebLocalFrame* frame); |
305 virtual void reportFindInPageMatchCount(int request_id, | 299 virtual void reportFindInPageMatchCount(int request_id, |
306 int count, | 300 int count, |
307 bool final_update); | 301 bool final_update); |
308 virtual void reportFindInPageSelection(int request_id, | 302 virtual void reportFindInPageSelection(int request_id, |
309 int active_match_ordinal, | 303 int active_match_ordinal, |
310 const blink::WebRect& sel); | 304 const blink::WebRect& sel); |
311 virtual void requestStorageQuota( | 305 virtual void requestStorageQuota(blink::WebLocalFrame* frame, |
312 blink::WebFrame* frame, | 306 blink::WebStorageQuotaType type, |
313 blink::WebStorageQuotaType type, | 307 unsigned long long requested_size, |
314 unsigned long long requested_size, | 308 blink::WebStorageQuotaCallbacks callbacks); |
315 blink::WebStorageQuotaCallbacks callbacks); | |
316 virtual void willOpenSocketStream( | 309 virtual void willOpenSocketStream( |
317 blink::WebSocketStreamHandle* handle); | 310 blink::WebSocketStreamHandle* handle); |
318 virtual void willStartUsingPeerConnectionHandler( | 311 virtual void willStartUsingPeerConnectionHandler( |
319 blink::WebFrame* frame, | 312 blink::WebLocalFrame* frame, |
320 blink::WebRTCPeerConnectionHandler* handler); | 313 blink::WebRTCPeerConnectionHandler* handler); |
321 virtual bool willCheckAndDispatchMessageEvent( | 314 virtual bool willCheckAndDispatchMessageEvent( |
322 blink::WebFrame* sourceFrame, | 315 blink::WebLocalFrame* sourceFrame, |
323 blink::WebFrame* targetFrame, | 316 blink::WebFrame* targetFrame, |
324 blink::WebSecurityOrigin targetOrigin, | 317 blink::WebSecurityOrigin targetOrigin, |
325 blink::WebDOMMessageEvent event); | 318 blink::WebDOMMessageEvent event); |
326 virtual blink::WebString userAgentOverride( | 319 virtual blink::WebString userAgentOverride(blink::WebLocalFrame* frame, |
327 blink::WebFrame* frame, | 320 const blink::WebURL& url); |
328 const blink::WebURL& url); | 321 virtual blink::WebString doNotTrackValue(blink::WebLocalFrame* frame); |
329 virtual blink::WebString doNotTrackValue(blink::WebFrame* frame); | 322 virtual bool allowWebGL(blink::WebLocalFrame* frame, bool default_value); |
330 virtual bool allowWebGL(blink::WebFrame* frame, bool default_value); | 323 virtual void didLoseWebGLContext(blink::WebLocalFrame* frame, |
331 virtual void didLoseWebGLContext(blink::WebFrame* frame, | |
332 int arb_robustness_status_code); | 324 int arb_robustness_status_code); |
333 virtual void forwardInputEvent(const blink::WebInputEvent* event); | 325 virtual void forwardInputEvent(const blink::WebInputEvent* event); |
334 virtual void initializeChildFrame(const blink::WebRect& frame_rect, | 326 virtual void initializeChildFrame(const blink::WebRect& frame_rect, |
335 float scale_factor); | 327 float scale_factor); |
336 | 328 |
337 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move | 329 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move |
338 // this back to private member. | 330 // this back to private member. |
339 void OnNavigate(const FrameMsg_Navigate_Params& params); | 331 void OnNavigate(const FrameMsg_Navigate_Params& params); |
340 | 332 |
341 protected: | 333 protected: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 void SyncSelectionIfRequired(); | 416 void SyncSelectionIfRequired(); |
425 | 417 |
426 // Returns whether |params.selection_text| should be synchronized to the | 418 // Returns whether |params.selection_text| should be synchronized to the |
427 // browser before bringing up the context menu. Static for testing. | 419 // browser before bringing up the context menu. Static for testing. |
428 static bool ShouldUpdateSelectionTextFromContextMenuParams( | 420 static bool ShouldUpdateSelectionTextFromContextMenuParams( |
429 const base::string16& selection_text, | 421 const base::string16& selection_text, |
430 size_t selection_text_offset, | 422 size_t selection_text_offset, |
431 const gfx::Range& selection_range, | 423 const gfx::Range& selection_range, |
432 const ContextMenuParams& params); | 424 const ContextMenuParams& params); |
433 | 425 |
434 // Stores the WebFrame we are associated with. | 426 // Stores the WebFrame we are associated with. |
Charlie Reis
2014/04/03 00:37:11
nit: WebLocalFrame.
dcheng
2014/04/03 20:39:57
Done.
| |
435 blink::WebFrame* frame_; | 427 blink::WebLocalFrame* frame_; |
436 | 428 |
437 base::WeakPtr<RenderViewImpl> render_view_; | 429 base::WeakPtr<RenderViewImpl> render_view_; |
438 int routing_id_; | 430 int routing_id_; |
439 bool is_loading_; | 431 bool is_loading_; |
440 bool is_swapped_out_; | 432 bool is_swapped_out_; |
441 bool is_detaching_; | 433 bool is_detaching_; |
442 | 434 |
443 #if defined(ENABLE_PLUGINS) | 435 #if defined(ENABLE_PLUGINS) |
444 // Current text input composition text. Empty if no composition is in | 436 // Current text input composition text. Empty if no composition is in |
445 // progress. | 437 // progress. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 // Used to inform didChangeSelection() when it is called in the context | 475 // Used to inform didChangeSelection() when it is called in the context |
484 // of handling a InputMsg_SelectRange IPC. | 476 // of handling a InputMsg_SelectRange IPC. |
485 bool handling_select_range_; | 477 bool handling_select_range_; |
486 | 478 |
487 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 479 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
488 }; | 480 }; |
489 | 481 |
490 } // namespace content | 482 } // namespace content |
491 | 483 |
492 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 484 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |