blob: 78e75b0a60fa20e58ce67b7f4bd71a63cf5e4328 [file] [log] [blame]
[email protected]227692c52013-05-31 22:43:041// Copyright 2013 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.
4
5#ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6#define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7
8#include "base/basictypes.h"
9#include "content/public/renderer/render_frame.h"
10#include "ipc/ipc_message.h"
[email protected]85d85fd2013-06-19 00:57:4111#include "third_party/WebKit/public/web/WebDataSource.h"
12#include "third_party/WebKit/public/web/WebFrameClient.h"
[email protected]227692c52013-05-31 22:43:0413
14namespace content {
15
16class RenderViewImpl;
17
[email protected]85d85fd2013-06-19 00:57:4118class CONTENT_EXPORT RenderFrameImpl
19 : public RenderFrame,
20 NON_EXPORTED_BASE(public WebKit::WebFrameClient) {
[email protected]227692c52013-05-31 22:43:0421 public:
[email protected]2f61bdd2013-07-02 18:38:4722 // Creates a new RenderFrame. |render_view| is the RenderView object that this
23 // frame belongs to.
24 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);
25
26 // Used by content_layouttest_support to hook into the creation of
27 // RenderFrameImpls.
28 static void InstallCreateHook(
29 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32));
30
[email protected]227692c52013-05-31 22:43:0431 virtual ~RenderFrameImpl();
32
33 // IPC::Sender
34 virtual bool Send(IPC::Message* msg) OVERRIDE;
35
36 // IPC::Listener
37 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
38
[email protected]85d85fd2013-06-19 00:57:4139 // WebKit::WebFrameClient implementation -------------------------------------
40 virtual WebKit::WebPlugin* createPlugin(
41 WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:1442 const WebKit::WebPluginParams& params);
[email protected]85d85fd2013-06-19 00:57:4143 virtual WebKit::WebSharedWorker* createSharedWorker(
44 WebKit::WebFrame* frame,
45 const WebKit::WebURL& url,
46 const WebKit::WebString& name,
[email protected]255eea092013-06-28 17:19:1447 unsigned long long document_id);
[email protected]85d85fd2013-06-19 00:57:4148 virtual WebKit::WebMediaPlayer* createMediaPlayer(
49 WebKit::WebFrame* frame,
50 const WebKit::WebURL& url,
[email protected]255eea092013-06-28 17:19:1451 WebKit::WebMediaPlayerClient* client);
[email protected]85d85fd2013-06-19 00:57:4152 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
53 WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:1454 WebKit::WebApplicationCacheHostClient* client);
55 virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame);
56 virtual void didAccessInitialDocument(WebKit::WebFrame* frame);
[email protected]9b159a52013-10-03 17:24:5557 virtual WebKit::WebFrame* createChildFrame(WebKit::WebFrame* parent,
58 const WebKit::WebString& name);
[email protected]255eea092013-06-28 17:19:1459 virtual void didDisownOpener(WebKit::WebFrame* frame);
60 virtual void frameDetached(WebKit::WebFrame* frame);
61 virtual void willClose(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:4162 virtual void didChangeName(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:1463 const WebKit::WebString& name);
[email protected]f5b6dd1122013-10-04 02:42:5064 virtual void didMatchCSS(
65 WebKit::WebFrame* frame,
66 const WebKit::WebVector<WebKit::WebString>& newly_matching_selectors,
67 const WebKit::WebVector<WebKit::WebString>& stopped_matching_selectors);
[email protected]85d85fd2013-06-19 00:57:4168 virtual void loadURLExternally(WebKit::WebFrame* frame,
69 const WebKit::WebURLRequest& request,
[email protected]255eea092013-06-28 17:19:1470 WebKit::WebNavigationPolicy policy);
[email protected]85d85fd2013-06-19 00:57:4171 virtual void loadURLExternally(
72 WebKit::WebFrame* frame,
73 const WebKit::WebURLRequest& request,
74 WebKit::WebNavigationPolicy policy,
[email protected]255eea092013-06-28 17:19:1475 const WebKit::WebString& suggested_name);
[email protected]85d85fd2013-06-19 00:57:4176 virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
77 WebKit::WebFrame* frame,
[email protected]f6ae17fc2013-08-19 22:56:1778 WebKit::WebDataSource::ExtraData* extra_data,
79 const WebKit::WebURLRequest& request,
80 WebKit::WebNavigationType type,
81 WebKit::WebNavigationPolicy default_policy,
82 bool is_redirect);
83 // DEPRECATED
84 virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
85 WebKit::WebFrame* frame,
[email protected]85d85fd2013-06-19 00:57:4186 const WebKit::WebURLRequest& request,
87 WebKit::WebNavigationType type,
88 WebKit::WebNavigationPolicy default_policy,
[email protected]255eea092013-06-28 17:19:1489 bool is_redirect);
[email protected]85d85fd2013-06-19 00:57:4190 virtual void willSendSubmitEvent(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:1491 const WebKit::WebFormElement& form);
[email protected]85d85fd2013-06-19 00:57:4192 virtual void willSubmitForm(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:1493 const WebKit::WebFormElement& form);
[email protected]85d85fd2013-06-19 00:57:4194 virtual void didCreateDataSource(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:1495 WebKit::WebDataSource* datasource);
96 virtual void didStartProvisionalLoad(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:4197 virtual void didReceiveServerRedirectForProvisionalLoad(
[email protected]255eea092013-06-28 17:19:1498 WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:4199 virtual void didFailProvisionalLoad(
100 WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14101 const WebKit::WebURLError& error);
[email protected]85d85fd2013-06-19 00:57:41102 virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14103 bool is_new_navigation);
104 virtual void didClearWindowObject(WebKit::WebFrame* frame);
105 virtual void didCreateDocumentElement(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41106 virtual void didReceiveTitle(WebKit::WebFrame* frame,
107 const WebKit::WebString& title,
[email protected]255eea092013-06-28 17:19:14108 WebKit::WebTextDirection direction);
[email protected]85d85fd2013-06-19 00:57:41109 virtual void didChangeIcon(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14110 WebKit::WebIconURL::Type icon_type);
111 virtual void didFinishDocumentLoad(WebKit::WebFrame* frame);
112 virtual void didHandleOnloadEvents(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41113 virtual void didFailLoad(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14114 const WebKit::WebURLError& error);
115 virtual void didFinishLoad(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41116 virtual void didNavigateWithinPage(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14117 bool is_new_navigation);
118 virtual void didUpdateCurrentHistoryItem(WebKit::WebFrame* frame);
[email protected]798a1b02013-07-30 07:16:52119 virtual void willRequestAfterPreconnect(WebKit::WebFrame* frame,
120 WebKit::WebURLRequest& request);
[email protected]85d85fd2013-06-19 00:57:41121 virtual void willSendRequest(
122 WebKit::WebFrame* frame,
123 unsigned identifier,
124 WebKit::WebURLRequest& request,
[email protected]255eea092013-06-28 17:19:14125 const WebKit::WebURLResponse& redirect_response);
[email protected]85d85fd2013-06-19 00:57:41126 virtual void didReceiveResponse(
127 WebKit::WebFrame* frame,
128 unsigned identifier,
[email protected]255eea092013-06-28 17:19:14129 const WebKit::WebURLResponse& response);
[email protected]85d85fd2013-06-19 00:57:41130 virtual void didFinishResourceLoad(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14131 unsigned identifier);
[email protected]85d85fd2013-06-19 00:57:41132 virtual void didLoadResourceFromMemoryCache(
133 WebKit::WebFrame* frame,
134 const WebKit::WebURLRequest& request,
[email protected]255eea092013-06-28 17:19:14135 const WebKit::WebURLResponse& response);
136 virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41137 virtual void didRunInsecureContent(WebKit::WebFrame* frame,
138 const WebKit::WebSecurityOrigin& origin,
[email protected]255eea092013-06-28 17:19:14139 const WebKit::WebURL& target);
[email protected]93cabae2013-10-01 16:11:36140 virtual void didAbortLoading(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41141 virtual void didExhaustMemoryAvailableForScript(
[email protected]255eea092013-06-28 17:19:14142 WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41143 virtual void didCreateScriptContext(WebKit::WebFrame* frame,
144 v8::Handle<v8::Context> context,
145 int extension_group,
[email protected]255eea092013-06-28 17:19:14146 int world_id);
[email protected]85d85fd2013-06-19 00:57:41147 virtual void willReleaseScriptContext(WebKit::WebFrame* frame,
148 v8::Handle<v8::Context> context,
[email protected]255eea092013-06-28 17:19:14149 int world_id);
150 virtual void didFirstVisuallyNonEmptyLayout(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41151 virtual void didChangeContentsSize(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14152 const WebKit::WebSize& size);
153 virtual void didChangeScrollOffset(WebKit::WebFrame* frame);
154 virtual void willInsertBody(WebKit::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41155 virtual void reportFindInPageMatchCount(int request_id,
156 int count,
[email protected]255eea092013-06-28 17:19:14157 bool final_update);
[email protected]85d85fd2013-06-19 00:57:41158 virtual void reportFindInPageSelection(int request_id,
159 int active_match_ordinal,
[email protected]255eea092013-06-28 17:19:14160 const WebKit::WebRect& sel);
[email protected]85d85fd2013-06-19 00:57:41161 virtual void requestStorageQuota(
162 WebKit::WebFrame* frame,
163 WebKit::WebStorageQuotaType type,
164 unsigned long long requested_size,
[email protected]255eea092013-06-28 17:19:14165 WebKit::WebStorageQuotaCallbacks* callbacks);
[email protected]85d85fd2013-06-19 00:57:41166 virtual void willOpenSocketStream(
[email protected]255eea092013-06-28 17:19:14167 WebKit::WebSocketStreamHandle* handle);
[email protected]85d85fd2013-06-19 00:57:41168 virtual void willStartUsingPeerConnectionHandler(
169 WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14170 WebKit::WebRTCPeerConnectionHandler* handler);
[email protected]85d85fd2013-06-19 00:57:41171 virtual bool willCheckAndDispatchMessageEvent(
172 WebKit::WebFrame* sourceFrame,
173 WebKit::WebFrame* targetFrame,
174 WebKit::WebSecurityOrigin targetOrigin,
[email protected]255eea092013-06-28 17:19:14175 WebKit::WebDOMMessageEvent event);
[email protected]85d85fd2013-06-19 00:57:41176 virtual WebKit::WebString userAgentOverride(
177 WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14178 const WebKit::WebURL& url);
179 virtual WebKit::WebString doNotTrackValue(WebKit::WebFrame* frame);
180 virtual bool allowWebGL(WebKit::WebFrame* frame, bool default_value);
[email protected]85d85fd2013-06-19 00:57:41181 virtual void didLoseWebGLContext(WebKit::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14182 int arb_robustness_status_code);
[email protected]85d85fd2013-06-19 00:57:41183
[email protected]2f61bdd2013-07-02 18:38:47184 protected:
185 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id);
186
[email protected]227692c52013-05-31 22:43:04187 private:
[email protected]1c2052f2013-08-28 08:24:34188 int GetRoutingID() const;
189
[email protected]227692c52013-05-31 22:43:04190 RenderViewImpl* render_view_;
191 int routing_id_;
[email protected]1c2052f2013-08-28 08:24:34192 bool is_swapped_out_;
193 bool is_detaching_;
[email protected]227692c52013-05-31 22:43:04194
195 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
196};
197
198} // namespace content
199
[email protected]85d85fd2013-06-19 00:57:41200#endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_