blob: 82fcfbc5ed75fa2b9955b641e4b5779c07062db1 [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
[email protected]7a4e2532013-12-02 21:30:028#include <vector>
9
[email protected]227692c52013-05-31 22:43:0410#include "base/basictypes.h"
[email protected]7a4e2532013-12-02 21:30:0211#include "base/files/file_path.h"
[email protected]a09d53ce2014-01-31 00:46:4212#include "base/gtest_prod_util.h"
13#include "base/id_map.h"
[email protected]abc501e2014-01-27 19:27:2614#include "base/memory/weak_ptr.h"
[email protected]2e2d9632013-12-03 00:55:2615#include "base/observer_list.h"
[email protected]7a4e2532013-12-02 21:30:0216#include "base/process/process_handle.h"
17#include "base/strings/string16.h"
[email protected]65920f332014-03-04 21:14:1818#include "content/public/common/referrer.h"
[email protected]227692c52013-05-31 22:43:0419#include "content/public/renderer/render_frame.h"
[email protected]f3add922013-12-20 23:17:1620#include "content/renderer/renderer_webcookiejar_impl.h"
[email protected]227692c52013-05-31 22:43:0421#include "ipc/ipc_message.h"
[email protected]85d85fd2013-06-19 00:57:4122#include "third_party/WebKit/public/web/WebDataSource.h"
23#include "third_party/WebKit/public/web/WebFrameClient.h"
[email protected]227692c52013-05-31 22:43:0424
[email protected]7a4e2532013-12-02 21:30:0225class TransportDIB;
[email protected]bffc8302014-01-23 20:52:1626struct FrameMsg_BuffersSwapped_Params;
27struct FrameMsg_CompositorFrameSwapped_Params;
[email protected]c6bc20332014-02-28 18:30:3928struct FrameMsg_Navigate_Params;
[email protected]7a4e2532013-12-02 21:30:0229
30namespace blink {
[email protected]5cdd8fd82014-02-05 20:12:1231class WebInputEvent;
[email protected]7a4e2532013-12-02 21:30:0232class WebMouseEvent;
33struct WebCompositionUnderline;
[email protected]a09d53ce2014-01-31 00:46:4234struct WebContextMenuData;
[email protected]7a4e2532013-12-02 21:30:0235struct WebCursorInfo;
36}
37
38namespace gfx {
[email protected]a09d53ce2014-01-31 00:46:4239class Point;
[email protected]7a4e2532013-12-02 21:30:0240class Range;
41class Rect;
42}
43
[email protected]227692c52013-05-31 22:43:0444namespace content {
45
[email protected]bffc8302014-01-23 20:52:1646class ChildFrameCompositingHelper;
[email protected]7a4e2532013-12-02 21:30:0247class PepperPluginInstanceImpl;
48class RendererPpapiHost;
[email protected]2e2d9632013-12-03 00:55:2649class RenderFrameObserver;
[email protected]227692c52013-05-31 22:43:0450class RenderViewImpl;
[email protected]7a4e2532013-12-02 21:30:0251class RenderWidget;
52class RenderWidgetFullscreenPepper;
[email protected]a09d53ce2014-01-31 00:46:4253struct CustomContextMenuContext;
[email protected]227692c52013-05-31 22:43:0454
[email protected]85d85fd2013-06-19 00:57:4155class CONTENT_EXPORT RenderFrameImpl
56 : public RenderFrame,
[email protected]180ef242013-11-07 06:50:4657 NON_EXPORTED_BASE(public blink::WebFrameClient) {
[email protected]227692c52013-05-31 22:43:0458 public:
[email protected]2f61bdd2013-07-02 18:38:4759 // Creates a new RenderFrame. |render_view| is the RenderView object that this
60 // frame belongs to.
[email protected]b70da4c2014-01-06 19:57:0961 // Callers *must* call |SetWebFrame| immediately after creation.
62 // TODO(creis): We should structure this so that |SetWebFrame| isn't needed.
[email protected]2f61bdd2013-07-02 18:38:4763 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);
64
[email protected]a5ac6dc2014-01-15 07:02:1465 // Just like RenderFrame::FromWebFrame but returns the implementation.
66 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:0967
[email protected]2f61bdd2013-07-02 18:38:4768 // Used by content_layouttest_support to hook into the creation of
69 // RenderFrameImpls.
70 static void InstallCreateHook(
71 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32));
72
[email protected]227692c52013-05-31 22:43:0473 virtual ~RenderFrameImpl();
74
[email protected]b70da4c2014-01-06 19:57:0975 bool is_swapped_out() const {
76 return is_swapped_out_;
77 }
78
[email protected]bffc8302014-01-23 20:52:1679 // Out-of-process child frames receive a signal from RenderWidgetCompositor
80 // when a compositor frame has committed.
81 void DidCommitCompositorFrame();
82
[email protected]7a4e2532013-12-02 21:30:0283 // TODO(jam): this is a temporary getter until all the code is transitioned
84 // to using RenderFrame instead of RenderView.
[email protected]abc501e2014-01-27 19:27:2685 RenderViewImpl* render_view() { return render_view_.get(); }
[email protected]7a4e2532013-12-02 21:30:0286
[email protected]f3add922013-12-20 23:17:1687 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; }
88
[email protected]7a4e2532013-12-02 21:30:0289 // Returns the RenderWidget associated with this frame.
90 RenderWidget* GetRenderWidget();
91
[email protected]a5ac6dc2014-01-15 07:02:1492 // This is called right after creation with the WebFrame for this RenderFrame.
[email protected]b70da4c2014-01-06 19:57:0993 void SetWebFrame(blink::WebFrame* web_frame);
94
[email protected]5815cf52014-01-29 17:45:0595 // Notification from RenderView.
96 virtual void OnStop();
97
[email protected]723971b2014-02-12 11:08:2598 // Start/Stop loading notifications.
99 // TODO(nasko): Those are page-level methods at this time and come from
100 // WebViewClient. We should move them to be WebFrameClient calls and put
101 // logic in the browser side to balance starts/stops.
102 void didStartLoading();
103 void didStopLoading();
104
[email protected]7a4e2532013-12-02 21:30:02105#if defined(ENABLE_PLUGINS)
[email protected]271ff5792013-12-04 22:29:31106 // Notification that a PPAPI plugin has been created.
107 void PepperPluginCreated(RendererPpapiHost* host);
108
[email protected]7a4e2532013-12-02 21:30:02109 // Notifies that |instance| has changed the cursor.
110 // This will update the cursor appearance if it is currently over the plugin
111 // instance.
112 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance,
113 const blink::WebCursorInfo& cursor);
114
115 // Notifies that |instance| has received a mouse event.
116 void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance);
117
[email protected]7a4e2532013-12-02 21:30:02118 // Informs the render view that a PPAPI plugin has changed text input status.
119 void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance);
120 void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance);
121
122 // Cancels current composition.
123 void PepperCancelComposition(PepperPluginInstanceImpl* instance);
124
125 // Informs the render view that a PPAPI plugin has changed selection.
126 void PepperSelectionChanged(PepperPluginInstanceImpl* instance);
127
128 // Creates a fullscreen container for a pepper plugin instance.
129 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
130 PepperPluginInstanceImpl* plugin);
131
[email protected]7a4e2532013-12-02 21:30:02132 bool IsPepperAcceptingCompositionEvents() const;
133
134 // Notification that the given plugin has crashed.
135 void PluginCrashed(const base::FilePath& plugin_path,
136 base::ProcessId plugin_pid);
137
[email protected]7a4e2532013-12-02 21:30:02138 // Simulates IME events for testing purpose.
139 void SimulateImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26140 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02141 const std::vector<blink::WebCompositionUnderline>& underlines,
142 int selection_start,
143 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26144 void SimulateImeConfirmComposition(const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02145 const gfx::Range& replacement_range);
146
147 // TODO(jam): remove these once the IPC handler moves from RenderView to
148 // RenderFrame.
149 void OnImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26150 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02151 const std::vector<blink::WebCompositionUnderline>& underlines,
152 int selection_start,
153 int selection_end);
154 void OnImeConfirmComposition(
[email protected]fcf75d42013-12-03 20:11:26155 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02156 const gfx::Range& replacement_range,
157 bool keep_selection);
[email protected]7a4e2532013-12-02 21:30:02158#endif // ENABLE_PLUGINS
159
[email protected]227692c52013-05-31 22:43:04160 // IPC::Sender
161 virtual bool Send(IPC::Message* msg) OVERRIDE;
162
163 // IPC::Listener
164 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
165
[email protected]271ff5792013-12-04 22:29:31166 // RenderFrame implementation:
[email protected]b849847b2013-12-10 21:57:58167 virtual RenderView* GetRenderView() OVERRIDE;
[email protected]60eca4eb2013-12-06 00:02:16168 virtual int GetRoutingID() OVERRIDE;
[email protected]a5ac6dc2014-01-15 07:02:14169 virtual blink::WebFrame* GetWebFrame() OVERRIDE;
[email protected]d019e1a382013-12-11 17:52:06170 virtual WebPreferences& GetWebkitPreferences() OVERRIDE;
171 virtual int ShowContextMenu(ContextMenuClient* client,
172 const ContextMenuParams& params) OVERRIDE;
173 virtual void CancelContextMenu(int request_id) OVERRIDE;
[email protected]1a6d0112014-03-10 19:08:41174 virtual blink::WebNode GetContextMenuNode() const OVERRIDE;
[email protected]271ff5792013-12-04 22:29:31175 virtual blink::WebPlugin* CreatePlugin(
176 blink::WebFrame* frame,
177 const WebPluginInfo& info,
178 const blink::WebPluginParams& params) OVERRIDE;
[email protected]d019e1a382013-12-11 17:52:06179 virtual void LoadURLExternally(
180 blink::WebFrame* frame,
181 const blink::WebURLRequest& request,
182 blink::WebNavigationPolicy policy) OVERRIDE;
[email protected]271ff5792013-12-04 22:29:31183
[email protected]180ef242013-11-07 06:50:46184 // blink::WebFrameClient implementation -------------------------------------
185 virtual blink::WebPlugin* createPlugin(
186 blink::WebFrame* frame,
187 const blink::WebPluginParams& params);
188 virtual blink::WebMediaPlayer* createMediaPlayer(
189 blink::WebFrame* frame,
190 const blink::WebURL& url,
191 blink::WebMediaPlayerClient* client);
192 virtual blink::WebApplicationCacheHost* createApplicationCacheHost(
193 blink::WebFrame* frame,
194 blink::WebApplicationCacheHostClient* client);
195 virtual blink::WebWorkerPermissionClientProxy*
196 createWorkerPermissionClientProxy(blink::WebFrame* frame);
197 virtual blink::WebCookieJar* cookieJar(blink::WebFrame* frame);
198 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider(
[email protected]7e113152014-02-26 20:01:14199 blink::WebFrame* frame);
[email protected]180ef242013-11-07 06:50:46200 virtual void didAccessInitialDocument(blink::WebFrame* frame);
201 virtual blink::WebFrame* createChildFrame(blink::WebFrame* parent,
202 const blink::WebString& name);
203 virtual void didDisownOpener(blink::WebFrame* frame);
204 virtual void frameDetached(blink::WebFrame* frame);
[email protected]9c9343b2014-03-08 02:56:07205 virtual void frameFocused();
[email protected]180ef242013-11-07 06:50:46206 virtual void willClose(blink::WebFrame* frame);
207 virtual void didChangeName(blink::WebFrame* frame,
208 const blink::WebString& name);
[email protected]f5b6dd1122013-10-04 02:42:50209 virtual void didMatchCSS(
[email protected]180ef242013-11-07 06:50:46210 blink::WebFrame* frame,
211 const blink::WebVector<blink::WebString>& newly_matching_selectors,
212 const blink::WebVector<blink::WebString>& stopped_matching_selectors);
213 virtual void loadURLExternally(blink::WebFrame* frame,
214 const blink::WebURLRequest& request,
215 blink::WebNavigationPolicy policy);
[email protected]85d85fd2013-06-19 00:57:41216 virtual void loadURLExternally(
[email protected]180ef242013-11-07 06:50:46217 blink::WebFrame* frame,
218 const blink::WebURLRequest& request,
219 blink::WebNavigationPolicy policy,
220 const blink::WebString& suggested_name);
[email protected]1a4e9752013-12-31 20:10:58221 // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass.
[email protected]180ef242013-11-07 06:50:46222 virtual blink::WebNavigationPolicy decidePolicyForNavigation(
223 blink::WebFrame* frame,
224 blink::WebDataSource::ExtraData* extra_data,
225 const blink::WebURLRequest& request,
226 blink::WebNavigationType type,
227 blink::WebNavigationPolicy default_policy,
[email protected]f6ae17fc2013-08-19 22:56:17228 bool is_redirect);
229 // DEPRECATED
[email protected]180ef242013-11-07 06:50:46230 virtual blink::WebNavigationPolicy decidePolicyForNavigation(
231 blink::WebFrame* frame,
232 const blink::WebURLRequest& request,
233 blink::WebNavigationType type,
234 blink::WebNavigationPolicy default_policy,
[email protected]255eea092013-06-28 17:19:14235 bool is_redirect);
[email protected]180ef242013-11-07 06:50:46236 virtual void willSendSubmitEvent(blink::WebFrame* frame,
237 const blink::WebFormElement& form);
238 virtual void willSubmitForm(blink::WebFrame* frame,
239 const blink::WebFormElement& form);
240 virtual void didCreateDataSource(blink::WebFrame* frame,
241 blink::WebDataSource* datasource);
242 virtual void didStartProvisionalLoad(blink::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41243 virtual void didReceiveServerRedirectForProvisionalLoad(
[email protected]180ef242013-11-07 06:50:46244 blink::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41245 virtual void didFailProvisionalLoad(
[email protected]180ef242013-11-07 06:50:46246 blink::WebFrame* frame,
247 const blink::WebURLError& error);
248 virtual void didCommitProvisionalLoad(blink::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14249 bool is_new_navigation);
[email protected]c4f80f72014-01-13 11:24:12250 virtual void didClearWindowObject(blink::WebFrame* frame, int world_id);
[email protected]180ef242013-11-07 06:50:46251 virtual void didCreateDocumentElement(blink::WebFrame* frame);
252 virtual void didReceiveTitle(blink::WebFrame* frame,
253 const blink::WebString& title,
254 blink::WebTextDirection direction);
255 virtual void didChangeIcon(blink::WebFrame* frame,
256 blink::WebIconURL::Type icon_type);
257 virtual void didFinishDocumentLoad(blink::WebFrame* frame);
258 virtual void didHandleOnloadEvents(blink::WebFrame* frame);
259 virtual void didFailLoad(blink::WebFrame* frame,
260 const blink::WebURLError& error);
261 virtual void didFinishLoad(blink::WebFrame* frame);
262 virtual void didNavigateWithinPage(blink::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14263 bool is_new_navigation);
[email protected]180ef242013-11-07 06:50:46264 virtual void didUpdateCurrentHistoryItem(blink::WebFrame* frame);
[email protected]12cc5112014-03-03 17:01:10265 virtual void showContextMenu(const blink::WebContextMenuData& data);
[email protected]91070342014-03-07 00:29:02266 virtual void clearContextMenu();
[email protected]180ef242013-11-07 06:50:46267 virtual void willRequestAfterPreconnect(blink::WebFrame* frame,
268 blink::WebURLRequest& request);
[email protected]85d85fd2013-06-19 00:57:41269 virtual void willSendRequest(
[email protected]180ef242013-11-07 06:50:46270 blink::WebFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41271 unsigned identifier,
[email protected]180ef242013-11-07 06:50:46272 blink::WebURLRequest& request,
273 const blink::WebURLResponse& redirect_response);
[email protected]85d85fd2013-06-19 00:57:41274 virtual void didReceiveResponse(
[email protected]180ef242013-11-07 06:50:46275 blink::WebFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41276 unsigned identifier,
[email protected]180ef242013-11-07 06:50:46277 const blink::WebURLResponse& response);
278 virtual void didFinishResourceLoad(blink::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14279 unsigned identifier);
[email protected]85d85fd2013-06-19 00:57:41280 virtual void didLoadResourceFromMemoryCache(
[email protected]180ef242013-11-07 06:50:46281 blink::WebFrame* frame,
282 const blink::WebURLRequest& request,
283 const blink::WebURLResponse& response);
284 virtual void didDisplayInsecureContent(blink::WebFrame* frame);
285 virtual void didRunInsecureContent(blink::WebFrame* frame,
286 const blink::WebSecurityOrigin& origin,
287 const blink::WebURL& target);
288 virtual void didAbortLoading(blink::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41289 virtual void didExhaustMemoryAvailableForScript(
[email protected]180ef242013-11-07 06:50:46290 blink::WebFrame* frame);
291 virtual void didCreateScriptContext(blink::WebFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41292 v8::Handle<v8::Context> context,
293 int extension_group,
[email protected]255eea092013-06-28 17:19:14294 int world_id);
[email protected]180ef242013-11-07 06:50:46295 virtual void willReleaseScriptContext(blink::WebFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41296 v8::Handle<v8::Context> context,
[email protected]255eea092013-06-28 17:19:14297 int world_id);
[email protected]180ef242013-11-07 06:50:46298 virtual void didFirstVisuallyNonEmptyLayout(blink::WebFrame* frame);
299 virtual void didChangeContentsSize(blink::WebFrame* frame,
300 const blink::WebSize& size);
301 virtual void didChangeScrollOffset(blink::WebFrame* frame);
302 virtual void willInsertBody(blink::WebFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41303 virtual void reportFindInPageMatchCount(int request_id,
304 int count,
[email protected]255eea092013-06-28 17:19:14305 bool final_update);
[email protected]85d85fd2013-06-19 00:57:41306 virtual void reportFindInPageSelection(int request_id,
307 int active_match_ordinal,
[email protected]180ef242013-11-07 06:50:46308 const blink::WebRect& sel);
[email protected]85d85fd2013-06-19 00:57:41309 virtual void requestStorageQuota(
[email protected]180ef242013-11-07 06:50:46310 blink::WebFrame* frame,
311 blink::WebStorageQuotaType type,
[email protected]85d85fd2013-06-19 00:57:41312 unsigned long long requested_size,
[email protected]45868f072014-02-06 11:58:59313 blink::WebStorageQuotaCallbacks callbacks);
[email protected]85d85fd2013-06-19 00:57:41314 virtual void willOpenSocketStream(
[email protected]180ef242013-11-07 06:50:46315 blink::WebSocketStreamHandle* handle);
[email protected]85d85fd2013-06-19 00:57:41316 virtual void willStartUsingPeerConnectionHandler(
[email protected]180ef242013-11-07 06:50:46317 blink::WebFrame* frame,
318 blink::WebRTCPeerConnectionHandler* handler);
[email protected]85d85fd2013-06-19 00:57:41319 virtual bool willCheckAndDispatchMessageEvent(
[email protected]180ef242013-11-07 06:50:46320 blink::WebFrame* sourceFrame,
321 blink::WebFrame* targetFrame,
322 blink::WebSecurityOrigin targetOrigin,
323 blink::WebDOMMessageEvent event);
324 virtual blink::WebString userAgentOverride(
325 blink::WebFrame* frame,
326 const blink::WebURL& url);
327 virtual blink::WebString doNotTrackValue(blink::WebFrame* frame);
328 virtual bool allowWebGL(blink::WebFrame* frame, bool default_value);
329 virtual void didLoseWebGLContext(blink::WebFrame* frame,
[email protected]255eea092013-06-28 17:19:14330 int arb_robustness_status_code);
[email protected]5cdd8fd82014-02-05 20:12:12331 virtual void forwardInputEvent(const blink::WebInputEvent* event);
[email protected]9ef43adc2014-02-19 08:02:15332 virtual void initializeChildFrame(const blink::WebRect& frame_rect,
333 float scale_factor);
[email protected]85d85fd2013-06-19 00:57:41334
[email protected]c6bc20332014-02-28 18:30:39335 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move
336 // this back to private member.
337 void OnNavigate(const FrameMsg_Navigate_Params& params);
338
[email protected]2f61bdd2013-07-02 18:38:47339 protected:
340 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id);
341
[email protected]227692c52013-05-31 22:43:04342 private:
[email protected]2e2d9632013-12-03 00:55:26343 friend class RenderFrameObserver;
[email protected]a09d53ce2014-01-31 00:46:42344 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
345 ShouldUpdateSelectionTextFromContextMenuParams);
[email protected]2e2d9632013-12-03 00:55:26346
[email protected]37567b432014-02-12 01:12:22347 typedef std::map<GURL, double> HostZoomLevels;
348
[email protected]2e2d9632013-12-03 00:55:26349 // Functions to add and remove observers for this object.
350 void AddObserver(RenderFrameObserver* observer);
351 void RemoveObserver(RenderFrameObserver* observer);
[email protected]1c2052f2013-08-28 08:24:34352
[email protected]37567b432014-02-12 01:12:22353 void UpdateURL(blink::WebFrame* frame);
354
[email protected]9c9343b2014-03-08 02:56:07355 // Gets the focused element. If no such element exists then the element will
356 // be NULL.
357 blink::WebElement GetFocusedElement();
358
[email protected]b70da4c2014-01-06 19:57:09359 // IPC message handlers ------------------------------------------------------
360 //
361 // The documentation for these functions should be in
362 // content/common/*_messages.h for the message that the function is handling.
[email protected]f76f32232014-03-11 17:36:17363 void OnBeforeUnload();
[email protected]b70da4c2014-01-06 19:57:09364 void OnSwapOut();
[email protected]f49722f2014-01-30 17:54:50365 void OnChildFrameProcessGone();
[email protected]bffc8302014-01-23 20:52:16366 void OnBuffersSwapped(const FrameMsg_BuffersSwapped_Params& params);
367 void OnCompositorFrameSwapped(const IPC::Message& message);
[email protected]a09d53ce2014-01-31 00:46:42368 void OnShowContextMenu(const gfx::Point& location);
369 void OnContextMenuClosed(const CustomContextMenuContext& custom_context);
370 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context,
371 unsigned action);
[email protected]9c9343b2014-03-08 02:56:07372 void OnCut();
373 void OnCopy();
374 void OnPaste();
[email protected]e31b8ebb2014-03-07 17:59:34375 void OnCSSInsertRequest(const std::string& css);
[email protected]9c9343b2014-03-08 02:56:07376
[email protected]65920f332014-03-04 21:14:18377 // Virtual since overridden by WebTestProxy for layout tests.
378 virtual blink::WebNavigationPolicy DecidePolicyForNavigation(
379 RenderFrame* render_frame,
380 blink::WebFrame* frame,
381 blink::WebDataSource::ExtraData* extraData,
382 const blink::WebURLRequest& request,
383 blink::WebNavigationType type,
384 blink::WebNavigationPolicy default_policy,
385 bool is_redirect);
386 void OpenURL(blink::WebFrame* frame,
387 const GURL& url,
388 const Referrer& referrer,
389 blink::WebNavigationPolicy policy);
[email protected]a09d53ce2014-01-31 00:46:42390
391 // Returns whether |params.selection_text| should be synchronized to the
392 // browser before bringing up the context menu. Static for testing.
393 static bool ShouldUpdateSelectionTextFromContextMenuParams(
394 const base::string16& selection_text,
395 size_t selection_text_offset,
396 const gfx::Range& selection_range,
397 const ContextMenuParams& params);
[email protected]b70da4c2014-01-06 19:57:09398
[email protected]a5ac6dc2014-01-15 07:02:14399 // Stores the WebFrame we are associated with.
[email protected]b70da4c2014-01-06 19:57:09400 blink::WebFrame* frame_;
401
[email protected]abc501e2014-01-27 19:27:26402 base::WeakPtr<RenderViewImpl> render_view_;
[email protected]227692c52013-05-31 22:43:04403 int routing_id_;
[email protected]1c2052f2013-08-28 08:24:34404 bool is_swapped_out_;
405 bool is_detaching_;
[email protected]227692c52013-05-31 22:43:04406
[email protected]7a4e2532013-12-02 21:30:02407#if defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02408 // Current text input composition text. Empty if no composition is in
409 // progress.
[email protected]fcf75d42013-12-03 20:11:26410 base::string16 pepper_composition_text_;
[email protected]7a4e2532013-12-02 21:30:02411#endif
412
[email protected]f3add922013-12-20 23:17:16413 RendererWebCookieJarImpl cookie_jar_;
414
[email protected]2e2d9632013-12-03 00:55:26415 // All the registered observers.
416 ObserverList<RenderFrameObserver> observers_;
417
[email protected]bffc8302014-01-23 20:52:16418 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
419
[email protected]a09d53ce2014-01-31 00:46:42420 // External context menu requests we're waiting for. "Internal"
421 // (WebKit-originated) context menu events will have an ID of 0 and will not
422 // be in this map.
423 //
424 // We don't want to add internal ones since some of the "special" page
425 // handlers in the browser process just ignore the context menu requests so
426 // avoid showing context menus, and so this will cause right clicks to leak
427 // entries in this map. Most users of the custom context menu (e.g. Pepper
428 // plugins) are normally only on "regular" pages and the regular pages will
429 // always respond properly to the request, so we don't have to worry so
430 // much about leaks.
431 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_;
432
[email protected]227692c52013-05-31 22:43:04433 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
434};
435
436} // namespace content
437
[email protected]85d85fd2013-06-19 00:57:41438#endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_