blob: bf354fffb6926602d1298bd9c90d4bf46c6943f9 [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"
[email protected]95640212014-07-26 18:14:3017#include "content/common/accessibility_mode_enums.h"
clamyda97e8322014-10-07 21:57:2518#include "content/common/frame_message_enums.h"
[email protected]c52a1412014-06-25 06:09:2519#include "content/common/mojo/service_registry_impl.h"
[email protected]87de04b02014-04-08 22:14:4920#include "content/public/common/javascript_message_type.h"
[email protected]65920f332014-03-04 21:14:1821#include "content/public/common/referrer.h"
[email protected]227692c52013-05-31 22:43:0422#include "content/public/renderer/render_frame.h"
[email protected]5a7100d2014-05-19 01:29:0423#include "content/renderer/render_frame_proxy.h"
[email protected]f3add922013-12-20 23:17:1624#include "content/renderer/renderer_webcookiejar_impl.h"
[email protected]227692c52013-05-31 22:43:0425#include "ipc/ipc_message.h"
acolwell9e0840d2014-09-06 19:01:3226#include "media/blink/webmediaplayer_delegate.h"
[email protected]95640212014-07-26 18:14:3027#include "third_party/WebKit/public/web/WebAXObject.h"
[email protected]85d85fd2013-06-19 00:57:4128#include "third_party/WebKit/public/web/WebDataSource.h"
29#include "third_party/WebKit/public/web/WebFrameClient.h"
[email protected]680575542014-04-03 17:12:5230#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
zhenwd47fd722014-11-13 00:43:4731#include "third_party/WebKit/public/web/WebTransitionElementData.h"
[email protected]4ee64622014-03-21 22:34:1532#include "ui/gfx/range/range.h"
[email protected]227692c52013-05-31 22:43:0433
tommyclid481c482014-12-03 01:50:4134#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:3835#include "content/renderer/pepper/plugin_power_saver_helper.h"
tommyclid481c482014-12-03 01:50:4136#endif
37
[email protected]a017938b2014-05-27 21:17:1738#if defined(OS_ANDROID)
39#include "content/renderer/media/android/renderer_media_player_manager.h"
40#endif
41
clamy9bfeef42014-09-30 20:50:4242class GURL;
[email protected]7a4e2532013-12-02 21:30:0243class TransportDIB;
zhenw70986bd2014-10-20 18:50:2644struct FrameHostMsg_AddNavigationTransitionData_Params;
[email protected]c6bc20332014-02-28 18:30:3945struct FrameMsg_Navigate_Params;
clamy79b3da62014-10-14 08:50:3746struct FrameMsg_RequestNavigation_Params;
[email protected]7a4e2532013-12-02 21:30:0247
48namespace blink {
[email protected]5ee7f182014-04-25 19:45:2649class WebGeolocationClient;
[email protected]7a4e2532013-12-02 21:30:0250class WebMouseEvent;
[email protected]82ce5b92014-03-22 05:15:2651class WebContentDecryptionModule;
[email protected]96307312014-05-04 01:00:1952class WebMediaPlayer;
[email protected]45920862014-07-02 12:53:0253class WebPushClient;
[email protected]82ce5b92014-03-22 05:15:2654class WebSecurityOrigin;
[email protected]7a4e2532013-12-02 21:30:0255struct WebCompositionUnderline;
[email protected]a09d53ce2014-01-31 00:46:4256struct WebContextMenuData;
[email protected]7a4e2532013-12-02 21:30:0257struct WebCursorInfo;
zhenwd47fd722014-11-13 00:43:4758struct WebTransitionElementData;
[email protected]7a4e2532013-12-02 21:30:0259}
60
61namespace gfx {
[email protected]a09d53ce2014-01-31 00:46:4262class Point;
[email protected]7a4e2532013-12-02 21:30:0263class Range;
64class Rect;
65}
66
[email protected]227692c52013-05-31 22:43:0467namespace content {
68
[email protected]bffc8302014-01-23 20:52:1669class ChildFrameCompositingHelper;
avi485e5fd62014-08-25 23:26:1470class ExternalPopupMenu;
[email protected]8eae0802014-06-02 21:35:5571class GeolocationDispatcher;
mlamouriefdca9d2014-09-16 16:55:4072class ManifestManager;
[email protected]977db4a42014-07-17 08:04:3273class MediaStreamDispatcher;
[email protected]ae2477e2014-05-27 23:47:0874class MediaStreamRendererFactory;
[email protected]52d3e172014-06-16 16:57:0275class MidiDispatcher;
[email protected]4459599e2014-07-29 22:40:0976class NotificationPermissionDispatcher;
clamyda97e8322014-10-07 21:57:2577class PageState;
[email protected]7a4e2532013-12-02 21:30:0278class PepperPluginInstanceImpl;
[email protected]45920862014-07-02 12:53:0279class PushMessagingDispatcher;
[email protected]95640212014-07-26 18:14:3080class RendererAccessibility;
[email protected]4b556cf2014-06-10 23:21:5381class RendererCdmManager;
82class RendererMediaPlayerManager;
[email protected]7a4e2532013-12-02 21:30:0283class RendererPpapiHost;
[email protected]2e2d9632013-12-03 00:55:2684class RenderFrameObserver;
[email protected]227692c52013-05-31 22:43:0485class RenderViewImpl;
[email protected]7a4e2532013-12-02 21:30:0286class RenderWidget;
87class RenderWidgetFullscreenPepper;
[email protected]cf78eda2014-06-13 16:57:4188class ScreenOrientationDispatcher;
perkj1a2d0432014-09-03 13:52:3389class UserMediaClientImpl;
clamy9bfeef42014-09-30 20:50:4290struct CommitNavigationParams;
91struct CommonNavigationParams;
[email protected]a09d53ce2014-01-31 00:46:4292struct CustomContextMenuContext;
alexmosbc7eafa2014-12-06 01:38:0993struct FrameReplicationState;
clamy79b3da62014-10-14 08:50:3794struct RequestNavigationParams;
davidbena5496d62014-10-07 18:52:0495struct ResourceResponseHead;
[email protected]227692c52013-05-31 22:43:0496
[email protected]85d85fd2013-06-19 00:57:4197class CONTENT_EXPORT RenderFrameImpl
98 : public RenderFrame,
[email protected]96307312014-05-04 01:00:1999 NON_EXPORTED_BASE(public blink::WebFrameClient),
acolwell9e0840d2014-09-06 19:01:32100 NON_EXPORTED_BASE(public media::WebMediaPlayerDelegate) {
[email protected]227692c52013-05-31 22:43:04101 public:
[email protected]2f61bdd2013-07-02 18:38:47102 // Creates a new RenderFrame. |render_view| is the RenderView object that this
103 // frame belongs to.
[email protected]b70da4c2014-01-06 19:57:09104 // Callers *must* call |SetWebFrame| immediately after creation.
[email protected]82307f6b2014-08-07 03:30:12105 // Note: This is called only when RenderFrame is created by Blink through
106 // createChildFrame.
[email protected]b70da4c2014-01-06 19:57:09107 // TODO(creis): We should structure this so that |SetWebFrame| isn't needed.
[email protected]2f61bdd2013-07-02 18:38:47108 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);
109
[email protected]82307f6b2014-08-07 03:30:12110 // Creates a new RenderFrame with |routing_id| as a child of the RenderFrame
111 // identified by |parent_routing_id| or as the top-level frame if the latter
japhete6adf142014-10-31 00:01:49112 // is MSG_ROUTING_NONE. If |proxy_routing_id| is MSG_ROUTING_NONE, it creates
113 // the Blink WebLocalFrame and inserts it in the proper place in the frame
114 // tree. Otherwise, the frame is semi-orphaned until it commits, at which
115 // point it replaces the proxy identified by |proxy_routing_id|.
[email protected]82307f6b2014-08-07 03:30:12116 // Note: This is called only when RenderFrame is being created in response to
117 // IPC message from the browser process. All other frame creation is driven
118 // through Blink and Create.
japhete6adf142014-10-31 00:01:49119 static void CreateFrame(int routing_id,
120 int parent_routing_id,
121 int proxy_routing_id);
[email protected]82307f6b2014-08-07 03:30:12122
[email protected]5a7100d2014-05-19 01:29:04123 // Returns the RenderFrameImpl for the given routing ID.
124 static RenderFrameImpl* FromRoutingID(int routing_id);
125
[email protected]a5ac6dc2014-01-15 07:02:14126 // Just like RenderFrame::FromWebFrame but returns the implementation.
127 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:09128
[email protected]2f61bdd2013-07-02 18:38:47129 // Used by content_layouttest_support to hook into the creation of
130 // RenderFrameImpls.
dongseong.hwangb721ddf2014-12-10 21:22:50131 using CreateRenderFrameImplFunction = RenderFrameImpl* (*)(RenderViewImpl*,
132 int32);
[email protected]2f61bdd2013-07-02 18:38:47133 static void InstallCreateHook(
dongseong.hwangb721ddf2014-12-10 21:22:50134 CreateRenderFrameImplFunction create_render_frame_impl);
[email protected]2f61bdd2013-07-02 18:38:47135
[email protected]227692c52013-05-31 22:43:04136 virtual ~RenderFrameImpl();
137
[email protected]b70da4c2014-01-06 19:57:09138 bool is_swapped_out() const {
139 return is_swapped_out_;
140 }
141
[email protected]5a7100d2014-05-19 01:29:04142 // TODO(nasko): This can be removed once we don't have a swapped out state on
143 // RenderFrames. See https://crbug.com/357747.
144 void set_render_frame_proxy(RenderFrameProxy* proxy) {
145 render_frame_proxy_ = proxy;
146 }
147
[email protected]bffc8302014-01-23 20:52:16148 // Out-of-process child frames receive a signal from RenderWidgetCompositor
149 // when a compositor frame has committed.
150 void DidCommitCompositorFrame();
151
[email protected]7a4e2532013-12-02 21:30:02152 // TODO(jam): this is a temporary getter until all the code is transitioned
153 // to using RenderFrame instead of RenderView.
[email protected]abc501e2014-01-27 19:27:26154 RenderViewImpl* render_view() { return render_view_.get(); }
[email protected]7a4e2532013-12-02 21:30:02155
[email protected]f3add922013-12-20 23:17:16156 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; }
157
[email protected]7a4e2532013-12-02 21:30:02158 // Returns the RenderWidget associated with this frame.
159 RenderWidget* GetRenderWidget();
160
[email protected]35b2a972014-04-04 15:50:22161 // This is called right after creation with the WebLocalFrame for this
[email protected]0287e762014-04-11 13:07:58162 // RenderFrame. It must be called before Initialize.
[email protected]35b2a972014-04-04 15:50:22163 void SetWebFrame(blink::WebLocalFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:09164
[email protected]0287e762014-04-11 13:07:58165 // This method must be called after the frame has been added to the frame
166 // tree. It creates all objects that depend on the frame being at its proper
167 // spot.
168 void Initialize();
169
[email protected]de3c5d82014-05-28 22:12:59170 // Notifications from RenderWidget.
171 void WasHidden();
172 void WasShown();
173
[email protected]723971b2014-02-12 11:08:25174 // Start/Stop loading notifications.
175 // TODO(nasko): Those are page-level methods at this time and come from
176 // WebViewClient. We should move them to be WebFrameClient calls and put
177 // logic in the browser side to balance starts/stops.
[email protected]e3b10d12014-03-28 16:06:09178 // |to_different_document| will be true unless the load is a fragment
179 // navigation, or triggered by history.pushState/replaceState.
[email protected]6dd5c322014-03-12 07:58:46180 virtual void didStartLoading(bool to_different_document);
181 virtual void didStopLoading();
182 virtual void didChangeLoadProgress(double load_progress);
[email protected]723971b2014-02-12 11:08:25183
[email protected]95640212014-07-26 18:14:30184 AccessibilityMode accessibility_mode() {
185 return accessibility_mode_;
186 }
187
188 RendererAccessibility* renderer_accessibility() {
189 return renderer_accessibility_;
190 }
191
192 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj,
193 blink::WebAXEvent event);
194
195 // TODO(dmazzoni): the only reason this is here is to plumb it through to
196 // RendererAccessibility. It should be part of RenderFrameObserver, once
197 // blink has a separate accessibility tree per frame.
198 void FocusedNodeChanged(const blink::WebNode& node);
199
[email protected]7a4e2532013-12-02 21:30:02200#if defined(ENABLE_PLUGINS)
[email protected]271ff5792013-12-04 22:29:31201 // Notification that a PPAPI plugin has been created.
202 void PepperPluginCreated(RendererPpapiHost* host);
203
[email protected]7a4e2532013-12-02 21:30:02204 // Notifies that |instance| has changed the cursor.
205 // This will update the cursor appearance if it is currently over the plugin
206 // instance.
207 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance,
208 const blink::WebCursorInfo& cursor);
209
210 // Notifies that |instance| has received a mouse event.
211 void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance);
212
[email protected]7a4e2532013-12-02 21:30:02213 // Informs the render view that a PPAPI plugin has changed text input status.
214 void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance);
215 void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance);
216
217 // Cancels current composition.
218 void PepperCancelComposition(PepperPluginInstanceImpl* instance);
219
220 // Informs the render view that a PPAPI plugin has changed selection.
221 void PepperSelectionChanged(PepperPluginInstanceImpl* instance);
222
223 // Creates a fullscreen container for a pepper plugin instance.
224 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
225 PepperPluginInstanceImpl* plugin);
226
[email protected]7a4e2532013-12-02 21:30:02227 bool IsPepperAcceptingCompositionEvents() const;
228
229 // Notification that the given plugin has crashed.
230 void PluginCrashed(const base::FilePath& plugin_path,
231 base::ProcessId plugin_pid);
232
[email protected]7a4e2532013-12-02 21:30:02233 // Simulates IME events for testing purpose.
234 void SimulateImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26235 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02236 const std::vector<blink::WebCompositionUnderline>& underlines,
237 int selection_start,
238 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26239 void SimulateImeConfirmComposition(const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02240 const gfx::Range& replacement_range);
241
242 // TODO(jam): remove these once the IPC handler moves from RenderView to
243 // RenderFrame.
244 void OnImeSetComposition(
tommyclie6633ca72014-10-31 00:40:42245 const base::string16& text,
246 const std::vector<blink::WebCompositionUnderline>& underlines,
247 int selection_start,
248 int selection_end);
249 void OnImeConfirmComposition(const base::string16& text,
250 const gfx::Range& replacement_range,
251 bool keep_selection);
252#endif // defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02253
[email protected]977db4a42014-07-17 08:04:32254 // May return NULL in some cases, especially if userMediaClient() returns
255 // NULL.
256 MediaStreamDispatcher* GetMediaStreamDispatcher();
257
avi485e5fd62014-08-25 23:26:14258#if defined(OS_MACOSX) || defined(OS_ANDROID)
259 void DidHideExternalPopupMenu();
260#endif
261
[email protected]227692c52013-05-31 22:43:04262 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52263 bool Send(IPC::Message* msg) override;
[email protected]227692c52013-05-31 22:43:04264
265 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52266 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]227692c52013-05-31 22:43:04267
[email protected]271ff5792013-12-04 22:29:31268 // RenderFrame implementation:
dcheng6d18e402014-10-21 12:32:52269 RenderView* GetRenderView() override;
270 int GetRoutingID() override;
271 blink::WebLocalFrame* GetWebFrame() override;
272 WebPreferences& GetWebkitPreferences() override;
273 int ShowContextMenu(ContextMenuClient* client,
274 const ContextMenuParams& params) override;
275 void CancelContextMenu(int request_id) override;
276 blink::WebNode GetContextMenuNode() const override;
tommycli59bd86c2014-12-10 02:09:38277 blink::WebPlugin* CreatePlugin(
278 blink::WebFrame* frame,
279 const WebPluginInfo& info,
280 const blink::WebPluginParams& params,
281 PluginPowerSaverMode power_saver_mode) override;
dcheng6d18e402014-10-21 12:32:52282 void LoadURLExternally(blink::WebLocalFrame* frame,
283 const blink::WebURLRequest& request,
284 blink::WebNavigationPolicy policy) override;
285 void ExecuteJavaScript(const base::string16& javascript) override;
286 bool IsHidden() override;
287 ServiceRegistry* GetServiceRegistry() override;
tommyclid481c482014-12-03 01:50:41288#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:38289 void RegisterPeripheralPlugin(
290 const GURL& content_origin,
291 const base::Closure& unthrottle_callback) override;
292 bool ShouldThrottleContent(const blink::WebPluginParams& params,
293 const GURL& page_frame_url,
294 GURL* poster_image,
295 bool* cross_origin_main_content) const override;
296 void WhitelistContentOrigin(const GURL& content_origin) override;
tommyclid481c482014-12-03 01:50:41297#endif
dcheng6d18e402014-10-21 12:32:52298 bool IsFTPDirectoryListing() override;
299 void AttachGuest(int element_instance_id) override;
fsamuela95fef42014-12-03 20:16:52300 void DetachGuest(int element_instance_id) override;
dcheng6d18e402014-10-21 12:32:52301 void SetSelectedText(const base::string16& selection_text,
302 size_t offset,
303 const gfx::Range& range) override;
304 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate,
305 v8::Handle<v8::Context> context) override;
[email protected]271ff5792013-12-04 22:29:31306
[email protected]96307312014-05-04 01:00:19307 // blink::WebFrameClient implementation:
jbroman73e9f7962014-10-30 00:43:45308 blink::WebPluginPlaceholder* createPluginPlaceholder(
309 blink::WebLocalFrame*,
310 const blink::WebPluginParams&) override;
[email protected]35b2a972014-04-04 15:50:22311 virtual blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame,
312 const blink::WebPluginParams& params);
jrummell65b7d272014-09-24 20:49:27313 // TODO(jrummell): Remove this method once blink updated.
[email protected]180ef242013-11-07 06:50:46314 virtual blink::WebMediaPlayer* createMediaPlayer(
[email protected]35b2a972014-04-04 15:50:22315 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46316 const blink::WebURL& url,
317 blink::WebMediaPlayerClient* client);
jrummell65b7d272014-09-24 20:49:27318 virtual blink::WebMediaPlayer* createMediaPlayer(
319 blink::WebLocalFrame* frame,
320 const blink::WebURL& url,
321 blink::WebMediaPlayerClient* client,
322 blink::WebContentDecryptionModule* initial_cdm);
[email protected]82ce5b92014-03-22 05:15:26323 virtual blink::WebContentDecryptionModule* createContentDecryptionModule(
[email protected]35b2a972014-04-04 15:50:22324 blink::WebLocalFrame* frame,
[email protected]82ce5b92014-03-22 05:15:26325 const blink::WebSecurityOrigin& security_origin,
326 const blink::WebString& key_system);
[email protected]180ef242013-11-07 06:50:46327 virtual blink::WebApplicationCacheHost* createApplicationCacheHost(
[email protected]35b2a972014-04-04 15:50:22328 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46329 blink::WebApplicationCacheHostClient* client);
330 virtual blink::WebWorkerPermissionClientProxy*
[email protected]35b2a972014-04-04 15:50:22331 createWorkerPermissionClientProxy(blink::WebLocalFrame* frame);
[email protected]b20c3222014-08-22 00:50:22332 virtual blink::WebExternalPopupMenu* createExternalPopupMenu(
333 const blink::WebPopupMenuInfo& popup_menu_info,
334 blink::WebExternalPopupMenuClient* popup_menu_client);
[email protected]35b2a972014-04-04 15:50:22335 virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame);
[email protected]180ef242013-11-07 06:50:46336 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider(
[email protected]35b2a972014-04-04 15:50:22337 blink::WebLocalFrame* frame);
338 virtual void didAccessInitialDocument(blink::WebLocalFrame* frame);
339 virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent,
340 const blink::WebString& name);
341 virtual void didDisownOpener(blink::WebLocalFrame* frame);
[email protected]180ef242013-11-07 06:50:46342 virtual void frameDetached(blink::WebFrame* frame);
[email protected]9c9343b2014-03-08 02:56:07343 virtual void frameFocused();
[email protected]180ef242013-11-07 06:50:46344 virtual void willClose(blink::WebFrame* frame);
[email protected]35b2a972014-04-04 15:50:22345 virtual void didChangeName(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46346 const blink::WebString& name);
[email protected]f5b6dd1122013-10-04 02:42:50347 virtual void didMatchCSS(
[email protected]35b2a972014-04-04 15:50:22348 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46349 const blink::WebVector<blink::WebString>& newly_matching_selectors,
350 const blink::WebVector<blink::WebString>& stopped_matching_selectors);
[email protected]c31a84802014-04-03 15:55:49351 virtual bool shouldReportDetailedMessageForSource(
352 const blink::WebString& source);
353 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message,
354 const blink::WebString& source_name,
355 unsigned source_line,
356 const blink::WebString& stack_trace);
[email protected]35b2a972014-04-04 15:50:22357 virtual void loadURLExternally(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46358 const blink::WebURLRequest& request,
[email protected]35b2a972014-04-04 15:50:22359 blink::WebNavigationPolicy policy,
360 const blink::WebString& suggested_name);
[email protected]1a4e9752013-12-31 20:10:58361 // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass.
[email protected]180ef242013-11-07 06:50:46362 virtual blink::WebNavigationPolicy decidePolicyForNavigation(
[email protected]0c3c54f2014-07-31 01:29:00363 const NavigationPolicyInfo& info);
[email protected]680575542014-04-03 17:12:52364 virtual blink::WebHistoryItem historyItemForNewChildFrame(
365 blink::WebFrame* frame);
[email protected]35b2a972014-04-04 15:50:22366 virtual void willSendSubmitEvent(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46367 const blink::WebFormElement& form);
[email protected]35b2a972014-04-04 15:50:22368 virtual void willSubmitForm(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46369 const blink::WebFormElement& form);
[email protected]35b2a972014-04-04 15:50:22370 virtual void didCreateDataSource(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46371 blink::WebDataSource* datasource);
[email protected]0c3c54f2014-07-31 01:29:00372 virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame,
373 bool is_transition_navigation);
[email protected]85d85fd2013-06-19 00:57:41374 virtual void didReceiveServerRedirectForProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22375 blink::WebLocalFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41376 virtual void didFailProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22377 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46378 const blink::WebURLError& error);
[email protected]680575542014-04-03 17:12:52379 virtual void didCommitProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22380 blink::WebLocalFrame* frame,
[email protected]680575542014-04-03 17:12:52381 const blink::WebHistoryItem& item,
382 blink::WebHistoryCommitType commit_type);
rob5ef11ff2014-11-17 23:56:20383 virtual void didCreateNewDocument(blink::WebLocalFrame* frame);
[email protected]06181e52014-05-10 11:59:09384 virtual void didClearWindowObject(blink::WebLocalFrame* frame);
[email protected]35b2a972014-04-04 15:50:22385 virtual void didCreateDocumentElement(blink::WebLocalFrame* frame);
386 virtual void didReceiveTitle(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46387 const blink::WebString& title,
388 blink::WebTextDirection direction);
[email protected]35b2a972014-04-04 15:50:22389 virtual void didChangeIcon(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46390 blink::WebIconURL::Type icon_type);
[email protected]35b2a972014-04-04 15:50:22391 virtual void didFinishDocumentLoad(blink::WebLocalFrame* frame);
392 virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame);
393 virtual void didFailLoad(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46394 const blink::WebURLError& error);
[email protected]45d877f2014-04-05 07:36:22395 virtual void didFinishLoad(blink::WebLocalFrame* frame);
396 virtual void didNavigateWithinPage(blink::WebLocalFrame* frame,
[email protected]680575542014-04-03 17:12:52397 const blink::WebHistoryItem& item,
398 blink::WebHistoryCommitType commit_type);
[email protected]35b2a972014-04-04 15:50:22399 virtual void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame);
[email protected]9e6bea412014-08-08 06:35:25400 virtual void addNavigationTransitionData(
zhenwd47fd722014-11-13 00:43:47401 const blink::WebTransitionElementData& data);
[email protected]37b64c52014-07-11 21:14:05402 virtual void didChangeThemeColor();
[email protected]4459599e2014-07-29 22:40:09403 virtual void requestNotificationPermission(
404 const blink::WebSecurityOrigin& origin,
405 blink::WebNotificationPermissionCallback* callback);
[email protected]c3f2c702014-03-19 23:39:48406 virtual void didChangeSelection(bool is_empty_selection);
[email protected]f3c59d62014-04-09 16:33:55407 virtual blink::WebColorChooser* createColorChooser(
[email protected]eb8c216a2014-04-09 19:19:19408 blink::WebColorChooserClient* client,
[email protected]f3c59d62014-04-09 16:33:55409 const blink::WebColor& initial_color,
410 const blink::WebVector<blink::WebColorSuggestion>& suggestions);
[email protected]87de04b02014-04-08 22:14:49411 virtual void runModalAlertDialog(const blink::WebString& message);
412 virtual bool runModalConfirmDialog(const blink::WebString& message);
413 virtual bool runModalPromptDialog(const blink::WebString& message,
414 const blink::WebString& default_value,
415 blink::WebString* actual_value);
416 virtual bool runModalBeforeUnloadDialog(bool is_reload,
417 const blink::WebString& message);
[email protected]12cc5112014-03-03 17:01:10418 virtual void showContextMenu(const blink::WebContextMenuData& data);
[email protected]91070342014-03-07 00:29:02419 virtual void clearContextMenu();
[email protected]35b2a972014-04-04 15:50:22420 virtual void willSendRequest(blink::WebLocalFrame* frame,
421 unsigned identifier,
422 blink::WebURLRequest& request,
423 const blink::WebURLResponse& redirect_response);
424 virtual void didReceiveResponse(blink::WebLocalFrame* frame,
425 unsigned identifier,
426 const blink::WebURLResponse& response);
427 virtual void didFinishResourceLoad(blink::WebLocalFrame* frame,
[email protected]255eea092013-06-28 17:19:14428 unsigned identifier);
[email protected]85d85fd2013-06-19 00:57:41429 virtual void didLoadResourceFromMemoryCache(
[email protected]35b2a972014-04-04 15:50:22430 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46431 const blink::WebURLRequest& request,
432 const blink::WebURLResponse& response);
[email protected]35b2a972014-04-04 15:50:22433 virtual void didDisplayInsecureContent(blink::WebLocalFrame* frame);
434 virtual void didRunInsecureContent(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46435 const blink::WebSecurityOrigin& origin,
436 const blink::WebURL& target);
[email protected]35b2a972014-04-04 15:50:22437 virtual void didAbortLoading(blink::WebLocalFrame* frame);
438 virtual void didCreateScriptContext(blink::WebLocalFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41439 v8::Handle<v8::Context> context,
440 int extension_group,
[email protected]255eea092013-06-28 17:19:14441 int world_id);
[email protected]35b2a972014-04-04 15:50:22442 virtual void willReleaseScriptContext(blink::WebLocalFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41443 v8::Handle<v8::Context> context,
[email protected]255eea092013-06-28 17:19:14444 int world_id);
[email protected]35b2a972014-04-04 15:50:22445 virtual void didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame);
[email protected]35b2a972014-04-04 15:50:22446 virtual void didChangeScrollOffset(blink::WebLocalFrame* frame);
447 virtual void willInsertBody(blink::WebLocalFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41448 virtual void reportFindInPageMatchCount(int request_id,
449 int count,
[email protected]255eea092013-06-28 17:19:14450 bool final_update);
[email protected]85d85fd2013-06-19 00:57:41451 virtual void reportFindInPageSelection(int request_id,
452 int active_match_ordinal,
[email protected]180ef242013-11-07 06:50:46453 const blink::WebRect& sel);
[email protected]35b2a972014-04-04 15:50:22454 virtual void requestStorageQuota(blink::WebLocalFrame* frame,
455 blink::WebStorageQuotaType type,
456 unsigned long long requested_size,
457 blink::WebStorageQuotaCallbacks callbacks);
[email protected]a14903e02014-06-02 07:35:12458 virtual void willOpenWebSocket(blink::WebSocketHandle* handle);
[email protected]5ee7f182014-04-25 19:45:26459 virtual blink::WebGeolocationClient* geolocationClient();
[email protected]45920862014-07-02 12:53:02460 virtual blink::WebPushClient* pushClient();
[email protected]85d85fd2013-06-19 00:57:41461 virtual void willStartUsingPeerConnectionHandler(
[email protected]35b2a972014-04-04 15:50:22462 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46463 blink::WebRTCPeerConnectionHandler* handler);
[email protected]bfe45e22014-04-25 16:47:53464 virtual blink::WebUserMediaClient* userMediaClient();
[email protected]8538385f2014-04-25 19:45:04465 virtual blink::WebMIDIClient* webMIDIClient();
[email protected]85d85fd2013-06-19 00:57:41466 virtual bool willCheckAndDispatchMessageEvent(
[email protected]ce5064f2014-05-07 22:49:20467 blink::WebLocalFrame* source_frame,
468 blink::WebFrame* target_frame,
469 blink::WebSecurityOrigin target_origin,
[email protected]180ef242013-11-07 06:50:46470 blink::WebDOMMessageEvent event);
[email protected]35b2a972014-04-04 15:50:22471 virtual blink::WebString userAgentOverride(blink::WebLocalFrame* frame,
472 const blink::WebURL& url);
473 virtual blink::WebString doNotTrackValue(blink::WebLocalFrame* frame);
474 virtual bool allowWebGL(blink::WebLocalFrame* frame, bool default_value);
475 virtual void didLoseWebGLContext(blink::WebLocalFrame* frame,
[email protected]255eea092013-06-28 17:19:14476 int arb_robustness_status_code);
[email protected]cf78eda2014-06-13 16:57:41477 virtual blink::WebScreenOrientationClient* webScreenOrientationClient();
nhirokifebadeed2014-10-29 04:02:47478 virtual bool isControlledByServiceWorker(blink::WebDataSource& data_source);
479 virtual int64_t serviceWorkerID(blink::WebDataSource& data_source);
dmazzoni0b5d2482014-09-10 19:45:57480 virtual void postAccessibilityEvent(const blink::WebAXObject& obj,
481 blink::WebAXEvent event);
dmazzoni1a69e2b32014-11-06 20:34:28482 virtual void handleAccessibilityFindInPageResult(
483 int identifier,
484 int match_index,
485 const blink::WebAXObject& start_object,
486 int start_offset,
487 const blink::WebAXObject& end_object,
488 int end_offset);
mlamouriefdca9d2014-09-16 16:55:40489 virtual void didChangeManifest(blink::WebLocalFrame*);
[email protected]85d85fd2013-06-19 00:57:41490
[email protected]96307312014-05-04 01:00:19491 // WebMediaPlayerDelegate implementation:
dcheng6d18e402014-10-21 12:32:52492 void DidPlay(blink::WebMediaPlayer* player) override;
493 void DidPause(blink::WebMediaPlayer* player) override;
494 void PlayerGone(blink::WebMediaPlayer* player) override;
[email protected]96307312014-05-04 01:00:19495
[email protected]c6bc20332014-02-28 18:30:39496 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move
497 // this back to private member.
498 void OnNavigate(const FrameMsg_Navigate_Params& params);
499
nasko78f06bc2014-11-18 18:18:57500 // Make this frame show an empty, unscriptable page.
501 // TODO(nasko): Remove this method once swapped out state is no longer used.
502 void NavigateToSwappedOutURL();
503
[email protected]c52a1412014-06-25 06:09:25504 // Binds this render frame's service registry to a handle to the remote
505 // service registry.
506 void BindServiceRegistry(
507 mojo::ScopedMessagePipeHandle service_provider_handle);
508
mlamouri4fff1992014-09-30 11:22:46509 ManifestManager* manifest_manager();
510
[email protected]2f61bdd2013-07-02 18:38:47511 protected:
512 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id);
513
[email protected]227692c52013-05-31 22:43:04514 private:
[email protected]2e2d9632013-12-03 00:55:26515 friend class RenderFrameObserver;
[email protected]95640212014-07-26 18:14:30516 friend class RendererAccessibilityTest;
avi485e5fd62014-08-25 23:26:14517 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem);
518 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
519 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
520 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
[email protected]66bbadaf2014-03-28 16:25:54521 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest,
522 AccessibilityMessagesQueueWhileSwappedOut);
[email protected]4ee64622014-03-21 22:34:15523 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
524 OnExtendSelectionAndDelete);
[email protected]66bbadaf2014-03-28 16:25:54525 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut);
526 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK);
alexmosbc7eafa2014-12-06 01:38:09527 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OriginReplicationForSwapOut);
[email protected]4ee64622014-03-21 22:34:15528 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
529 SetEditableSelectionAndComposition);
[email protected]95640212014-07-26 18:14:30530 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
531 OnSetAccessibilityMode);
[email protected]2e2d9632013-12-03 00:55:26532
[email protected]37567b432014-02-12 01:12:22533 typedef std::map<GURL, double> HostZoomLevels;
534
[email protected]2e2d9632013-12-03 00:55:26535 // Functions to add and remove observers for this object.
536 void AddObserver(RenderFrameObserver* observer);
537 void RemoveObserver(RenderFrameObserver* observer);
[email protected]1c2052f2013-08-28 08:24:34538
[email protected]f0906a02014-08-07 07:18:55539 // Builds and sends DidCommitProvisionalLoad to the host.
540 void SendDidCommitProvisionalLoad(blink::WebFrame* frame);
[email protected]37567b432014-02-12 01:12:22541
[email protected]9c9343b2014-03-08 02:56:07542 // Gets the focused element. If no such element exists then the element will
543 // be NULL.
544 blink::WebElement GetFocusedElement();
545
[email protected]b70da4c2014-01-06 19:57:09546 // IPC message handlers ------------------------------------------------------
547 //
548 // The documentation for these functions should be in
549 // content/common/*_messages.h for the message that the function is handling.
[email protected]f76f32232014-03-11 17:36:17550 void OnBeforeUnload();
alexmosbc7eafa2014-12-06 01:38:09551 void OnSwapOut(int proxy_routing_id,
552 const FrameReplicationState& replicated_frame_state);
Nasko Oskov85f60222014-08-28 22:53:30553 void OnStop();
[email protected]a09d53ce2014-01-31 00:46:42554 void OnShowContextMenu(const gfx::Point& location);
555 void OnContextMenuClosed(const CustomContextMenuContext& custom_context);
556 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context,
557 unsigned action);
[email protected]4ee64622014-03-21 22:34:15558 void OnUndo();
559 void OnRedo();
[email protected]9c9343b2014-03-08 02:56:07560 void OnCut();
561 void OnCopy();
562 void OnPaste();
[email protected]4ee64622014-03-21 22:34:15563 void OnPasteAndMatchStyle();
564 void OnDelete();
565 void OnSelectAll();
christiankaeed9862014-11-05 10:49:14566 void OnSelectRange(const gfx::Point& base, const gfx::Point& extent);
[email protected]4ee64622014-03-21 22:34:15567 void OnUnselect();
christiankaeed9862014-11-05 10:49:14568 void OnMoveRangeSelectionExtent(const gfx::Point& point);
[email protected]1f3fc1d2014-04-03 14:50:17569 void OnReplace(const base::string16& text);
570 void OnReplaceMisspelling(const base::string16& text);
[email protected]e31b8ebb2014-03-07 17:59:34571 void OnCSSInsertRequest(const std::string& css);
[email protected]f13ab892014-03-12 06:48:52572 void OnJavaScriptExecuteRequest(const base::string16& javascript,
573 int id,
574 bool notify_result);
zeeshanq3454e9c2014-09-04 21:30:28575 void OnJavaScriptExecuteRequestForTests(const base::string16& javascript,
576 int id,
577 bool notify_result);
[email protected]4ee64622014-03-21 22:34:15578 void OnSetEditableSelectionOffsets(int start, int end);
[email protected]e5e438d62014-03-27 21:47:16579 void OnSetCompositionFromExistingText(
580 int start, int end,
581 const std::vector<blink::WebCompositionUnderline>& underlines);
582 void OnExtendSelectionAndDelete(int before, int after);
[email protected]4fed3702014-04-01 09:08:00583 void OnReload(bool ignore_cache);
[email protected]96bb6132014-06-16 17:22:19584 void OnTextSurroundingSelectionRequest(size_t max_length);
[email protected]2e531f72014-06-20 23:23:39585 void OnAddStyleSheetByURL(const std::string& url);
[email protected]9e6bea412014-08-08 06:35:25586 void OnSetupTransitionView(const std::string& markup);
zhenwe8f14fc2014-11-25 01:00:54587 void OnBeginExitTransition(const std::string& css_selector,
588 bool exit_to_native_app);
zhenw5a707892014-12-10 02:31:03589 void OnRevertExitTransition();
zhenwabf9b9d2014-11-15 04:04:18590 void OnHideTransitionElements(const std::string& css_selector);
591 void OnShowTransitionElements(const std::string& css_selector);
[email protected]95640212014-07-26 18:14:30592 void OnSetAccessibilityMode(AccessibilityMode new_mode);
creisbbbeb062014-08-25 18:20:31593 void OnDisownOpener();
avi485e5fd62014-08-25 23:26:14594#if defined(OS_ANDROID)
595 void OnSelectPopupMenuItems(bool canceled,
596 const std::vector<int>& selected_indices);
597#elif defined(OS_MACOSX)
598 void OnSelectPopupMenuItem(int selected_index);
[email protected]4ee64622014-03-21 22:34:15599 void OnCopyToFindPboard();
600#endif
[email protected]9c9343b2014-03-08 02:56:07601
clamy9bfeef42014-09-30 20:50:42602 // PlzNavigate
clamy79b3da62014-10-14 08:50:37603 void OnRequestNavigation(const CommonNavigationParams& common_params,
604 const RequestNavigationParams& request_params);
davidbena5496d62014-10-07 18:52:04605 void OnCommitNavigation(const ResourceResponseHead& response,
606 const GURL& stream_url,
clamy9bfeef42014-09-30 20:50:42607 const CommonNavigationParams& common_params,
608 const CommitNavigationParams& commit_params);
609
[email protected]65920f332014-03-04 21:14:18610 // Virtual since overridden by WebTestProxy for layout tests.
611 virtual blink::WebNavigationPolicy DecidePolicyForNavigation(
612 RenderFrame* render_frame,
[email protected]0c3c54f2014-07-31 01:29:00613 const NavigationPolicyInfo& info);
[email protected]65920f332014-03-04 21:14:18614 void OpenURL(blink::WebFrame* frame,
615 const GURL& url,
616 const Referrer& referrer,
617 blink::WebNavigationPolicy policy);
[email protected]a09d53ce2014-01-31 00:46:42618
[email protected]ef3adfc2014-05-11 00:04:54619 // Update current main frame's encoding and send it to browser window.
620 // Since we want to let users see the right encoding info from menu
621 // before finishing loading, we call the UpdateEncoding in
622 // a) function:DidCommitLoadForFrame. When this function is called,
623 // that means we have got first data. In here we try to get encoding
624 // of page if it has been specified in http header.
625 // b) function:DidReceiveTitle. When this function is called,
626 // that means we have got specified title. Because in most of webpages,
627 // title tags will follow meta tags. In here we try to get encoding of
628 // page if it has been specified in meta tag.
629 // c) function:DidFinishDocumentLoadForFrame. When this function is
630 // called, that means we have got whole html page. In here we should
631 // finally get right encoding of page.
632 void UpdateEncoding(blink::WebFrame* frame,
633 const std::string& encoding_name);
634
[email protected]4ee64622014-03-21 22:34:15635 // Dispatches the current state of selection on the webpage to the browser if
636 // it has changed.
637 // TODO(varunjain): delete this method once we figure out how to keep
638 // selection handles in sync with the webpage.
639 void SyncSelectionIfRequired();
640
[email protected]87de04b02014-04-08 22:14:49641 bool RunJavaScriptMessage(JavaScriptMessageType type,
642 const base::string16& message,
643 const base::string16& default_value,
644 const GURL& frame_url,
645 base::string16* result);
646
[email protected]457736d2014-04-30 15:54:27647 // Loads the appropriate error page for the specified failure into the frame.
648 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request,
649 const blink::WebURLError& error,
650 bool replace);
651
zeeshanq3454e9c2014-09-04 21:30:28652 void HandleJavascriptExecutionResult(const base::string16& javascript,
653 int id,
654 bool notify_result,
655 v8::Handle<v8::Value> result);
656
[email protected]977db4a42014-07-17 08:04:32657 // Initializes |web_user_media_client_|. If this fails, because it wasn't
658 // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then
659 // |web_user_media_client_| will remain NULL.
660 void InitializeUserMediaClient();
[email protected]96307312014-05-04 01:00:19661
662 blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream(
663 const blink::WebURL& url,
664 blink::WebMediaPlayerClient* client);
665
[email protected]ae2477e2014-05-27 23:47:08666 // Creates a factory object used for creating audio and video renderers.
667 // The method is virtual so that layouttests can override it.
668 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory();
669
clamyda97e8322014-10-07 21:57:25670 // Checks that the RenderView is ready to display the navigation to |url|. If
sungmann.cho12349f0e2014-12-05 23:42:19671 // the return value is false, the navigation should be abandoned.
clamyda97e8322014-10-07 21:57:25672 bool PrepareRenderViewForNavigation(
673 const GURL& url,
674 FrameMsg_Navigate_Type::Value navigate_type,
675 const PageState& state,
avi2b177592014-12-10 02:08:02676 bool check_for_stale_navigation,
677 bool is_history_navigation,
678 int current_history_list_offset,
clamyda97e8322014-10-07 21:57:25679 int32 page_id,
680 bool* is_reload,
681 blink::WebURLRequest::CachePolicy* cache_policy);
682
clamyece38882014-11-19 15:00:20683 // PlzNavigate
684 // Sends a FrameHostMsg_BeginNavigation to the browser based on the contents
685 // of the WebURLRequest.
686 void BeginNavigation(blink::WebURLRequest* request);
687
[email protected]f3a95312014-06-12 16:46:58688 // Returns the URL being loaded by the |frame_|'s request.
689 GURL GetLoadingUrl() const;
690
[email protected]96307312014-05-04 01:00:19691#if defined(OS_ANDROID)
[email protected]65f3d1aa2014-05-29 01:57:00692 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer(
[email protected]96307312014-05-04 01:00:19693 const blink::WebURL& url,
jrummell65b7d272014-09-24 20:49:27694 blink::WebMediaPlayerClient* client,
695 blink::WebContentDecryptionModule* initial_cdm);
[email protected]a017938b2014-05-27 21:17:17696
[email protected]65f3d1aa2014-05-29 01:57:00697 RendererMediaPlayerManager* GetMediaPlayerManager();
[email protected]4b556cf2014-06-10 23:21:53698#endif
699
700#if defined(ENABLE_BROWSER_CDMS)
[email protected]65f3d1aa2014-05-29 01:57:00701 RendererCdmManager* GetCdmManager();
[email protected]96307312014-05-04 01:00:19702#endif
703
[email protected]35b2a972014-04-04 15:50:22704 // Stores the WebLocalFrame we are associated with.
705 blink::WebLocalFrame* frame_;
[email protected]b70da4c2014-01-06 19:57:09706
[email protected]abc501e2014-01-27 19:27:26707 base::WeakPtr<RenderViewImpl> render_view_;
[email protected]227692c52013-05-31 22:43:04708 int routing_id_;
[email protected]1c2052f2013-08-28 08:24:34709 bool is_swapped_out_;
[email protected]5a7100d2014-05-19 01:29:04710 // RenderFrameProxy exists only when is_swapped_out_ is true.
711 // TODO(nasko): This can be removed once we don't have a swapped out state on
712 // RenderFrame. See https://crbug.com/357747.
713 RenderFrameProxy* render_frame_proxy_;
[email protected]1c2052f2013-08-28 08:24:34714 bool is_detaching_;
[email protected]227692c52013-05-31 22:43:04715
japhete6adf142014-10-31 00:01:49716 // If this frame was created to replace a proxy, this will store the routing
717 // id of the proxy to replace at commit-time, at which time it will be
718 // cleared.
719 // TODO(creis): Remove this after switching to PlzNavigate.
720 int proxy_routing_id_;
721
[email protected]7a4e2532013-12-02 21:30:02722#if defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02723 // Current text input composition text. Empty if no composition is in
724 // progress.
[email protected]fcf75d42013-12-03 20:11:26725 base::string16 pepper_composition_text_;
tommyclieb25b2a2014-11-03 19:45:09726
tommycli59bd86c2014-12-10 02:09:38727 PluginPowerSaverHelper* plugin_power_saver_helper_;
[email protected]7a4e2532013-12-02 21:30:02728#endif
729
[email protected]f3add922013-12-20 23:17:16730 RendererWebCookieJarImpl cookie_jar_;
731
[email protected]2e2d9632013-12-03 00:55:26732 // All the registered observers.
733 ObserverList<RenderFrameObserver> observers_;
734
[email protected]bffc8302014-01-23 20:52:16735 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
736
[email protected]4ecee352014-03-11 21:12:19737 // The node that the context menu was pressed over.
738 blink::WebNode context_menu_node_;
739
[email protected]a09d53ce2014-01-31 00:46:42740 // External context menu requests we're waiting for. "Internal"
741 // (WebKit-originated) context menu events will have an ID of 0 and will not
742 // be in this map.
743 //
744 // We don't want to add internal ones since some of the "special" page
745 // handlers in the browser process just ignore the context menu requests so
746 // avoid showing context menus, and so this will cause right clicks to leak
747 // entries in this map. Most users of the custom context menu (e.g. Pepper
748 // plugins) are normally only on "regular" pages and the regular pages will
749 // always respond properly to the request, so we don't have to worry so
750 // much about leaks.
751 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_;
752
[email protected]4ee64622014-03-21 22:34:15753 // The text selection the last time DidChangeSelection got called. May contain
754 // additional characters before and after the selected text, for IMEs. The
755 // portion of this string that is the actual selected text starts at index
756 // |selection_range_.GetMin() - selection_text_offset_| and has length
757 // |selection_range_.length()|.
758 base::string16 selection_text_;
759 // The offset corresponding to the start of |selection_text_| in the document.
760 size_t selection_text_offset_;
761 // Range over the document corresponding to the actual selected text (which
762 // could correspond to a substring of |selection_text_|; see above).
763 gfx::Range selection_range_;
764 // Used to inform didChangeSelection() when it is called in the context
765 // of handling a InputMsg_SelectRange IPC.
766 bool handling_select_range_;
767
[email protected]2626d142014-04-22 17:24:02768 // The next group of objects all implement RenderFrameObserver, so are deleted
769 // along with the RenderFrame automatically. This is why we just store weak
770 // references.
771
[email protected]4459599e2014-07-29 22:40:09772 // Dispatches permission requests for Web Notifications.
773 NotificationPermissionDispatcher* notification_permission_dispatcher_;
774
[email protected]977db4a42014-07-17 08:04:32775 // Destroyed via the RenderFrameObserver::OnDestruct() mechanism.
perkj1a2d0432014-09-03 13:52:33776 UserMediaClientImpl* web_user_media_client_;
[email protected]96307312014-05-04 01:00:19777
[email protected]52d3e172014-06-16 16:57:02778 // MidiClient attached to this frame; lazily initialized.
779 MidiDispatcher* midi_dispatcher_;
780
[email protected]a017938b2014-05-27 21:17:17781#if defined(OS_ANDROID)
[email protected]4b556cf2014-06-10 23:21:53782 // Manages all media players in this render frame for communicating with the
783 // real media player in the browser process. It's okay to use a raw pointer
784 // since it's a RenderFrameObserver.
[email protected]a017938b2014-05-27 21:17:17785 RendererMediaPlayerManager* media_player_manager_;
[email protected]4b556cf2014-06-10 23:21:53786#endif
787
788#if defined(ENABLE_BROWSER_CDMS)
789 // Manage all CDMs in this render frame for communicating with the real CDM in
790 // the browser process. It's okay to use a raw pointer since it's a
791 // RenderFrameObserver.
[email protected]65f3d1aa2014-05-29 01:57:00792 RendererCdmManager* cdm_manager_;
[email protected]a017938b2014-05-27 21:17:17793#endif
794
[email protected]a6e21c372014-07-12 02:27:21795#if defined(VIDEO_HOLE)
796 // Whether or not this RenderFrameImpl contains a media player. Used to
797 // register as an observer for video-hole-specific events.
798 bool contains_media_player_;
799#endif
800
[email protected]45920862014-07-02 12:53:02801 // The geolocation dispatcher attached to this frame, lazily initialized.
[email protected]8eae0802014-06-02 21:35:55802 GeolocationDispatcher* geolocation_dispatcher_;
803
[email protected]45920862014-07-02 12:53:02804 // The push messaging dispatcher attached to this frame, lazily initialized.
805 PushMessagingDispatcher* push_messaging_dispatcher_;
806
[email protected]c52a1412014-06-25 06:09:25807 ServiceRegistryImpl service_registry_;
808
[email protected]45920862014-07-02 12:53:02809 // The screen orientation dispatcher attached to the frame, lazily
810 // initialized.
[email protected]cf78eda2014-06-13 16:57:41811 ScreenOrientationDispatcher* screen_orientation_dispatcher_;
812
mlamouriefdca9d2014-09-16 16:55:40813 // The Manifest Manager handles the manifest requests from the browser
814 // process.
815 ManifestManager* manifest_manager_;
816
[email protected]95640212014-07-26 18:14:30817 // The current accessibility mode.
818 AccessibilityMode accessibility_mode_;
819
820 // Only valid if |accessibility_mode_| is anything other than
821 // AccessibilityModeOff.
822 RendererAccessibility* renderer_accessibility_;
823
avi485e5fd62014-08-25 23:26:14824#if defined(OS_MACOSX) || defined(OS_ANDROID)
825 // The external popup for the currently showing select popup.
826 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
827#endif
828
[email protected]96307312014-05-04 01:00:19829 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
830
[email protected]227692c52013-05-31 22:43:04831 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
832};
833
834} // namespace content
835
[email protected]85d85fd2013-06-19 00:57:41836#endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_