blob: 86fc61b18980659e5e20e8041118150798cb666c [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
avi1023d012015-12-25 02:39:148#include <stddef.h>
9#include <stdint.h>
10
guidou3906a722015-11-12 22:14:4211#include <string>
[email protected]7a4e2532013-12-02 21:30:0212#include <vector>
13
[email protected]7a4e2532013-12-02 21:30:0214#include "base/files/file_path.h"
[email protected]a09d53ce2014-01-31 00:46:4215#include "base/gtest_prod_util.h"
16#include "base/id_map.h"
avi1023d012015-12-25 02:39:1417#include "base/macros.h"
hubbe5f0ad43b2015-12-14 20:57:2618#include "base/memory/linked_ptr.h"
xhwang430baee2015-01-22 05:46:2019#include "base/memory/scoped_ptr.h"
[email protected]abc501e2014-01-27 19:27:2620#include "base/memory/weak_ptr.h"
[email protected]2e2d9632013-12-03 00:55:2621#include "base/observer_list.h"
[email protected]7a4e2532013-12-02 21:30:0222#include "base/process/process_handle.h"
avi1023d012015-12-25 02:39:1423#include "build/build_config.h"
[email protected]95640212014-07-26 18:14:3024#include "content/common/accessibility_mode_enums.h"
clamyda97e8322014-10-07 21:57:2525#include "content/common/frame_message_enums.h"
rockotf8fdd9b2015-12-16 22:22:3526#include "content/common/mojo/service_registry_impl.h"
peter4eb242002015-06-02 12:45:1327#include "content/public/common/console_message_level.h"
[email protected]87de04b02014-04-08 22:14:4928#include "content/public/common/javascript_message_type.h"
[email protected]65920f332014-03-04 21:14:1829#include "content/public/common/referrer.h"
paulmeyer5d0a5f02016-01-21 20:15:5230#include "content/public/common/stop_find_action.h"
[email protected]227692c52013-05-31 22:43:0431#include "content/public/renderer/render_frame.h"
[email protected]5a7100d2014-05-19 01:29:0432#include "content/renderer/render_frame_proxy.h"
[email protected]f3add922013-12-20 23:17:1633#include "content/renderer/renderer_webcookiejar_impl.h"
[email protected]227692c52013-05-31 22:43:0434#include "ipc/ipc_message.h"
lukasza70b79c82015-12-14 20:24:1335#include "ipc/ipc_platform_file.h"
acolwell9e0840d2014-09-06 19:01:3236#include "media/blink/webmediaplayer_delegate.h"
dalecurtis49f363882015-08-25 21:05:3837#include "media/blink/webmediaplayer_params.h"
ben95787952016-02-10 07:46:2038#include "mojo/shell/public/interfaces/interface_provider.mojom.h"
ben273c1e32016-01-12 02:44:0839#include "mojo/shell/public/interfaces/shell.mojom.h"
alexmos401f0aba2015-12-06 10:07:3940#include "third_party/WebKit/public/platform/WebFocusType.h"
sandersdf92f4e5c2016-01-22 20:57:2241#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
benwells04ab5b962015-05-06 08:29:4042#include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClient.h"
[email protected]95640212014-07-26 18:14:3043#include "third_party/WebKit/public/web/WebAXObject.h"
[email protected]85d85fd2013-06-19 00:57:4144#include "third_party/WebKit/public/web/WebDataSource.h"
45#include "third_party/WebKit/public/web/WebFrameClient.h"
boliu15890e42015-11-24 23:08:0546#include "third_party/WebKit/public/web/WebFrameLoadType.h"
lazyboy70605c32015-11-03 01:27:3147#include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
lukasza902fcc52015-12-31 04:45:2948#include "third_party/WebKit/public/web/WebFrameSerializerClient.h"
[email protected]680575542014-04-03 17:12:5249#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
skyostilc3ed5652015-10-19 16:28:4650#include "third_party/WebKit/public/web/WebMeaningfulLayout.h"
twellington376424ad2015-05-04 18:57:2551#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
[email protected]4ee64622014-03-21 22:34:1552#include "ui/gfx/range/range.h"
lukaszaede9cc02015-12-30 23:48:3253#include "url/gurl.h"
[email protected]227692c52013-05-31 22:43:0454
tommyclid481c482014-12-03 01:50:4155#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:3856#include "content/renderer/pepper/plugin_power_saver_helper.h"
tommyclid481c482014-12-03 01:50:4157#endif
58
[email protected]a017938b2014-05-27 21:17:1759#if defined(OS_ANDROID)
60#include "content/renderer/media/android/renderer_media_player_manager.h"
61#endif
62
xhwangc0299ae32015-07-21 23:39:5063#if defined(ENABLE_MOJO_MEDIA)
jbromanb73f2582016-01-11 16:35:0564#include "media/mojo/interfaces/service_factory.mojom.h" // nogncheck
xhwangc0299ae32015-07-21 23:39:5065#endif
66
[email protected]7a4e2532013-12-02 21:30:0267class TransportDIB;
kenrba7199832015-01-22 23:44:5968struct FrameMsg_NewFrame_WidgetParams;
alexmose7da5a12015-04-09 02:22:1669struct FrameMsg_PostMessage_Params;
lukaszaede9cc02015-12-30 23:48:3270struct FrameMsg_SerializeAsMHTML_Params;
dspelle736c9db2015-04-03 04:53:1671struct FrameMsg_TextTrackSettings_Params;
[email protected]7a4e2532013-12-02 21:30:0272
73namespace blink {
[email protected]5ee7f182014-04-25 19:45:2674class WebGeolocationClient;
[email protected]7a4e2532013-12-02 21:30:0275class WebMouseEvent;
[email protected]82ce5b92014-03-22 05:15:2676class WebContentDecryptionModule;
avayvodbca35fad2015-01-29 20:20:5777class WebPresentationClient;
[email protected]45920862014-07-02 12:53:0278class WebPushClient;
[email protected]82ce5b92014-03-22 05:15:2679class WebSecurityOrigin;
alogvinovf50445a2015-10-30 13:00:1280class WebWakeLockClient;
[email protected]7a4e2532013-12-02 21:30:0281struct WebCompositionUnderline;
[email protected]a09d53ce2014-01-31 00:46:4282struct WebContextMenuData;
[email protected]7a4e2532013-12-02 21:30:0283struct WebCursorInfo;
paulmeyer5d0a5f02016-01-21 20:15:5284struct WebFindOptions;
dcheng3ce04b62015-10-26 23:30:5585struct WebScreenInfo;
[email protected]7a4e2532013-12-02 21:30:0286}
87
88namespace gfx {
[email protected]a09d53ce2014-01-31 00:46:4289class Point;
[email protected]7a4e2532013-12-02 21:30:0290class Range;
91class Rect;
92}
93
jrummell109c3a602014-12-18 01:08:5094namespace media {
xhwangd7180832015-04-03 05:38:1595class CdmFactory;
xhwang60b430a2015-02-01 05:20:4696class MediaPermission;
hubbe5f0ad43b2015-12-14 20:57:2697class MediaServiceProvider;
dalecurtisa12e6062015-11-10 23:13:1498class RendererWebMediaPlayerDelegate;
hubbe5f0ad43b2015-12-14 20:57:2699class UrlIndex;
jrummell109c3a602014-12-18 01:08:50100class WebEncryptedMediaClientImpl;
101}
102
xhwang33f939e2015-06-23 04:33:42103namespace mojo {
104class ServiceProvider;
105}
106
tommycli58e3172c2015-09-15 18:18:26107namespace url {
108class Origin;
109}
110
[email protected]227692c52013-05-31 22:43:04111namespace content {
112
[email protected]bffc8302014-01-23 20:52:16113class ChildFrameCompositingHelper;
kenrba7199832015-01-22 23:44:59114class CompositorDependencies;
dgozman358ba322015-03-26 15:05:30115class DevToolsAgent;
avi0392dbf52015-03-25 16:55:45116class DocumentState;
avi485e5fd62014-08-25 23:26:14117class ExternalPopupMenu;
[email protected]8eae0802014-06-02 21:35:55118class GeolocationDispatcher;
mlamouriefdca9d2014-09-16 16:55:40119class ManifestManager;
[email protected]977db4a42014-07-17 08:04:32120class MediaStreamDispatcher;
[email protected]ae2477e2014-05-27 23:47:08121class MediaStreamRendererFactory;
xhwang5206d4e62016-02-05 02:09:55122class MediaPermissionDispatcher;
[email protected]52d3e172014-06-16 16:57:02123class MidiDispatcher;
avi0392dbf52015-03-25 16:55:45124class NavigationState;
[email protected]4459599e2014-07-29 22:40:09125class NotificationPermissionDispatcher;
clamyda97e8322014-10-07 21:57:25126class PageState;
[email protected]7a4e2532013-12-02 21:30:02127class PepperPluginInstanceImpl;
mlamouric6d31db2015-03-28 17:48:14128class PermissionDispatcher;
avayvodbca35fad2015-01-29 20:20:57129class PresentationDispatcher;
[email protected]45920862014-07-02 12:53:02130class PushMessagingDispatcher;
[email protected]95640212014-07-26 18:14:30131class RendererAccessibility;
[email protected]4b556cf2014-06-10 23:21:53132class RendererCdmManager;
133class RendererMediaPlayerManager;
davve859f4f92015-11-27 10:16:19134class RendererMediaSessionManager;
[email protected]7a4e2532013-12-02 21:30:02135class RendererPpapiHost;
[email protected]2e2d9632013-12-03 00:55:26136class RenderFrameObserver;
[email protected]227692c52013-05-31 22:43:04137class RenderViewImpl;
[email protected]7a4e2532013-12-02 21:30:02138class RenderWidget;
139class RenderWidgetFullscreenPepper;
[email protected]cf78eda2014-06-13 16:57:41140class ScreenOrientationDispatcher;
perkj1a2d0432014-09-03 13:52:33141class UserMediaClientImpl;
alogvinovf50445a2015-10-30 13:00:12142class WakeLockDispatcher;
clamy9bfeef42014-09-30 20:50:42143struct CommonNavigationParams;
[email protected]a09d53ce2014-01-31 00:46:42144struct CustomContextMenuContext;
alexmosbc7eafa2014-12-06 01:38:09145struct FrameReplicationState;
avi0392dbf52015-03-25 16:55:45146struct NavigationParams;
clamy79b3da62014-10-14 08:50:37147struct RequestNavigationParams;
davidbena5496d62014-10-07 18:52:04148struct ResourceResponseHead;
clamy34e12782015-03-12 11:26:13149struct StartNavigationParams;
clamyd6983032015-04-29 14:48:12150struct StreamOverrideParameters;
bajones02443532015-06-22 21:17:40151class VRDispatcher;
[email protected]227692c52013-05-31 22:43:04152
[email protected]85d85fd2013-06-19 00:57:41153class CONTENT_EXPORT RenderFrameImpl
154 : public RenderFrame,
[email protected]96307312014-05-04 01:00:19155 NON_EXPORTED_BASE(public blink::WebFrameClient),
lukasza902fcc52015-12-31 04:45:29156 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) {
[email protected]227692c52013-05-31 22:43:04157 public:
dchengc5ef1a52015-08-26 20:58:30158 // Creates a new RenderFrame as the main frame of |render_view|.
dcheng3ce04b62015-10-26 23:30:55159 static RenderFrameImpl* CreateMainFrame(
160 RenderViewImpl* render_view,
161 int32_t routing_id,
162 int32_t widget_routing_id,
163 bool hidden,
164 const blink::WebScreenInfo& screen_info,
165 CompositorDependencies* compositor_deps);
[email protected]2f61bdd2013-07-02 18:38:47166
alexmosa181efc2015-09-03 00:39:04167 // Creates a new RenderFrame with |routing_id|. If |proxy_routing_id| is
168 // MSG_ROUTING_NONE, it creates the Blink WebLocalFrame and inserts it into
169 // the frame tree after the frame identified by
170 // |previous_sibling_routing_id|, or as the first child if
alexmos9f8705a2015-05-06 19:58:59171 // |previous_sibling_routing_id| is MSG_ROUTING_NONE. Otherwise, the frame is
172 // semi-orphaned until it commits, at which point it replaces the proxy
alexmosa181efc2015-09-03 00:39:04173 // identified by |proxy_routing_id|. The frame's opener is set to the frame
174 // identified by |opener_routing_id|. The frame is created as a child of the
175 // RenderFrame identified by |parent_routing_id| or as the top-level frame if
176 // the latter is MSG_ROUTING_NONE. Note: This is called only when
alexmos9f8705a2015-05-06 19:58:59177 // RenderFrame is being created in response to IPC message from the browser
178 // process. All other frame creation is driven through Blink and Create.
lazyboy70605c32015-11-03 01:27:31179 static void CreateFrame(
180 int routing_id,
181 int proxy_routing_id,
182 int opener_routing_id,
183 int parent_routing_id,
184 int previous_sibling_routing_id,
185 const FrameReplicationState& replicated_state,
186 CompositorDependencies* compositor_deps,
187 const FrameMsg_NewFrame_WidgetParams& params,
188 const blink::WebFrameOwnerProperties& frameOwner_properties);
[email protected]82307f6b2014-08-07 03:30:12189
[email protected]5a7100d2014-05-19 01:29:04190 // Returns the RenderFrameImpl for the given routing ID.
191 static RenderFrameImpl* FromRoutingID(int routing_id);
192
[email protected]a5ac6dc2014-01-15 07:02:14193 // Just like RenderFrame::FromWebFrame but returns the implementation.
194 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:09195
[email protected]2f61bdd2013-07-02 18:38:47196 // Used by content_layouttest_support to hook into the creation of
197 // RenderFrameImpls.
jochen664198b2015-06-25 14:13:00198 struct CreateParams {
avi1023d012015-12-25 02:39:14199 CreateParams(RenderViewImpl* render_view, int32_t routing_id)
jochen664198b2015-06-25 14:13:00200 : render_view(render_view), routing_id(routing_id) {}
201 ~CreateParams() {}
202
203 RenderViewImpl* render_view;
avi1023d012015-12-25 02:39:14204 int32_t routing_id;
jochen664198b2015-06-25 14:13:00205 };
206
207 using CreateRenderFrameImplFunction =
208 RenderFrameImpl* (*)(const CreateParams&);
[email protected]2f61bdd2013-07-02 18:38:47209 static void InstallCreateHook(
dongseong.hwangb721ddf2014-12-10 21:22:50210 CreateRenderFrameImplFunction create_render_frame_impl);
[email protected]2f61bdd2013-07-02 18:38:47211
alexmos95733002015-08-24 16:38:09212 // Looks up and returns the WebFrame corresponding to a given opener frame
213 // routing ID. Also stores the opener's RenderView routing ID into
214 // |opener_view_routing_id|.
215 //
216 // TODO(alexmos): remove RenderViewImpl's dependency on
217 // opener_view_routing_id.
218 static blink::WebFrame* ResolveOpener(int opener_frame_routing_id,
219 int* opener_view_routing_id);
220
avi5c77d212015-09-25 20:08:25221 ~RenderFrameImpl() override;
[email protected]227692c52013-05-31 22:43:04222
[email protected]b70da4c2014-01-06 19:57:09223 bool is_swapped_out() const {
224 return is_swapped_out_;
225 }
226
[email protected]5a7100d2014-05-19 01:29:04227 // TODO(nasko): This can be removed once we don't have a swapped out state on
228 // RenderFrames. See https://crbug.com/357747.
229 void set_render_frame_proxy(RenderFrameProxy* proxy) {
230 render_frame_proxy_ = proxy;
231 }
232
dglazkovf0e1d6d2015-10-10 02:13:48233 // Called by RenderWidget when meaningful layout has happened.
234 // See RenderFrameObserver::DidMeaningfulLayout declaration for details.
235 void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type);
236
[email protected]bffc8302014-01-23 20:52:16237 // Out-of-process child frames receive a signal from RenderWidgetCompositor
238 // when a compositor frame has committed.
239 void DidCommitCompositorFrame();
240
[email protected]7a4e2532013-12-02 21:30:02241 // TODO(jam): this is a temporary getter until all the code is transitioned
242 // to using RenderFrame instead of RenderView.
[email protected]abc501e2014-01-27 19:27:26243 RenderViewImpl* render_view() { return render_view_.get(); }
[email protected]7a4e2532013-12-02 21:30:02244
[email protected]f3add922013-12-20 23:17:16245 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; }
246
[email protected]7a4e2532013-12-02 21:30:02247 // Returns the RenderWidget associated with this frame.
248 RenderWidget* GetRenderWidget();
249
dgozmancf9039cd2015-04-06 12:01:31250 DevToolsAgent* devtools_agent() { return devtools_agent_; }
251
[email protected]0287e762014-04-11 13:07:58252 // This method must be called after the frame has been added to the frame
253 // tree. It creates all objects that depend on the frame being at its proper
254 // spot.
255 void Initialize();
256
[email protected]de3c5d82014-05-28 22:12:59257 // Notifications from RenderWidget.
258 void WasHidden();
259 void WasShown();
dgozmancf9039cd2015-04-06 12:01:31260 void WidgetWillClose();
[email protected]de3c5d82014-05-28 22:12:59261
[email protected]723971b2014-02-12 11:08:25262 // Start/Stop loading notifications.
263 // TODO(nasko): Those are page-level methods at this time and come from
264 // WebViewClient. We should move them to be WebFrameClient calls and put
265 // logic in the browser side to balance starts/stops.
[email protected]e3b10d12014-03-28 16:06:09266 // |to_different_document| will be true unless the load is a fragment
267 // navigation, or triggered by history.pushState/replaceState.
avi5c77d212015-09-25 20:08:25268 void didStartLoading(bool to_different_document) override;
269 void didStopLoading() override;
270 void didChangeLoadProgress(double load_progress) override;
[email protected]723971b2014-02-12 11:08:25271
[email protected]95640212014-07-26 18:14:30272 AccessibilityMode accessibility_mode() {
273 return accessibility_mode_;
274 }
275
276 RendererAccessibility* renderer_accessibility() {
277 return renderer_accessibility_;
278 }
279
280 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj,
281 blink::WebAXEvent event);
282
estade31c54342015-01-23 03:34:36283 // The focused node changed to |node|. If focus was lost from this frame,
284 // |node| will be null.
[email protected]95640212014-07-26 18:14:30285 void FocusedNodeChanged(const blink::WebNode& node);
286
estade31c54342015-01-23 03:34:36287 // TODO(dmazzoni): the only reason this is here is to plumb it through to
288 // RendererAccessibility. It should use the RenderFrameObserver method, once
289 // blink has a separate accessibility tree per frame.
290 void FocusedNodeChangedForAccessibility(const blink::WebNode& node);
291
[email protected]7a4e2532013-12-02 21:30:02292#if defined(ENABLE_PLUGINS)
paulmeyer5d0a5f02016-01-21 20:15:52293 // Get/set the plugin which will be used to handle document find requests.
294 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) {
295 plugin_find_handler_ = plugin;
296 }
297 PepperPluginInstanceImpl* plugin_find_handler() {
298 return plugin_find_handler_;
299 }
300
[email protected]271ff5792013-12-04 22:29:31301 // Notification that a PPAPI plugin has been created.
302 void PepperPluginCreated(RendererPpapiHost* host);
303
[email protected]7a4e2532013-12-02 21:30:02304 // Notifies that |instance| has changed the cursor.
305 // This will update the cursor appearance if it is currently over the plugin
306 // instance.
307 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance,
308 const blink::WebCursorInfo& cursor);
309
310 // Notifies that |instance| has received a mouse event.
311 void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance);
312
[email protected]7a4e2532013-12-02 21:30:02313 // Informs the render view that a PPAPI plugin has changed text input status.
314 void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance);
315 void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance);
316
317 // Cancels current composition.
318 void PepperCancelComposition(PepperPluginInstanceImpl* instance);
319
320 // Informs the render view that a PPAPI plugin has changed selection.
321 void PepperSelectionChanged(PepperPluginInstanceImpl* instance);
322
323 // Creates a fullscreen container for a pepper plugin instance.
324 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
325 PepperPluginInstanceImpl* plugin);
326
[email protected]7a4e2532013-12-02 21:30:02327 bool IsPepperAcceptingCompositionEvents() const;
328
329 // Notification that the given plugin has crashed.
330 void PluginCrashed(const base::FilePath& plugin_path,
331 base::ProcessId plugin_pid);
332
[email protected]7a4e2532013-12-02 21:30:02333 // Simulates IME events for testing purpose.
334 void SimulateImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26335 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02336 const std::vector<blink::WebCompositionUnderline>& underlines,
337 int selection_start,
338 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26339 void SimulateImeConfirmComposition(const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02340 const gfx::Range& replacement_range);
341
342 // TODO(jam): remove these once the IPC handler moves from RenderView to
343 // RenderFrame.
344 void OnImeSetComposition(
tommyclie6633ca72014-10-31 00:40:42345 const base::string16& text,
346 const std::vector<blink::WebCompositionUnderline>& underlines,
347 int selection_start,
348 int selection_end);
349 void OnImeConfirmComposition(const base::string16& text,
350 const gfx::Range& replacement_range,
351 bool keep_selection);
352#endif // defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02353
[email protected]977db4a42014-07-17 08:04:32354 // May return NULL in some cases, especially if userMediaClient() returns
355 // NULL.
356 MediaStreamDispatcher* GetMediaStreamDispatcher();
357
avi485e5fd62014-08-25 23:26:14358#if defined(OS_MACOSX) || defined(OS_ANDROID)
359 void DidHideExternalPopupMenu();
360#endif
361
[email protected]227692c52013-05-31 22:43:04362 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52363 bool Send(IPC::Message* msg) override;
[email protected]227692c52013-05-31 22:43:04364
365 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52366 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]227692c52013-05-31 22:43:04367
[email protected]271ff5792013-12-04 22:29:31368 // RenderFrame implementation:
dcheng6d18e402014-10-21 12:32:52369 RenderView* GetRenderView() override;
370 int GetRoutingID() override;
371 blink::WebLocalFrame* GetWebFrame() override;
estade78d655f82015-01-30 01:55:08372 blink::WebElement GetFocusedElement() const override;
dcheng6d18e402014-10-21 12:32:52373 WebPreferences& GetWebkitPreferences() override;
374 int ShowContextMenu(ContextMenuClient* client,
375 const ContextMenuParams& params) override;
376 void CancelContextMenu(int request_id) override;
377 blink::WebNode GetContextMenuNode() const override;
tommycli59bd86c2014-12-10 02:09:38378 blink::WebPlugin* CreatePlugin(
379 blink::WebFrame* frame,
380 const WebPluginInfo& info,
381 const blink::WebPluginParams& params,
tommyclie8722702015-01-16 11:40:41382 scoped_ptr<PluginInstanceThrottler> throttler) override;
japhetb0bae9d82015-10-19 20:43:40383 void LoadURLExternally(const blink::WebURLRequest& request,
dcheng6d18e402014-10-21 12:32:52384 blink::WebNavigationPolicy policy) override;
385 void ExecuteJavaScript(const base::string16& javascript) override;
dglazkov2e140f52015-09-28 16:10:07386 bool IsMainFrame() override;
dcheng6d18e402014-10-21 12:32:52387 bool IsHidden() override;
388 ServiceRegistry* GetServiceRegistry() override;
tommyclid481c482014-12-03 01:50:41389#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:38390 void RegisterPeripheralPlugin(
tommycli58e3172c2015-09-15 18:18:26391 const url::Origin& content_origin,
tommycli59bd86c2014-12-10 02:09:38392 const base::Closure& unthrottle_callback) override;
tommycli9c7cbd92015-12-18 23:34:34393 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus(
394 const url::Origin& main_frame_origin,
395 const url::Origin& content_origin,
396 const gfx::Size& unobscured_size) const override;
tommyclibae63b92015-10-23 02:56:20397 void WhitelistContentOrigin(const url::Origin& content_origin) override;
tommyclid481c482014-12-03 01:50:41398#endif
dcheng6d18e402014-10-21 12:32:52399 bool IsFTPDirectoryListing() override;
400 void AttachGuest(int element_instance_id) override;
fsamuela95fef42014-12-03 20:16:52401 void DetachGuest(int element_instance_id) override;
dcheng6d18e402014-10-21 12:32:52402 void SetSelectedText(const base::string16& selection_text,
403 size_t offset,
404 const gfx::Range& range) override;
405 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate,
dcarney4410a7c92015-04-20 11:28:19406 v8::Local<v8::Context> context) override;
rdevlin.croninb2cec912015-06-24 20:36:01407 void AddMessageToConsole(ConsoleMessageLevel level,
408 const std::string& message) override;
megjablond5ac7d52015-10-22 23:56:12409 bool IsUsingLoFi() const override;
ellyjonesdb20fae12015-12-04 16:47:55410 bool IsPasting() const override;
[email protected]271ff5792013-12-04 22:29:31411
[email protected]96307312014-05-04 01:00:19412 // blink::WebFrameClient implementation:
avi5c77d212015-09-25 20:08:25413 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame,
414 const blink::WebPluginParams& params) override;
415 blink::WebMediaPlayer* createMediaPlayer(
sandersdf92f4e5c2016-01-22 20:57:22416 blink::WebMediaPlayer::LoadType load_type,
srirama.m26f864d02015-07-14 05:21:46417 const blink::WebURL& url,
418 blink::WebMediaPlayerClient* client,
419 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client,
guidou9c3cc3e2015-10-27 13:38:15420 blink::WebContentDecryptionModule* initial_cdm,
davveadd785e72016-01-26 17:40:36421 const blink::WebString& sink_id,
422 blink::WebMediaSession* media_session) override;
davve50137b62015-10-23 12:15:21423 blink::WebMediaSession* createMediaSession() override;
avi5c77d212015-09-25 20:08:25424 blink::WebApplicationCacheHost* createApplicationCacheHost(
avi5c77d212015-09-25 20:08:25425 blink::WebApplicationCacheHostClient* client) override;
426 blink::WebWorkerContentSettingsClientProxy*
avi01681ef2016-02-16 17:53:57427 createWorkerContentSettingsClientProxy() override;
avi5c77d212015-09-25 20:08:25428 blink::WebExternalPopupMenu* createExternalPopupMenu(
[email protected]b20c3222014-08-22 00:50:22429 const blink::WebPopupMenuInfo& popup_menu_info,
avi5c77d212015-09-25 20:08:25430 blink::WebExternalPopupMenuClient* popup_menu_client) override;
avi5047cd572016-02-16 20:41:12431 blink::WebCookieJar* cookieJar() override;
avi01681ef2016-02-16 17:53:57432 blink::WebServiceWorkerProvider* createServiceWorkerProvider() override;
avi5047cd572016-02-16 20:41:12433 void didAccessInitialDocument() override;
avi5c77d212015-09-25 20:08:25434 blink::WebFrame* createChildFrame(
alexmose48b1df932015-01-16 01:34:17435 blink::WebLocalFrame* parent,
dcheng860817a2015-05-22 03:16:56436 blink::WebTreeScopeType scope,
437 const blink::WebString& name,
lazyboy70605c32015-11-03 01:27:31438 blink::WebSandboxFlags sandboxFlags,
439 const blink::WebFrameOwnerProperties& frameOwnerProperties) override;
avi5c77d212015-09-25 20:08:25440 void didChangeOpener(blink::WebFrame* frame) override;
441 void frameDetached(blink::WebFrame* frame, DetachType type) override;
442 void frameFocused() override;
443 void willClose(blink::WebFrame* frame) override;
avi5047cd572016-02-16 20:41:12444 void didChangeName(const blink::WebString& name) override;
estarka886b8d2015-12-18 21:53:08445 void didEnforceStrictMixedContentChecking() override;
avi5c77d212015-09-25 20:08:25446 void didChangeSandboxFlags(blink::WebFrame* child_frame,
447 blink::WebSandboxFlags flags) override;
Avi Drissman09b359e52015-12-07 20:19:21448 void didChangeFrameOwnerProperties(
lazyboy70605c32015-11-03 01:27:31449 blink::WebFrame* child_frame,
450 const blink::WebFrameOwnerProperties& frame_owner_properties) override;
avi5c77d212015-09-25 20:08:25451 void didMatchCSS(
[email protected]35b2a972014-04-04 15:50:22452 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46453 const blink::WebVector<blink::WebString>& newly_matching_selectors,
avi5c77d212015-09-25 20:08:25454 const blink::WebVector<blink::WebString>& stopped_matching_selectors)
455 override;
456 bool shouldReportDetailedMessageForSource(
457 const blink::WebString& source) override;
458 void didAddMessageToConsole(const blink::WebConsoleMessage& message,
459 const blink::WebString& source_name,
460 unsigned source_line,
461 const blink::WebString& stack_trace) override;
japhetb0bae9d82015-10-19 20:43:40462 void loadURLExternally(const blink::WebURLRequest& request,
avi5c77d212015-09-25 20:08:25463 blink::WebNavigationPolicy policy,
japhetb0bae9d82015-10-19 20:43:40464 const blink::WebString& suggested_name,
465 bool should_replace_current_entry) override;
avi5c77d212015-09-25 20:08:25466 blink::WebNavigationPolicy decidePolicyForNavigation(
467 const NavigationPolicyInfo& info) override;
creise18ce072015-12-02 02:00:02468 blink::WebHistoryItem historyItemForNewChildFrame() override;
avi0fe3a6d2016-02-16 20:57:27469 void willSendSubmitEvent(const blink::WebFormElement& form) override;
470 void willSubmitForm(const blink::WebFormElement& form) override;
avi5c77d212015-09-25 20:08:25471 void didCreateDataSource(blink::WebLocalFrame* frame,
472 blink::WebDataSource* datasource) override;
473 void didStartProvisionalLoad(blink::WebLocalFrame* frame,
474 double triggering_event_time) override;
475 void didReceiveServerRedirectForProvisionalLoad(
476 blink::WebLocalFrame* frame) override;
477 void didFailProvisionalLoad(blink::WebLocalFrame* frame,
478 const blink::WebURLError& error,
479 blink::WebHistoryCommitType commit_type) override;
480 void didCommitProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22481 blink::WebLocalFrame* frame,
[email protected]680575542014-04-03 17:12:52482 const blink::WebHistoryItem& item,
avi5c77d212015-09-25 20:08:25483 blink::WebHistoryCommitType commit_type) override;
484 void didCreateNewDocument(blink::WebLocalFrame* frame) override;
485 void didClearWindowObject(blink::WebLocalFrame* frame) override;
486 void didCreateDocumentElement(blink::WebLocalFrame* frame) override;
487 void didReceiveTitle(blink::WebLocalFrame* frame,
488 const blink::WebString& title,
489 blink::WebTextDirection direction) override;
490 void didChangeIcon(blink::WebLocalFrame* frame,
491 blink::WebIconURL::Type icon_type) override;
492 void didFinishDocumentLoad(blink::WebLocalFrame* frame,
493 bool document_is_empty) override;
494 void didHandleOnloadEvents(blink::WebLocalFrame* frame) override;
495 void didFailLoad(blink::WebLocalFrame* frame,
496 const blink::WebURLError& error,
497 blink::WebHistoryCommitType commit_type) override;
498 void didFinishLoad(blink::WebLocalFrame* frame) override;
499 void didNavigateWithinPage(blink::WebLocalFrame* frame,
500 const blink::WebHistoryItem& item,
501 blink::WebHistoryCommitType commit_type) override;
avi1008732f2016-02-17 17:28:49502 void didUpdateCurrentHistoryItem() override;
avi5c77d212015-09-25 20:08:25503 void didChangeThemeColor() override;
504 void dispatchLoad() override;
505 void requestNotificationPermission(
[email protected]4459599e2014-07-29 22:40:09506 const blink::WebSecurityOrigin& origin,
avi5c77d212015-09-25 20:08:25507 blink::WebNotificationPermissionCallback* callback) override;
508 void didChangeSelection(bool is_empty_selection) override;
509 blink::WebColorChooser* createColorChooser(
[email protected]eb8c216a2014-04-09 19:19:19510 blink::WebColorChooserClient* client,
[email protected]f3c59d62014-04-09 16:33:55511 const blink::WebColor& initial_color,
avi5c77d212015-09-25 20:08:25512 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override;
513 void runModalAlertDialog(const blink::WebString& message) override;
514 bool runModalConfirmDialog(const blink::WebString& message) override;
515 bool runModalPromptDialog(const blink::WebString& message,
516 const blink::WebString& default_value,
517 blink::WebString* actual_value) override;
518 bool runModalBeforeUnloadDialog(bool is_reload,
519 const blink::WebString& message) override;
520 void showContextMenu(const blink::WebContextMenuData& data) override;
521 void clearContextMenu() override;
522 void willSendRequest(blink::WebLocalFrame* frame,
523 unsigned identifier,
524 blink::WebURLRequest& request,
525 const blink::WebURLResponse& redirect_response) override;
avi1008732f2016-02-17 17:28:49526 void didReceiveResponse(unsigned identifier,
avi5c77d212015-09-25 20:08:25527 const blink::WebURLResponse& response) override;
528 void didLoadResourceFromMemoryCache(
[email protected]180ef242013-11-07 06:50:46529 const blink::WebURLRequest& request,
avi5c77d212015-09-25 20:08:25530 const blink::WebURLResponse& response) override;
531 void didDisplayInsecureContent() override;
532 void didRunInsecureContent(const blink::WebSecurityOrigin& origin,
533 const blink::WebURL& target) override;
estark910b4572015-12-09 20:55:41534 void didDisplayContentWithCertificateErrors(
535 const blink::WebURL& url,
536 const blink::WebCString& security_info,
537 const blink::WebURL& main_resource_url,
538 const blink::WebCString& main_resource_security_info) override;
539 void didRunContentWithCertificateErrors(
540 const blink::WebURL& url,
541 const blink::WebCString& security_info,
542 const blink::WebURL& main_resource_url,
543 const blink::WebCString& main_resource_security_info) override;
avi5c77d212015-09-25 20:08:25544 void didChangePerformanceTiming() override;
avi5c77d212015-09-25 20:08:25545 void didCreateScriptContext(blink::WebLocalFrame* frame,
546 v8::Local<v8::Context> context,
547 int extension_group,
548 int world_id) override;
549 void willReleaseScriptContext(blink::WebLocalFrame* frame,
550 v8::Local<v8::Context> context,
551 int world_id) override;
552 void didChangeScrollOffset(blink::WebLocalFrame* frame) override;
553 void willInsertBody(blink::WebLocalFrame* frame) override;
554 void reportFindInPageMatchCount(int request_id,
555 int count,
556 bool final_update) override;
557 void reportFindInPageSelection(int request_id,
558 int active_match_ordinal,
559 const blink::WebRect& sel) override;
560 void requestStorageQuota(blink::WebLocalFrame* frame,
561 blink::WebStorageQuotaType type,
562 unsigned long long requested_size,
563 blink::WebStorageQuotaCallbacks callbacks) override;
564 void willOpenWebSocket(blink::WebSocketHandle* handle) override;
alogvinovf50445a2015-10-30 13:00:12565 blink::WebWakeLockClient* wakeLockClient() override;
avi5c77d212015-09-25 20:08:25566 blink::WebGeolocationClient* geolocationClient() override;
567 blink::WebPushClient* pushClient() override;
568 blink::WebPresentationClient* presentationClient() override;
569 void willStartUsingPeerConnectionHandler(
[email protected]35b2a972014-04-04 15:50:22570 blink::WebLocalFrame* frame,
avi5c77d212015-09-25 20:08:25571 blink::WebRTCPeerConnectionHandler* handler) override;
572 blink::WebUserMediaClient* userMediaClient() override;
573 blink::WebEncryptedMediaClient* encryptedMediaClient() override;
574 blink::WebMIDIClient* webMIDIClient() override;
575 bool willCheckAndDispatchMessageEvent(
[email protected]ce5064f2014-05-07 22:49:20576 blink::WebLocalFrame* source_frame,
577 blink::WebFrame* target_frame,
578 blink::WebSecurityOrigin target_origin,
avi5c77d212015-09-25 20:08:25579 blink::WebDOMMessageEvent event) override;
tzik34958ad62015-10-08 14:07:45580 blink::WebString userAgentOverride(blink::WebLocalFrame* frame) override;
avi5c77d212015-09-25 20:08:25581 blink::WebString doNotTrackValue(blink::WebLocalFrame* frame) override;
582 bool allowWebGL(blink::WebLocalFrame* frame, bool default_value) override;
583 void didLoseWebGLContext(blink::WebLocalFrame* frame,
584 int arb_robustness_status_code) override;
585 blink::WebScreenOrientationClient* webScreenOrientationClient() override;
586 bool isControlledByServiceWorker(blink::WebDataSource& data_source) override;
587 int64_t serviceWorkerID(blink::WebDataSource& data_source) override;
588 void postAccessibilityEvent(const blink::WebAXObject& obj,
589 blink::WebAXEvent event) override;
590 void handleAccessibilityFindInPageResult(
591 int identifier,
592 int match_index,
593 const blink::WebAXObject& start_object,
594 int start_offset,
595 const blink::WebAXObject& end_object,
596 int end_offset) override;
avi1008732f2016-02-17 17:28:49597 void didChangeManifest() override;
avi5c77d212015-09-25 20:08:25598 bool enterFullscreen() override;
599 bool exitFullscreen() override;
600 blink::WebPermissionClient* permissionClient() override;
601 blink::WebAppBannerClient* appBannerClient() override;
602 void registerProtocolHandler(const blink::WebString& scheme,
603 const blink::WebURL& url,
604 const blink::WebString& title) override;
605 void unregisterProtocolHandler(const blink::WebString& scheme,
606 const blink::WebURL& url) override;
607 blink::WebBluetooth* bluetooth() override;
608 blink::WebUSBClient* usbClient() override;
guidou3906a722015-11-12 22:14:42609 void checkIfAudioSinkExistsAndIsAuthorized(
610 const blink::WebString& sink_id,
611 const blink::WebSecurityOrigin& security_origin,
612 blink::WebSetSinkIdCallbacks* web_callbacks) override;
[email protected]85d85fd2013-06-19 00:57:41613
bajones02443532015-06-22 21:17:40614#if defined(ENABLE_WEBVR)
615 blink::WebVRClient* webVRClient() override;
616#endif
617
lukasza902fcc52015-12-31 04:45:29618 // WebFrameSerializerClient implementation:
lukasza2e296c32015-09-28 23:29:48619 void didSerializeDataForFrame(
lukasza2e296c32015-09-28 23:29:48620 const blink::WebCString& data,
lukasza902fcc52015-12-31 04:45:29621 blink::WebFrameSerializerClient::FrameSerializationStatus status)
622 override;
lukasza2e296c32015-09-28 23:29:48623
nasko78f06bc2014-11-18 18:18:57624 // Make this frame show an empty, unscriptable page.
625 // TODO(nasko): Remove this method once swapped out state is no longer used.
626 void NavigateToSwappedOutURL();
627
rockotf8fdd9b2015-12-16 22:22:35628 // Binds this render frame's service registry.
629 void BindServiceRegistry(
ben80ab89052016-02-11 20:19:27630 mojo::shell::mojom::InterfaceProviderRequest services,
631 mojo::shell::mojom::InterfaceProviderPtr exposed_services);
rockotf8fdd9b2015-12-16 22:22:35632
mlamouri4fff1992014-09-30 11:22:46633 ManifestManager* manifest_manager();
634
avi0392dbf52015-03-25 16:55:45635 // TODO(creis): Remove when the only caller, the HistoryController, is no
636 // more.
637 void SetPendingNavigationParams(
638 scoped_ptr<NavigationParams> navigation_params);
639
xhwang5206d4e62016-02-05 02:09:55640 media::MediaPermission* GetMediaPermission();
guoweisf4282b02015-09-24 23:05:22641
creis69b184a472015-11-26 05:29:51642 // Sends the current frame's navigation state to the browser.
643 void SendUpdateState();
644
nasko1fa0fb62015-12-09 01:49:57645 // Creates a MojoBindingsController to allow WebUI documents to communicate
rockot8df5c722016-01-26 07:15:14646 // with the browser process. If |for_layout_tests| is true, the module system
647 // is exposed on a global "mojo" object rather than "define".
648 void EnableMojoBindings(bool for_layout_tests);
nasko1fa0fb62015-12-09 01:49:57649
[email protected]2f61bdd2013-07-02 18:38:47650 protected:
jochen664198b2015-06-25 14:13:00651 explicit RenderFrameImpl(const CreateParams& params);
[email protected]2f61bdd2013-07-02 18:38:47652
[email protected]227692c52013-05-31 22:43:04653 private:
kenrbf98a4d22015-04-01 21:59:35654 friend class RenderFrameImplTest;
[email protected]2e2d9632013-12-03 00:55:26655 friend class RenderFrameObserver;
[email protected]95640212014-07-26 18:14:30656 friend class RendererAccessibilityTest;
clamy98a9dee02015-06-24 16:09:10657 friend class TestRenderFrame;
avi485e5fd62014-08-25 23:26:14658 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem);
659 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
660 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
661 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
[email protected]66bbadaf2014-03-28 16:25:54662 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest,
663 AccessibilityMessagesQueueWhileSwappedOut);
[email protected]2e2d9632013-12-03 00:55:26664
twellington376424ad2015-05-04 18:57:25665 // A wrapper class used as the callback for JavaScript executed
666 // in an isolated world.
667 class JavaScriptIsolatedWorldRequest
668 : public blink::WebScriptExecutionCallback {
669 public:
670 JavaScriptIsolatedWorldRequest(
671 int id,
672 bool notify_result,
673 int routing_id,
674 base::WeakPtr<RenderFrameImpl> render_frame_impl);
675 void completed(
676 const blink::WebVector<v8::Local<v8::Value>>& result) override;
677
678 private:
avi5c77d212015-09-25 20:08:25679 ~JavaScriptIsolatedWorldRequest() override;
twellington376424ad2015-05-04 18:57:25680
681 int id_;
682 bool notify_result_;
683 int routing_id_;
684 base::WeakPtr<RenderFrameImpl> render_frame_impl_;
685
686 DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest);
687 };
688
[email protected]37567b432014-02-12 01:12:22689 typedef std::map<GURL, double> HostZoomLevels;
690
dchengc5ef1a52015-08-26 20:58:30691 // Creates a new RenderFrame. |render_view| is the RenderView object that this
692 // frame belongs to.
ddorwinf63505e2016-01-08 00:54:50693 // Callers *must* call |BindToWebFrame| immediately after creation.
avi1023d012015-12-25 02:39:14694 static RenderFrameImpl* Create(RenderViewImpl* render_view,
695 int32_t routing_id);
dchengc5ef1a52015-08-26 20:58:30696
ddorwinf63505e2016-01-08 00:54:50697 // This is called right after creation with the WebLocalFrame for this
698 // RenderFrame. It must be called before Initialize.
699 void BindToWebFrame(blink::WebLocalFrame* web_frame);
700
[email protected]2e2d9632013-12-03 00:55:26701 // Functions to add and remove observers for this object.
702 void AddObserver(RenderFrameObserver* observer);
703 void RemoveObserver(RenderFrameObserver* observer);
[email protected]1c2052f2013-08-28 08:24:34704
dcheng3d886b732015-11-05 19:16:01705 bool IsLocalRoot() const;
706
[email protected]f0906a02014-08-07 07:18:55707 // Builds and sends DidCommitProvisionalLoad to the host.
avi8c46f7e2015-02-03 18:27:35708 void SendDidCommitProvisionalLoad(blink::WebFrame* frame,
creis8b5cd4c2015-06-19 00:11:08709 blink::WebHistoryCommitType commit_type,
710 const blink::WebHistoryItem& item);
[email protected]37567b432014-02-12 01:12:22711
[email protected]b70da4c2014-01-06 19:57:09712 // IPC message handlers ------------------------------------------------------
713 //
714 // The documentation for these functions should be in
715 // content/common/*_messages.h for the message that the function is handling.
clamy98a9dee02015-06-24 16:09:10716 void OnNavigate(const CommonNavigationParams& common_params,
717 const StartNavigationParams& start_params,
718 const RequestNavigationParams& request_params);
[email protected]f76f32232014-03-11 17:36:17719 void OnBeforeUnload();
alexmosbc7eafa2014-12-06 01:38:09720 void OnSwapOut(int proxy_routing_id,
nasko3e8c20e2014-12-18 06:54:56721 bool is_loading,
alexmosbc7eafa2014-12-06 01:38:09722 const FrameReplicationState& replicated_frame_state);
naskoeab5c5582015-12-15 05:20:00723 void OnDeleteFrame();
Nasko Oskov85f60222014-08-28 22:53:30724 void OnStop();
[email protected]a09d53ce2014-01-31 00:46:42725 void OnShowContextMenu(const gfx::Point& location);
726 void OnContextMenuClosed(const CustomContextMenuContext& custom_context);
727 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context,
728 unsigned action);
[email protected]4ee64622014-03-21 22:34:15729 void OnUndo();
730 void OnRedo();
[email protected]9c9343b2014-03-08 02:56:07731 void OnCut();
732 void OnCopy();
733 void OnPaste();
[email protected]4ee64622014-03-21 22:34:15734 void OnPasteAndMatchStyle();
735 void OnDelete();
736 void OnSelectAll();
christiankaeed9862014-11-05 10:49:14737 void OnSelectRange(const gfx::Point& base, const gfx::Point& extent);
aurimasab0319022015-07-10 21:57:38738 void OnAdjustSelectionByCharacterOffset(int start_adjust, int end_adjust);
[email protected]4ee64622014-03-21 22:34:15739 void OnUnselect();
christiankaeed9862014-11-05 10:49:14740 void OnMoveRangeSelectionExtent(const gfx::Point& point);
[email protected]1f3fc1d2014-04-03 14:50:17741 void OnReplace(const base::string16& text);
742 void OnReplaceMisspelling(const base::string16& text);
[email protected]e31b8ebb2014-03-07 17:59:34743 void OnCSSInsertRequest(const std::string& css);
peter4eb242002015-06-02 12:45:13744 void OnAddMessageToConsole(ConsoleMessageLevel level,
745 const std::string& message);
[email protected]f13ab892014-03-12 06:48:52746 void OnJavaScriptExecuteRequest(const base::string16& javascript,
747 int id,
748 bool notify_result);
zeeshanq3454e9c2014-09-04 21:30:28749 void OnJavaScriptExecuteRequestForTests(const base::string16& javascript,
750 int id,
jochen2e7d95b2015-05-04 15:28:50751 bool notify_result,
752 bool has_user_gesture);
twellington376424ad2015-05-04 18:57:25753 void OnJavaScriptExecuteRequestInIsolatedWorld(const base::string16& jscript,
754 int id,
755 bool notify_result,
756 int world_id);
avi1023d012015-12-25 02:39:14757 void OnVisualStateRequest(uint64_t key);
[email protected]4ee64622014-03-21 22:34:15758 void OnSetEditableSelectionOffsets(int start, int end);
[email protected]e5e438d62014-03-27 21:47:16759 void OnSetCompositionFromExistingText(
760 int start, int end,
761 const std::vector<blink::WebCompositionUnderline>& underlines);
sammcbc9e99332014-12-18 00:55:24762 void OnExecuteNoValueEditCommand(const std::string& name);
[email protected]e5e438d62014-03-27 21:47:16763 void OnExtendSelectionAndDelete(int before, int after);
[email protected]4fed3702014-04-01 09:08:00764 void OnReload(bool ignore_cache);
megjablon3f5941072016-02-04 23:27:52765 void OnReloadLoFiImages();
jam973236102016-02-09 00:47:05766 void OnTextSurroundingSelectionRequest(uint32_t max_length);
[email protected]95640212014-07-26 18:14:30767 void OnSetAccessibilityMode(AccessibilityMode new_mode);
dmazzoni83ba5c82015-04-14 07:11:51768 void OnSnapshotAccessibilityTree(int callback_id);
alexmos95733002015-08-24 16:38:09769 void OnUpdateOpener(int opener_routing_id);
dcheng5f60abb2015-05-28 01:39:36770 void OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags);
lazyboy70605c32015-11-03 01:27:31771 void OnSetFrameOwnerProperties(
772 const blink::WebFrameOwnerProperties& frame_owner_properties);
alexmos401f0aba2015-12-06 10:07:39773 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id);
alexmos5357efb2015-12-16 21:44:00774 void OnSetFocusedFrame();
dspelle736c9db2015-04-03 04:53:16775 void OnTextTrackSettingsChanged(
776 const FrameMsg_TextTrackSettings_Params& params);
alexmose7da5a12015-04-09 02:22:16777 void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params);
davidbena5496d62014-10-07 18:52:04778 void OnCommitNavigation(const ResourceResponseHead& response,
779 const GURL& stream_url,
clamy9bfeef42014-09-30 20:50:42780 const CommonNavigationParams& common_params,
clamy57b4b8e2015-03-24 13:32:11781 const RequestNavigationParams& request_params);
clamy62b271d2015-04-16 11:54:57782 void OnFailedNavigation(const CommonNavigationParams& common_params,
783 const RequestNavigationParams& request_params,
784 bool has_stale_copy_in_cache,
785 int error_code);
lukasza6af746b72015-09-18 23:37:22786 void OnGetSavableResourceLinks();
lukasza2e296c32015-09-28 23:29:48787 void OnGetSerializedHtmlWithLocalLinks(
lukasza777a7dd2016-01-25 23:55:47788 const std::map<GURL, base::FilePath>& url_to_local_path,
789 const std::map<int, base::FilePath>& frame_routing_id_to_local_path);
lukaszaede9cc02015-12-30 23:48:32790 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params);
paulmeyer5d0a5f02016-01-21 20:15:52791 void OnFind(int request_id,
792 const base::string16& search_text,
793 const blink::WebFindOptions& options);
794 void OnStopFinding(StopFindAction action);
795#if defined(OS_ANDROID)
796 void OnActivateNearestFindResult(int request_id, float x, float y);
797 void OnFindMatchRects(int current_version);
798 void OnSelectPopupMenuItems(bool canceled,
799 const std::vector<int>& selected_indices);
800#elif defined(OS_MACOSX)
801 void OnSelectPopupMenuItem(int selected_index);
802 void OnCopyToFindPboard();
803#endif
clamy9bfeef42014-09-30 20:50:42804
creise18ce072015-12-02 02:00:02805 // Requests that the browser process navigates to |url|. If
806 // |is_history_navigation_in_new_child| is true, the browser process should
807 // look for a matching FrameNavigationEntry in the last committed entry to use
808 // instead of |url|.
japhetb0bae9d82015-10-19 20:43:40809 void OpenURL(const GURL& url,
[email protected]65920f332014-03-04 21:14:18810 const Referrer& referrer,
japhetb0bae9d82015-10-19 20:43:40811 blink::WebNavigationPolicy policy,
creise18ce072015-12-02 02:00:02812 bool should_replace_current_entry,
813 bool is_history_navigation_in_new_child);
[email protected]a09d53ce2014-01-31 00:46:42814
clamyd6983032015-04-29 14:48:12815 // Performs a navigation in the frame. This provides a unified function for
816 // the current code path and the browser-side navigation path (in
817 // development). Currently used by OnNavigate, with all *NavigationParams
818 // provided by the browser. |stream_params| should be null.
819 // PlzNavigate: used by OnCommitNavigation, with |common_params| and
820 // |request_params| received by the browser. |stream_params| should be non
821 // null and created from the information provided by the browser.
822 // |start_params| is not used.
823 void NavigateInternal(const CommonNavigationParams& common_params,
824 const StartNavigationParams& start_params,
825 const RequestNavigationParams& request_params,
826 scoped_ptr<StreamOverrideParameters> stream_params);
827
[email protected]ef3adfc2014-05-11 00:04:54828 // Update current main frame's encoding and send it to browser window.
829 // Since we want to let users see the right encoding info from menu
830 // before finishing loading, we call the UpdateEncoding in
831 // a) function:DidCommitLoadForFrame. When this function is called,
832 // that means we have got first data. In here we try to get encoding
833 // of page if it has been specified in http header.
834 // b) function:DidReceiveTitle. When this function is called,
835 // that means we have got specified title. Because in most of webpages,
836 // title tags will follow meta tags. In here we try to get encoding of
837 // page if it has been specified in meta tag.
838 // c) function:DidFinishDocumentLoadForFrame. When this function is
839 // called, that means we have got whole html page. In here we should
840 // finally get right encoding of page.
841 void UpdateEncoding(blink::WebFrame* frame,
842 const std::string& encoding_name);
843
[email protected]4ee64622014-03-21 22:34:15844 // Dispatches the current state of selection on the webpage to the browser if
845 // it has changed.
846 // TODO(varunjain): delete this method once we figure out how to keep
847 // selection handles in sync with the webpage.
848 void SyncSelectionIfRequired();
849
[email protected]87de04b02014-04-08 22:14:49850 bool RunJavaScriptMessage(JavaScriptMessageType type,
851 const base::string16& message,
852 const base::string16& default_value,
853 const GURL& frame_url,
854 base::string16* result);
855
[email protected]457736d2014-04-30 15:54:27856 // Loads the appropriate error page for the specified failure into the frame.
857 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request,
858 const blink::WebURLError& error,
859 bool replace);
860
zeeshanq3454e9c2014-09-04 21:30:28861 void HandleJavascriptExecutionResult(const base::string16& javascript,
862 int id,
863 bool notify_result,
deepak.s750d68f2015-04-30 07:32:41864 v8::Local<v8::Value> result);
zeeshanq3454e9c2014-09-04 21:30:28865
[email protected]977db4a42014-07-17 08:04:32866 // Initializes |web_user_media_client_|. If this fails, because it wasn't
867 // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then
868 // |web_user_media_client_| will remain NULL.
869 void InitializeUserMediaClient();
[email protected]96307312014-05-04 01:00:19870
871 blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream(
guidou9c3cc3e2015-10-27 13:38:15872 blink::WebMediaPlayerClient* client,
873 const blink::WebString& sink_id,
874 const blink::WebSecurityOrigin& security_origin);
[email protected]96307312014-05-04 01:00:19875
[email protected]ae2477e2014-05-27 23:47:08876 // Creates a factory object used for creating audio and video renderers.
jochen51265132015-05-28 07:33:45877 scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory();
[email protected]ae2477e2014-05-27 23:47:08878
avi5cad4912015-06-19 05:25:44879 // Does preparation for the navigation to |url|.
880 void PrepareRenderViewForNavigation(
clamyda97e8322014-10-07 21:57:25881 const GURL& url,
clamy57b4b8e2015-03-24 13:32:11882 const RequestNavigationParams& request_params,
clamyda97e8322014-10-07 21:57:25883 bool* is_reload,
884 blink::WebURLRequest::CachePolicy* cache_policy);
885
clamyece38882014-11-19 15:00:20886 // PlzNavigate
887 // Sends a FrameHostMsg_BeginNavigation to the browser based on the contents
888 // of the WebURLRequest.
clamyd3edf862016-02-01 12:39:28889 // |should_replace_current_entry| indicates that the current history entry
890 // will be replaced when the navigation commits. |is_client_redirect|
891 // indicates that the navigation originated as a client redirect.
892 // Note: those two concepts are separate. For example, a location.assign is a
893 // client redirect but it only replaces the current entry if called before
894 // load stop. location.replace on the other hand is a client redirect and
895 // always replaces the current entry.
896 void BeginNavigation(blink::WebURLRequest* request,
897 bool should_replace_current_entry,
898 bool is_client_redirect);
clamyece38882014-11-19 15:00:20899
clamy4cc9b8202015-03-02 13:51:36900 // Loads a data url.
901 void LoadDataURL(const CommonNavigationParams& params,
mnaganovbf087422015-12-16 05:10:03902 const RequestNavigationParams& request_params,
boliu15890e42015-11-24 23:08:05903 blink::WebFrame* frame,
904 blink::WebFrameLoadType load_type);
clamy4cc9b8202015-03-02 13:51:36905
clamy62b271d2015-04-16 11:54:57906 // Sends a proper FrameHostMsg_DidFailProvisionalLoadWithError_Params IPC for
907 // the failed request |request|.
908 void SendFailedProvisionalLoad(const blink::WebURLRequest& request,
909 const blink::WebURLError& error,
910 blink::WebLocalFrame* frame);
911
912 bool ShouldDisplayErrorPageForFailedLoad(int error_code,
913 const GURL& unreachable_url);
914
[email protected]f3a95312014-06-12 16:46:58915 // Returns the URL being loaded by the |frame_|'s request.
916 GURL GetLoadingUrl() const;
917
avi0392dbf52015-03-25 16:55:45918 // If we initiated a navigation, this function will populate |document_state|
919 // with the navigation information saved in OnNavigate().
920 void PopulateDocumentStateFromPending(DocumentState* document_state);
921
922 // Returns a new NavigationState populated with the navigation information
923 // saved in OnNavigate().
924 NavigationState* CreateNavigationStateFromPending();
925
csharrison1ce0e852015-11-07 16:45:13926 // Sets the NavigationState on the DocumentState based on
927 // the value of |pending_navigation_params_|.
928 void UpdateNavigationState(DocumentState* document_state);
929
[email protected]96307312014-05-04 01:00:19930#if defined(OS_ANDROID)
[email protected]65f3d1aa2014-05-29 01:57:00931 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer(
jrummell65b7d272014-09-24 20:49:27932 blink::WebMediaPlayerClient* client,
srirama.m26f864d02015-07-14 05:21:46933 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client,
dalecurtis49f363882015-08-25 21:05:38934 const media::WebMediaPlayerParams& params);
[email protected]a017938b2014-05-27 21:17:17935
[email protected]65f3d1aa2014-05-29 01:57:00936 RendererMediaPlayerManager* GetMediaPlayerManager();
davve859f4f92015-11-27 10:16:19937
938 RendererMediaSessionManager* GetMediaSessionManager();
[email protected]4b556cf2014-06-10 23:21:53939#endif
940
sandersd02d9aea2015-05-12 02:29:26941 bool AreSecureCodecsSupported();
xhwang33f939e2015-06-23 04:33:42942
xhwange70b7ee12015-06-25 09:17:17943#if defined(ENABLE_MOJO_MEDIA)
xhwangc0299ae32015-07-21 23:39:50944 media::interfaces::ServiceFactory* GetMediaServiceFactory();
xhwang33f939e2015-06-23 04:33:42945
xhwangc0299ae32015-07-21 23:39:50946 // Called when a connection error happened on |media_service_factory_|.
947 void OnMediaServiceFactoryConnectionError();
xhwang33f939e2015-06-23 04:33:42948#endif
949
xhwangd7180832015-04-03 05:38:15950 media::CdmFactory* GetCdmFactory();
[email protected]96307312014-05-04 01:00:19951
halton.huoca2eabd2015-07-06 08:17:40952 void RegisterMojoServices();
953
xhwang6bca21e2016-02-06 00:21:45954 // Connect to an interface provided by the service registry.
955 template <typename Interface>
bene3bc9022016-02-10 17:38:24956 void GetInterface(mojo::InterfaceRequest<Interface> request);
xhwang6bca21e2016-02-06 00:21:45957
rockotd9260982015-08-21 22:26:30958 // Connects to a Mojo application and returns a proxy to its exposed
959 // ServiceProvider.
ben80ab89052016-02-11 20:19:27960 mojo::shell::mojom::InterfaceProviderPtr ConnectToApplication(
961 const GURL& url);
rockotd9260982015-08-21 22:26:30962
dalecurtisa12e6062015-11-10 23:13:14963 // Returns the media delegate for WebMediaPlayer usage. If
964 // |media_player_delegate_| is NULL, one is created.
965 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate();
966
paulmeyer5d0a5f02016-01-21 20:15:52967 // Called to get the WebPlugin to handle find requests in the document.
968 // Returns nullptr if there is no such WebPlugin.
969 blink::WebPlugin* GetWebPluginForFind();
970
971 // Sends a reply to the current find operation handling if it was a
972 // synchronous find request.
973 void SendFindReply(int request_id,
974 int match_count,
975 int ordinal,
976 const blink::WebRect& selection_rect,
977 bool final_status_update);
978
creiscfaa4462015-03-16 19:27:18979 // Stores the WebLocalFrame we are associated with. This is null from the
ddorwinf63505e2016-01-08 00:54:50980 // constructor until BindToWebFrame is called, and it is null after
creiscfaa4462015-03-16 19:27:18981 // frameDetached is called until destruction (which is asynchronous in the
982 // case of the main frame, but not subframes).
[email protected]35b2a972014-04-04 15:50:22983 blink::WebLocalFrame* frame_;
[email protected]b70da4c2014-01-06 19:57:09984
dglazkov2e140f52015-09-28 16:10:07985 // Boolean value indicating whether this RenderFrameImpl object is for the
986 // main frame or not. It remains accurate during destruction, even when
987 // |frame_| has been invalidated.
988 bool is_main_frame_;
nasko8b9d9bd2015-05-06 19:23:19989
naskoeab5c5582015-12-15 05:20:00990 // When a frame is detached in response to a message from the browser process,
991 // this RenderFrame should not be sending notifications back to it. This
992 // boolean is used to indicate this case.
993 bool in_browser_initiated_detach_;
994
995 // Indicates whether the frame has been inserted into the frame tree yet or
996 // not.
997 //
998 // When a frame is created by the browser process, it is for a pending
999 // navigation. In this case, it is not immediately attached to the frame tree
1000 // if there is a RenderFrameProxy for the same frame. It is inserted into the
1001 // frame tree at the time the pending navigation commits.
1002 // Frames added by the parent document are created from the renderer process
1003 // and are immediately inserted in the frame tree.
1004 // TODO(dcheng): Remove this once we have FrameTreeHandle and can use the
1005 // Blink Web* layer to check for provisional frames.
1006 bool in_frame_tree_;
1007
[email protected]abc501e2014-01-27 19:27:261008 base::WeakPtr<RenderViewImpl> render_view_;
[email protected]227692c52013-05-31 22:43:041009 int routing_id_;
[email protected]1c2052f2013-08-28 08:24:341010 bool is_swapped_out_;
nasko8b9d9bd2015-05-06 19:23:191011
[email protected]5a7100d2014-05-19 01:29:041012 // RenderFrameProxy exists only when is_swapped_out_ is true.
1013 // TODO(nasko): This can be removed once we don't have a swapped out state on
1014 // RenderFrame. See https://crbug.com/357747.
1015 RenderFrameProxy* render_frame_proxy_;
[email protected]1c2052f2013-08-28 08:24:341016 bool is_detaching_;
[email protected]227692c52013-05-31 22:43:041017
japhete6adf142014-10-31 00:01:491018 // If this frame was created to replace a proxy, this will store the routing
1019 // id of the proxy to replace at commit-time, at which time it will be
1020 // cleared.
1021 // TODO(creis): Remove this after switching to PlzNavigate.
1022 int proxy_routing_id_;
1023
dcheng3d886b732015-11-05 19:16:011024 // Non-null when the RenderFrame is a local root for compositing, input,
1025 // layout, etc. A local frame is also a local root iff it does not have a
1026 // parent that is a local frame.
kenrba7199832015-01-22 23:44:591027 scoped_refptr<RenderWidget> render_widget_;
1028
avi0392dbf52015-03-25 16:55:451029 // Temporarily holds state pertaining to a navigation that has been initiated
1030 // until the NavigationState corresponding to the new navigation is created in
1031 // didCreateDataSource().
1032 scoped_ptr<NavigationParams> pending_navigation_params_;
1033
creis8eb8ef22015-11-04 22:51:381034 // Stores the current history item for this frame, so that updates to it can
1035 // be reported to the browser process via SendUpdateState.
1036 blink::WebHistoryItem current_history_item_;
1037
[email protected]7a4e2532013-12-02 21:30:021038#if defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:021039 // Current text input composition text. Empty if no composition is in
1040 // progress.
[email protected]fcf75d42013-12-03 20:11:261041 base::string16 pepper_composition_text_;
tommyclieb25b2a2014-11-03 19:45:091042
tommycli59bd86c2014-12-10 02:09:381043 PluginPowerSaverHelper* plugin_power_saver_helper_;
paulmeyer5d0a5f02016-01-21 20:15:521044
1045 PepperPluginInstanceImpl* plugin_find_handler_;
[email protected]7a4e2532013-12-02 21:30:021046#endif
1047
[email protected]f3add922013-12-20 23:17:161048 RendererWebCookieJarImpl cookie_jar_;
1049
[email protected]2e2d9632013-12-03 00:55:261050 // All the registered observers.
brettw236d3172015-06-03 16:31:431051 base::ObserverList<RenderFrameObserver> observers_;
[email protected]2e2d9632013-12-03 00:55:261052
[email protected]bffc8302014-01-23 20:52:161053 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
1054
[email protected]4ecee352014-03-11 21:12:191055 // The node that the context menu was pressed over.
1056 blink::WebNode context_menu_node_;
1057
[email protected]a09d53ce2014-01-31 00:46:421058 // External context menu requests we're waiting for. "Internal"
1059 // (WebKit-originated) context menu events will have an ID of 0 and will not
1060 // be in this map.
1061 //
1062 // We don't want to add internal ones since some of the "special" page
1063 // handlers in the browser process just ignore the context menu requests so
1064 // avoid showing context menus, and so this will cause right clicks to leak
1065 // entries in this map. Most users of the custom context menu (e.g. Pepper
1066 // plugins) are normally only on "regular" pages and the regular pages will
1067 // always respond properly to the request, so we don't have to worry so
1068 // much about leaks.
1069 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_;
1070
[email protected]4ee64622014-03-21 22:34:151071 // The text selection the last time DidChangeSelection got called. May contain
1072 // additional characters before and after the selected text, for IMEs. The
1073 // portion of this string that is the actual selected text starts at index
1074 // |selection_range_.GetMin() - selection_text_offset_| and has length
1075 // |selection_range_.length()|.
1076 base::string16 selection_text_;
1077 // The offset corresponding to the start of |selection_text_| in the document.
1078 size_t selection_text_offset_;
1079 // Range over the document corresponding to the actual selected text (which
1080 // could correspond to a substring of |selection_text_|; see above).
1081 gfx::Range selection_range_;
1082 // Used to inform didChangeSelection() when it is called in the context
1083 // of handling a InputMsg_SelectRange IPC.
1084 bool handling_select_range_;
1085
[email protected]2626d142014-04-22 17:24:021086 // The next group of objects all implement RenderFrameObserver, so are deleted
1087 // along with the RenderFrame automatically. This is why we just store weak
1088 // references.
1089
[email protected]4459599e2014-07-29 22:40:091090 // Dispatches permission requests for Web Notifications.
1091 NotificationPermissionDispatcher* notification_permission_dispatcher_;
1092
[email protected]977db4a42014-07-17 08:04:321093 // Destroyed via the RenderFrameObserver::OnDestruct() mechanism.
perkj1a2d0432014-09-03 13:52:331094 UserMediaClientImpl* web_user_media_client_;
[email protected]96307312014-05-04 01:00:191095
jrummell109c3a602014-12-18 01:08:501096 // EncryptedMediaClient attached to this frame; lazily initialized.
xhwang430baee2015-01-22 05:46:201097 scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_;
jrummell109c3a602014-12-18 01:08:501098
xhwang6bca21e2016-02-06 00:21:451099 // The media permission dispatcher attached to this frame.
1100 scoped_ptr<MediaPermissionDispatcher> media_permission_dispatcher_;
xhwang36b1f3b2015-01-27 17:54:011101
xhwange70b7ee12015-06-25 09:17:171102#if defined(ENABLE_MOJO_MEDIA)
xhwangc0299ae32015-07-21 23:39:501103 // The media factory attached to this frame, lazily initialized.
1104 media::interfaces::ServiceFactoryPtr media_service_factory_;
xhwang065b54b2015-06-03 22:25:551105#endif
1106
[email protected]52d3e172014-06-16 16:57:021107 // MidiClient attached to this frame; lazily initialized.
1108 MidiDispatcher* midi_dispatcher_;
1109
[email protected]a017938b2014-05-27 21:17:171110#if defined(OS_ANDROID)
davve859f4f92015-11-27 10:16:191111 // Manages all media players and sessions in this render frame for
1112 // communicating with the real media player and sessions in the
1113 // browser process. It's okay to use raw pointers since they're both
1114 // RenderFrameObservers.
[email protected]a017938b2014-05-27 21:17:171115 RendererMediaPlayerManager* media_player_manager_;
davve859f4f92015-11-27 10:16:191116 RendererMediaSessionManager* media_session_manager_;
[email protected]4b556cf2014-06-10 23:21:531117#endif
1118
1119#if defined(ENABLE_BROWSER_CDMS)
1120 // Manage all CDMs in this render frame for communicating with the real CDM in
1121 // the browser process. It's okay to use a raw pointer since it's a
1122 // RenderFrameObserver.
[email protected]65f3d1aa2014-05-29 01:57:001123 RendererCdmManager* cdm_manager_;
[email protected]a017938b2014-05-27 21:17:171124#endif
1125
xhwangd7180832015-04-03 05:38:151126 // The CDM factory attached to this frame, lazily initialized.
xhwangf2eb532f2015-06-25 01:51:191127 scoped_ptr<media::CdmFactory> cdm_factory_;
xhwangd7180832015-04-03 05:38:151128
hubbe5f0ad43b2015-12-14 20:57:261129 // Media resource cache, lazily initialized.
1130 linked_ptr<media::UrlIndex> url_index_;
1131
[email protected]a6e21c372014-07-12 02:27:211132#if defined(VIDEO_HOLE)
1133 // Whether or not this RenderFrameImpl contains a media player. Used to
1134 // register as an observer for video-hole-specific events.
1135 bool contains_media_player_;
1136#endif
1137
dgozman358ba322015-03-26 15:05:301138 // The devtools agent for this frame; only created for main frame and
1139 // local roots.
1140 DevToolsAgent* devtools_agent_;
1141
alogvinovf50445a2015-10-30 13:00:121142 WakeLockDispatcher* wakelock_dispatcher_;
1143
[email protected]45920862014-07-02 12:53:021144 // The geolocation dispatcher attached to this frame, lazily initialized.
[email protected]8eae0802014-06-02 21:35:551145 GeolocationDispatcher* geolocation_dispatcher_;
1146
[email protected]45920862014-07-02 12:53:021147 // The push messaging dispatcher attached to this frame, lazily initialized.
1148 PushMessagingDispatcher* push_messaging_dispatcher_;
1149
avayvodbca35fad2015-01-29 20:20:571150 // The presentation dispatcher implementation attached to this frame, lazily
1151 // initialized.
1152 PresentationDispatcher* presentation_dispatcher_;
1153
rockotf8fdd9b2015-12-16 22:22:351154 ServiceRegistryImpl service_registry_;
[email protected]c52a1412014-06-25 06:09:251155
rockotd9260982015-08-21 22:26:301156 // The shell proxy used to connect to Mojo applications.
ben9aaf3032016-02-06 08:56:491157 mojo::shell::mojom::ShellPtr mojo_shell_;
rockotd9260982015-08-21 22:26:301158
[email protected]45920862014-07-02 12:53:021159 // The screen orientation dispatcher attached to the frame, lazily
1160 // initialized.
[email protected]cf78eda2014-06-13 16:57:411161 ScreenOrientationDispatcher* screen_orientation_dispatcher_;
1162
mlamouriefdca9d2014-09-16 16:55:401163 // The Manifest Manager handles the manifest requests from the browser
1164 // process.
1165 ManifestManager* manifest_manager_;
1166
[email protected]95640212014-07-26 18:14:301167 // The current accessibility mode.
1168 AccessibilityMode accessibility_mode_;
1169
1170 // Only valid if |accessibility_mode_| is anything other than
1171 // AccessibilityModeOff.
1172 RendererAccessibility* renderer_accessibility_;
1173
mlamouric6d31db2015-03-28 17:48:141174 scoped_ptr<PermissionDispatcher> permission_client_;
mlamouri670a86d2015-03-17 16:06:251175
benwells04ab5b962015-05-06 08:29:401176 scoped_ptr<blink::WebAppBannerClient> app_banner_client_;
1177
jyasskinf89a11b2015-07-21 00:27:481178 scoped_ptr<blink::WebBluetooth> bluetooth_;
1179
rockotd9260982015-08-21 22:26:301180 scoped_ptr<blink::WebUSBClient> usb_client_;
1181
dalecurtisa12e6062015-11-10 23:13:141182 // Manages play, pause notifications for WebMediaPlayer implementations; its
1183 // lifetime is tied to the RenderFrame via the RenderFrameObserver interface.
1184 media::RendererWebMediaPlayerDelegate* media_player_delegate_;
1185
megjablond5ac7d52015-10-22 23:56:121186 // Whether or not this RenderFrame is using Lo-Fi mode.
1187 bool is_using_lofi_;
1188
ellyjonesdb20fae12015-12-04 16:47:551189 // Whether or not this RenderFrame is currently pasting.
1190 bool is_pasting_;
1191
bajones02443532015-06-22 21:17:401192#if defined(ENABLE_WEBVR)
1193 // The VR dispatcher attached to the frame, lazily initialized.
1194 scoped_ptr<VRDispatcher> vr_dispatcher_;
1195#endif
1196
avi485e5fd62014-08-25 23:26:141197#if defined(OS_MACOSX) || defined(OS_ANDROID)
1198 // The external popup for the currently showing select popup.
1199 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1200#endif
1201
[email protected]96307312014-05-04 01:00:191202 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
1203
[email protected]227692c52013-05-31 22:43:041204 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
1205};
1206
1207} // namespace content
1208
[email protected]85d85fd2013-06-19 00:57:411209#endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_