blob: ae5dae610bcbd9de9ba20f004a593cc36d2a9c78 [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
dchengcedca5612016-04-09 01:40:1511#include <memory>
guidou3906a722015-11-12 22:14:4212#include <string>
[email protected]7a4e2532013-12-02 21:30:0213#include <vector>
14
[email protected]7a4e2532013-12-02 21:30:0215#include "base/files/file_path.h"
[email protected]a09d53ce2014-01-31 00:46:4216#include "base/gtest_prod_util.h"
17#include "base/id_map.h"
avi1023d012015-12-25 02:39:1418#include "base/macros.h"
hubbe5f0ad43b2015-12-14 20:57:2619#include "base/memory/linked_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"
skyostilb4cce1b2016-03-31 17:56:3432#include "content/renderer/frame_blame_context.h"
sammcbebeb602016-04-06 06:42:5533#include "content/renderer/mojo/blink_service_registry_impl.h"
[email protected]f3add922013-12-20 23:17:1634#include "content/renderer/renderer_webcookiejar_impl.h"
[email protected]227692c52013-05-31 22:43:0435#include "ipc/ipc_message.h"
lukasza70b79c82015-12-14 20:24:1336#include "ipc/ipc_platform_file.h"
acolwell9e0840d2014-09-06 19:01:3237#include "media/blink/webmediaplayer_delegate.h"
dalecurtis49f363882015-08-25 21:05:3838#include "media/blink/webmediaplayer_params.h"
benf709a3092016-04-12 22:38:2239#include "services/shell/public/interfaces/connector.mojom.h"
40#include "services/shell/public/interfaces/interface_provider.mojom.h"
tbansal7b6cf8b2016-05-10 19:27:2341#include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h"
alexmos401f0aba2015-12-06 10:07:3942#include "third_party/WebKit/public/platform/WebFocusType.h"
csharrisonae811ab2016-04-11 11:32:2543#include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h"
sandersdf92f4e5c2016-01-22 20:57:2244#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
benwells04ab5b962015-05-06 08:29:4045#include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClient.h"
[email protected]95640212014-07-26 18:14:3046#include "third_party/WebKit/public/web/WebAXObject.h"
[email protected]85d85fd2013-06-19 00:57:4147#include "third_party/WebKit/public/web/WebDataSource.h"
48#include "third_party/WebKit/public/web/WebFrameClient.h"
boliu15890e42015-11-24 23:08:0549#include "third_party/WebKit/public/web/WebFrameLoadType.h"
lazyboy70605c32015-11-03 01:27:3150#include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
lukasza902fcc52015-12-31 04:45:2951#include "third_party/WebKit/public/web/WebFrameSerializerClient.h"
[email protected]680575542014-04-03 17:12:5252#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
skyostilc3ed5652015-10-19 16:28:4653#include "third_party/WebKit/public/web/WebMeaningfulLayout.h"
twellington376424ad2015-05-04 18:57:2554#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
[email protected]4ee64622014-03-21 22:34:1555#include "ui/gfx/range/range.h"
lukaszaede9cc02015-12-30 23:48:3256#include "url/gurl.h"
[email protected]227692c52013-05-31 22:43:0457
tommyclid481c482014-12-03 01:50:4158#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:3859#include "content/renderer/pepper/plugin_power_saver_helper.h"
tommyclid481c482014-12-03 01:50:4160#endif
61
[email protected]a017938b2014-05-27 21:17:1762#if defined(OS_ANDROID)
63#include "content/renderer/media/android/renderer_media_player_manager.h"
64#endif
65
xhwangc0299ae32015-07-21 23:39:5066#if defined(ENABLE_MOJO_MEDIA)
jbromanb73f2582016-01-11 16:35:0567#include "media/mojo/interfaces/service_factory.mojom.h" // nogncheck
xhwangc0299ae32015-07-21 23:39:5068#endif
69
[email protected]7a4e2532013-12-02 21:30:0270class TransportDIB;
kenrba7199832015-01-22 23:44:5971struct FrameMsg_NewFrame_WidgetParams;
alexmose7da5a12015-04-09 02:22:1672struct FrameMsg_PostMessage_Params;
lukaszaede9cc02015-12-30 23:48:3273struct FrameMsg_SerializeAsMHTML_Params;
dspelle736c9db2015-04-03 04:53:1674struct FrameMsg_TextTrackSettings_Params;
[email protected]7a4e2532013-12-02 21:30:0275
avi7d30b552016-04-06 20:32:5576namespace IPC {
77class SyncMessage;
78}
79
[email protected]7a4e2532013-12-02 21:30:0280namespace blink {
81class WebMouseEvent;
[email protected]82ce5b92014-03-22 05:15:2682class WebContentDecryptionModule;
avayvodbca35fad2015-01-29 20:20:5783class WebPresentationClient;
[email protected]45920862014-07-02 12:53:0284class WebPushClient;
[email protected]82ce5b92014-03-22 05:15:2685class WebSecurityOrigin;
toyoshimf3f7f682016-04-08 07:47:4886enum class WebCachePolicy;
[email protected]7a4e2532013-12-02 21:30:0287struct WebCompositionUnderline;
[email protected]a09d53ce2014-01-31 00:46:4288struct WebContextMenuData;
[email protected]7a4e2532013-12-02 21:30:0289struct WebCursorInfo;
paulmeyer5d0a5f02016-01-21 20:15:5290struct WebFindOptions;
dcheng3ce04b62015-10-26 23:30:5591struct WebScreenInfo;
[email protected]7a4e2532013-12-02 21:30:0292}
93
94namespace gfx {
[email protected]a09d53ce2014-01-31 00:46:4295class Point;
[email protected]7a4e2532013-12-02 21:30:0296class Range;
97class Rect;
98}
99
jrummell109c3a602014-12-18 01:08:50100namespace media {
xhwangd7180832015-04-03 05:38:15101class CdmFactory;
xhwang409e53552016-02-23 00:52:44102class DecoderFactory;
xhwang60b430a2015-02-01 05:20:46103class MediaPermission;
hubbe5f0ad43b2015-12-14 20:57:26104class MediaServiceProvider;
dalecurtisa12e6062015-11-10 23:13:14105class RendererWebMediaPlayerDelegate;
watkdee516f2016-02-18 02:22:19106class SurfaceManager;
hubbe5f0ad43b2015-12-14 20:57:26107class UrlIndex;
jrummell109c3a602014-12-18 01:08:50108class WebEncryptedMediaClientImpl;
109}
110
xhwang33f939e2015-06-23 04:33:42111namespace mojo {
112class ServiceProvider;
113}
114
tommycli58e3172c2015-09-15 18:18:26115namespace url {
116class Origin;
117}
118
[email protected]227692c52013-05-31 22:43:04119namespace content {
120
[email protected]bffc8302014-01-23 20:52:16121class ChildFrameCompositingHelper;
kenrba7199832015-01-22 23:44:59122class CompositorDependencies;
dgozman358ba322015-03-26 15:05:30123class DevToolsAgent;
avi0392dbf52015-03-25 16:55:45124class DocumentState;
avi485e5fd62014-08-25 23:26:14125class ExternalPopupMenu;
mlamouriefdca9d2014-09-16 16:55:40126class ManifestManager;
xhwanga5967e552016-02-26 00:54:08127class MediaInterfaceProvider;
[email protected]977db4a42014-07-17 08:04:32128class MediaStreamDispatcher;
[email protected]ae2477e2014-05-27 23:47:08129class MediaStreamRendererFactory;
xhwang5206d4e62016-02-05 02:09:55130class MediaPermissionDispatcher;
[email protected]52d3e172014-06-16 16:57:02131class MidiDispatcher;
avi0392dbf52015-03-25 16:55:45132class NavigationState;
[email protected]4459599e2014-07-29 22:40:09133class NotificationPermissionDispatcher;
clamyda97e8322014-10-07 21:57:25134class PageState;
[email protected]7a4e2532013-12-02 21:30:02135class PepperPluginInstanceImpl;
mlamouric6d31db2015-03-28 17:48:14136class PermissionDispatcher;
avayvodbca35fad2015-01-29 20:20:57137class PresentationDispatcher;
[email protected]45920862014-07-02 12:53:02138class PushMessagingDispatcher;
[email protected]95640212014-07-26 18:14:30139class RendererAccessibility;
[email protected]4b556cf2014-06-10 23:21:53140class RendererCdmManager;
141class RendererMediaPlayerManager;
davve859f4f92015-11-27 10:16:19142class RendererMediaSessionManager;
[email protected]7a4e2532013-12-02 21:30:02143class RendererPpapiHost;
watkdee516f2016-02-18 02:22:19144class RendererSurfaceViewManager;
[email protected]2e2d9632013-12-03 00:55:26145class RenderFrameObserver;
[email protected]227692c52013-05-31 22:43:04146class RenderViewImpl;
[email protected]7a4e2532013-12-02 21:30:02147class RenderWidget;
148class RenderWidgetFullscreenPepper;
clamy34754b42016-05-20 19:12:58149class ResourceRequestBody;
[email protected]cf78eda2014-06-13 16:57:41150class ScreenOrientationDispatcher;
perkj1a2d0432014-09-03 13:52:33151class UserMediaClientImpl;
alogvinovf50445a2015-10-30 13:00:12152class WakeLockDispatcher;
clamy9bfeef42014-09-30 20:50:42153struct CommonNavigationParams;
[email protected]a09d53ce2014-01-31 00:46:42154struct CustomContextMenuContext;
alexmosbc7eafa2014-12-06 01:38:09155struct FrameReplicationState;
avi0392dbf52015-03-25 16:55:45156struct NavigationParams;
clamy79b3da62014-10-14 08:50:37157struct RequestNavigationParams;
davidbena5496d62014-10-07 18:52:04158struct ResourceResponseHead;
clamy34e12782015-03-12 11:26:13159struct StartNavigationParams;
clamyd6983032015-04-29 14:48:12160struct StreamOverrideParameters;
[email protected]227692c52013-05-31 22:43:04161
[email protected]85d85fd2013-06-19 00:57:41162class CONTENT_EXPORT RenderFrameImpl
163 : public RenderFrame,
[email protected]96307312014-05-04 01:00:19164 NON_EXPORTED_BASE(public blink::WebFrameClient),
lukasza902fcc52015-12-31 04:45:29165 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) {
[email protected]227692c52013-05-31 22:43:04166 public:
dchengc5ef1a52015-08-26 20:58:30167 // Creates a new RenderFrame as the main frame of |render_view|.
dcheng3ce04b62015-10-26 23:30:55168 static RenderFrameImpl* CreateMainFrame(
169 RenderViewImpl* render_view,
170 int32_t routing_id,
171 int32_t widget_routing_id,
172 bool hidden,
173 const blink::WebScreenInfo& screen_info,
dcheng9e24bd352016-03-01 19:15:51174 CompositorDependencies* compositor_deps,
175 blink::WebFrame* opener);
[email protected]2f61bdd2013-07-02 18:38:47176
alexmosa181efc2015-09-03 00:39:04177 // Creates a new RenderFrame with |routing_id|. If |proxy_routing_id| is
178 // MSG_ROUTING_NONE, it creates the Blink WebLocalFrame and inserts it into
179 // the frame tree after the frame identified by
180 // |previous_sibling_routing_id|, or as the first child if
alexmos9f8705a2015-05-06 19:58:59181 // |previous_sibling_routing_id| is MSG_ROUTING_NONE. Otherwise, the frame is
182 // semi-orphaned until it commits, at which point it replaces the proxy
alexmosa181efc2015-09-03 00:39:04183 // identified by |proxy_routing_id|. The frame's opener is set to the frame
184 // identified by |opener_routing_id|. The frame is created as a child of the
185 // RenderFrame identified by |parent_routing_id| or as the top-level frame if
186 // the latter is MSG_ROUTING_NONE. Note: This is called only when
alexmos9f8705a2015-05-06 19:58:59187 // RenderFrame is being created in response to IPC message from the browser
188 // process. All other frame creation is driven through Blink and Create.
lazyboy70605c32015-11-03 01:27:31189 static void CreateFrame(
190 int routing_id,
191 int proxy_routing_id,
192 int opener_routing_id,
193 int parent_routing_id,
194 int previous_sibling_routing_id,
195 const FrameReplicationState& replicated_state,
196 CompositorDependencies* compositor_deps,
197 const FrameMsg_NewFrame_WidgetParams& params,
198 const blink::WebFrameOwnerProperties& frameOwner_properties);
[email protected]82307f6b2014-08-07 03:30:12199
[email protected]5a7100d2014-05-19 01:29:04200 // Returns the RenderFrameImpl for the given routing ID.
201 static RenderFrameImpl* FromRoutingID(int routing_id);
202
[email protected]a5ac6dc2014-01-15 07:02:14203 // Just like RenderFrame::FromWebFrame but returns the implementation.
204 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:09205
[email protected]2f61bdd2013-07-02 18:38:47206 // Used by content_layouttest_support to hook into the creation of
207 // RenderFrameImpls.
jochen664198b2015-06-25 14:13:00208 struct CreateParams {
avi1023d012015-12-25 02:39:14209 CreateParams(RenderViewImpl* render_view, int32_t routing_id)
jochen664198b2015-06-25 14:13:00210 : render_view(render_view), routing_id(routing_id) {}
211 ~CreateParams() {}
212
213 RenderViewImpl* render_view;
avi1023d012015-12-25 02:39:14214 int32_t routing_id;
jochen664198b2015-06-25 14:13:00215 };
216
217 using CreateRenderFrameImplFunction =
218 RenderFrameImpl* (*)(const CreateParams&);
[email protected]2f61bdd2013-07-02 18:38:47219 static void InstallCreateHook(
dongseong.hwangb721ddf2014-12-10 21:22:50220 CreateRenderFrameImplFunction create_render_frame_impl);
[email protected]2f61bdd2013-07-02 18:38:47221
alexmos95733002015-08-24 16:38:09222 // Looks up and returns the WebFrame corresponding to a given opener frame
223 // routing ID. Also stores the opener's RenderView routing ID into
224 // |opener_view_routing_id|.
225 //
226 // TODO(alexmos): remove RenderViewImpl's dependency on
227 // opener_view_routing_id.
228 static blink::WebFrame* ResolveOpener(int opener_frame_routing_id,
229 int* opener_view_routing_id);
230
avi5c77d212015-09-25 20:08:25231 ~RenderFrameImpl() override;
[email protected]227692c52013-05-31 22:43:04232
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
lfge0c2792ec2016-05-11 18:52:08241 // Draw commands have been issued by RenderWidgetCompositor.
242 void DidCommitAndDrawCompositorFrame();
243
[email protected]7a4e2532013-12-02 21:30:02244 // TODO(jam): this is a temporary getter until all the code is transitioned
245 // to using RenderFrame instead of RenderView.
[email protected]abc501e2014-01-27 19:27:26246 RenderViewImpl* render_view() { return render_view_.get(); }
[email protected]7a4e2532013-12-02 21:30:02247
[email protected]f3add922013-12-20 23:17:16248 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; }
249
[email protected]7a4e2532013-12-02 21:30:02250 // Returns the RenderWidget associated with this frame.
251 RenderWidget* GetRenderWidget();
252
dgozmancf9039cd2015-04-06 12:01:31253 DevToolsAgent* devtools_agent() { return devtools_agent_; }
254
[email protected]0287e762014-04-11 13:07:58255 // This method must be called after the frame has been added to the frame
256 // tree. It creates all objects that depend on the frame being at its proper
257 // spot.
258 void Initialize();
259
[email protected]de3c5d82014-05-28 22:12:59260 // Notifications from RenderWidget.
261 void WasHidden();
262 void WasShown();
dgozmancf9039cd2015-04-06 12:01:31263 void WidgetWillClose();
[email protected]de3c5d82014-05-28 22:12:59264
[email protected]723971b2014-02-12 11:08:25265 // Start/Stop loading notifications.
266 // TODO(nasko): Those are page-level methods at this time and come from
267 // WebViewClient. We should move them to be WebFrameClient calls and put
268 // logic in the browser side to balance starts/stops.
[email protected]e3b10d12014-03-28 16:06:09269 // |to_different_document| will be true unless the load is a fragment
270 // navigation, or triggered by history.pushState/replaceState.
avi5c77d212015-09-25 20:08:25271 void didStartLoading(bool to_different_document) override;
272 void didStopLoading() override;
273 void didChangeLoadProgress(double load_progress) override;
[email protected]723971b2014-02-12 11:08:25274
[email protected]95640212014-07-26 18:14:30275 AccessibilityMode accessibility_mode() {
276 return accessibility_mode_;
277 }
278
279 RendererAccessibility* renderer_accessibility() {
280 return renderer_accessibility_;
281 }
282
283 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj,
284 blink::WebAXEvent event);
285
estade31c54342015-01-23 03:34:36286 // The focused node changed to |node|. If focus was lost from this frame,
287 // |node| will be null.
[email protected]95640212014-07-26 18:14:30288 void FocusedNodeChanged(const blink::WebNode& node);
289
estade31c54342015-01-23 03:34:36290 // TODO(dmazzoni): the only reason this is here is to plumb it through to
291 // RendererAccessibility. It should use the RenderFrameObserver method, once
292 // blink has a separate accessibility tree per frame.
293 void FocusedNodeChangedForAccessibility(const blink::WebNode& node);
294
lfge0c2792ec2016-05-11 18:52:08295 // Called when this frame's widget is focused.
296 void RenderWidgetSetFocus(bool enable);
297
298 // Called when the widget receives a mouse event.
299 void RenderWidgetWillHandleMouseEvent();
300
[email protected]7a4e2532013-12-02 21:30:02301#if defined(ENABLE_PLUGINS)
paulmeyer5d0a5f02016-01-21 20:15:52302 // Get/set the plugin which will be used to handle document find requests.
303 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) {
304 plugin_find_handler_ = plugin;
305 }
306 PepperPluginInstanceImpl* plugin_find_handler() {
307 return plugin_find_handler_;
308 }
309
[email protected]271ff5792013-12-04 22:29:31310 // Notification that a PPAPI plugin has been created.
311 void PepperPluginCreated(RendererPpapiHost* host);
312
[email protected]7a4e2532013-12-02 21:30:02313 // Notifies that |instance| has changed the cursor.
314 // This will update the cursor appearance if it is currently over the plugin
315 // instance.
316 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance,
317 const blink::WebCursorInfo& cursor);
318
319 // Notifies that |instance| has received a mouse event.
320 void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance);
321
[email protected]7a4e2532013-12-02 21:30:02322 // Informs the render view that a PPAPI plugin has changed text input status.
323 void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance);
324 void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance);
325
326 // Cancels current composition.
327 void PepperCancelComposition(PepperPluginInstanceImpl* instance);
328
329 // Informs the render view that a PPAPI plugin has changed selection.
330 void PepperSelectionChanged(PepperPluginInstanceImpl* instance);
331
332 // Creates a fullscreen container for a pepper plugin instance.
333 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
334 PepperPluginInstanceImpl* plugin);
335
[email protected]7a4e2532013-12-02 21:30:02336 bool IsPepperAcceptingCompositionEvents() const;
337
338 // Notification that the given plugin has crashed.
339 void PluginCrashed(const base::FilePath& plugin_path,
340 base::ProcessId plugin_pid);
341
[email protected]7a4e2532013-12-02 21:30:02342 // Simulates IME events for testing purpose.
343 void SimulateImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26344 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02345 const std::vector<blink::WebCompositionUnderline>& underlines,
346 int selection_start,
347 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26348 void SimulateImeConfirmComposition(const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02349 const gfx::Range& replacement_range);
350
351 // TODO(jam): remove these once the IPC handler moves from RenderView to
352 // RenderFrame.
353 void OnImeSetComposition(
tommyclie6633ca72014-10-31 00:40:42354 const base::string16& text,
355 const std::vector<blink::WebCompositionUnderline>& underlines,
356 int selection_start,
357 int selection_end);
358 void OnImeConfirmComposition(const base::string16& text,
359 const gfx::Range& replacement_range,
360 bool keep_selection);
361#endif // defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02362
[email protected]977db4a42014-07-17 08:04:32363 // May return NULL in some cases, especially if userMediaClient() returns
364 // NULL.
365 MediaStreamDispatcher* GetMediaStreamDispatcher();
366
avi485e5fd62014-08-25 23:26:14367#if defined(OS_MACOSX) || defined(OS_ANDROID)
368 void DidHideExternalPopupMenu();
369#endif
370
[email protected]227692c52013-05-31 22:43:04371 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52372 bool Send(IPC::Message* msg) override;
[email protected]227692c52013-05-31 22:43:04373
374 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52375 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]227692c52013-05-31 22:43:04376
[email protected]271ff5792013-12-04 22:29:31377 // RenderFrame implementation:
dcheng6d18e402014-10-21 12:32:52378 RenderView* GetRenderView() override;
379 int GetRoutingID() override;
380 blink::WebLocalFrame* GetWebFrame() override;
381 WebPreferences& GetWebkitPreferences() override;
382 int ShowContextMenu(ContextMenuClient* client,
383 const ContextMenuParams& params) override;
384 void CancelContextMenu(int request_id) override;
tommycli59bd86c2014-12-10 02:09:38385 blink::WebPlugin* CreatePlugin(
386 blink::WebFrame* frame,
387 const WebPluginInfo& info,
388 const blink::WebPluginParams& params,
dchengcedca5612016-04-09 01:40:15389 std::unique_ptr<PluginInstanceThrottler> throttler) override;
japhetb0bae9d82015-10-19 20:43:40390 void LoadURLExternally(const blink::WebURLRequest& request,
dcheng6d18e402014-10-21 12:32:52391 blink::WebNavigationPolicy policy) override;
392 void ExecuteJavaScript(const base::string16& javascript) override;
dglazkov2e140f52015-09-28 16:10:07393 bool IsMainFrame() override;
dcheng6d18e402014-10-21 12:32:52394 bool IsHidden() override;
395 ServiceRegistry* GetServiceRegistry() override;
tommyclid481c482014-12-03 01:50:41396#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:38397 void RegisterPeripheralPlugin(
tommycli58e3172c2015-09-15 18:18:26398 const url::Origin& content_origin,
tommycli59bd86c2014-12-10 02:09:38399 const base::Closure& unthrottle_callback) override;
tommycli9c7cbd92015-12-18 23:34:34400 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus(
401 const url::Origin& main_frame_origin,
402 const url::Origin& content_origin,
403 const gfx::Size& unobscured_size) const override;
tommyclibae63b92015-10-23 02:56:20404 void WhitelistContentOrigin(const url::Origin& content_origin) override;
tommyclid481c482014-12-03 01:50:41405#endif
dcheng6d18e402014-10-21 12:32:52406 bool IsFTPDirectoryListing() override;
407 void AttachGuest(int element_instance_id) override;
fsamuela95fef42014-12-03 20:16:52408 void DetachGuest(int element_instance_id) override;
dcheng6d18e402014-10-21 12:32:52409 void SetSelectedText(const base::string16& selection_text,
410 size_t offset,
411 const gfx::Range& range) override;
412 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate,
dcarney4410a7c92015-04-20 11:28:19413 v8::Local<v8::Context> context) override;
rdevlin.croninb2cec912015-06-24 20:36:01414 void AddMessageToConsole(ConsoleMessageLevel level,
415 const std::string& message) override;
megjablond5ac7d52015-10-22 23:56:12416 bool IsUsingLoFi() const override;
ellyjonesdb20fae12015-12-04 16:47:55417 bool IsPasting() const override;
[email protected]271ff5792013-12-04 22:29:31418
[email protected]96307312014-05-04 01:00:19419 // blink::WebFrameClient implementation:
avi5c77d212015-09-25 20:08:25420 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame,
421 const blink::WebPluginParams& params) override;
422 blink::WebMediaPlayer* createMediaPlayer(
guidou9bfe4e2f2016-04-09 08:31:19423 const blink::WebMediaPlayerSource& source,
srirama.m26f864d02015-07-14 05:21:46424 blink::WebMediaPlayerClient* client,
425 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client,
guidou9c3cc3e2015-10-27 13:38:15426 blink::WebContentDecryptionModule* initial_cdm,
davveadd785e72016-01-26 17:40:36427 const blink::WebString& sink_id,
428 blink::WebMediaSession* media_session) override;
davve50137b62015-10-23 12:15:21429 blink::WebMediaSession* createMediaSession() override;
avi5c77d212015-09-25 20:08:25430 blink::WebApplicationCacheHost* createApplicationCacheHost(
avi5c77d212015-09-25 20:08:25431 blink::WebApplicationCacheHostClient* client) override;
432 blink::WebWorkerContentSettingsClientProxy*
avi01681ef2016-02-16 17:53:57433 createWorkerContentSettingsClientProxy() override;
avi5c77d212015-09-25 20:08:25434 blink::WebExternalPopupMenu* createExternalPopupMenu(
[email protected]b20c3222014-08-22 00:50:22435 const blink::WebPopupMenuInfo& popup_menu_info,
avi5c77d212015-09-25 20:08:25436 blink::WebExternalPopupMenuClient* popup_menu_client) override;
avi5047cd572016-02-16 20:41:12437 blink::WebCookieJar* cookieJar() override;
skyostilb4cce1b2016-03-31 17:56:34438 blink::BlameContext* frameBlameContext() override;
avi01681ef2016-02-16 17:53:57439 blink::WebServiceWorkerProvider* createServiceWorkerProvider() override;
avi5047cd572016-02-16 20:41:12440 void didAccessInitialDocument() override;
avi5c77d212015-09-25 20:08:25441 blink::WebFrame* createChildFrame(
alexmose48b1df932015-01-16 01:34:17442 blink::WebLocalFrame* parent,
dcheng860817a2015-05-22 03:16:56443 blink::WebTreeScopeType scope,
444 const blink::WebString& name,
lukasza464d8692016-02-22 19:26:32445 const blink::WebString& unique_name,
446 blink::WebSandboxFlags sandbox_flags,
447 const blink::WebFrameOwnerProperties& frame_owner_properties) override;
avi5c77d212015-09-25 20:08:25448 void didChangeOpener(blink::WebFrame* frame) override;
449 void frameDetached(blink::WebFrame* frame, DetachType type) override;
450 void frameFocused() override;
451 void willClose(blink::WebFrame* frame) override;
lukasza464d8692016-02-22 19:26:32452 void didChangeName(const blink::WebString& name,
453 const blink::WebString& unique_name) override;
estarka886b8d2015-12-18 21:53:08454 void didEnforceStrictMixedContentChecking() override;
estarkbd8e26f2016-03-16 23:30:37455 void didUpdateToUniqueOrigin(
456 bool is_potentially_trustworthy_unique_origin) override;
avi5c77d212015-09-25 20:08:25457 void didChangeSandboxFlags(blink::WebFrame* child_frame,
458 blink::WebSandboxFlags flags) override;
lukasza8e1c02e42016-05-17 20:05:10459 void didAddContentSecurityPolicy(
460 const blink::WebString& header_value,
461 blink::WebContentSecurityPolicyType type,
462 blink::WebContentSecurityPolicySource source) override;
Avi Drissman09b359e52015-12-07 20:19:21463 void didChangeFrameOwnerProperties(
lazyboy70605c32015-11-03 01:27:31464 blink::WebFrame* child_frame,
465 const blink::WebFrameOwnerProperties& frame_owner_properties) override;
avi5c77d212015-09-25 20:08:25466 void didMatchCSS(
[email protected]35b2a972014-04-04 15:50:22467 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46468 const blink::WebVector<blink::WebString>& newly_matching_selectors,
avi5c77d212015-09-25 20:08:25469 const blink::WebVector<blink::WebString>& stopped_matching_selectors)
470 override;
471 bool shouldReportDetailedMessageForSource(
472 const blink::WebString& source) override;
473 void didAddMessageToConsole(const blink::WebConsoleMessage& message,
474 const blink::WebString& source_name,
475 unsigned source_line,
476 const blink::WebString& stack_trace) override;
japhetb0bae9d82015-10-19 20:43:40477 void loadURLExternally(const blink::WebURLRequest& request,
avi5c77d212015-09-25 20:08:25478 blink::WebNavigationPolicy policy,
japhetb0bae9d82015-10-19 20:43:40479 const blink::WebString& suggested_name,
480 bool should_replace_current_entry) override;
avi5c77d212015-09-25 20:08:25481 blink::WebNavigationPolicy decidePolicyForNavigation(
482 const NavigationPolicyInfo& info) override;
creise18ce072015-12-02 02:00:02483 blink::WebHistoryItem historyItemForNewChildFrame() override;
avi0fe3a6d2016-02-16 20:57:27484 void willSendSubmitEvent(const blink::WebFormElement& form) override;
485 void willSubmitForm(const blink::WebFormElement& form) override;
avi5c77d212015-09-25 20:08:25486 void didCreateDataSource(blink::WebLocalFrame* frame,
487 blink::WebDataSource* datasource) override;
488 void didStartProvisionalLoad(blink::WebLocalFrame* frame,
489 double triggering_event_time) override;
490 void didReceiveServerRedirectForProvisionalLoad(
491 blink::WebLocalFrame* frame) override;
492 void didFailProvisionalLoad(blink::WebLocalFrame* frame,
493 const blink::WebURLError& error,
494 blink::WebHistoryCommitType commit_type) override;
495 void didCommitProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22496 blink::WebLocalFrame* frame,
[email protected]680575542014-04-03 17:12:52497 const blink::WebHistoryItem& item,
avi5c77d212015-09-25 20:08:25498 blink::WebHistoryCommitType commit_type) override;
499 void didCreateNewDocument(blink::WebLocalFrame* frame) override;
500 void didClearWindowObject(blink::WebLocalFrame* frame) override;
501 void didCreateDocumentElement(blink::WebLocalFrame* frame) override;
rob43ea0642016-03-19 01:05:01502 void runScriptsAtDocumentElementAvailable(
503 blink::WebLocalFrame* frame) override;
avi5c77d212015-09-25 20:08:25504 void didReceiveTitle(blink::WebLocalFrame* frame,
505 const blink::WebString& title,
506 blink::WebTextDirection direction) override;
507 void didChangeIcon(blink::WebLocalFrame* frame,
508 blink::WebIconURL::Type icon_type) override;
rob2718dfc2016-03-25 20:58:27509 void didFinishDocumentLoad(blink::WebLocalFrame* frame) override;
510 void runScriptsAtDocumentReady(blink::WebLocalFrame* frame,
511 bool document_is_empty) override;
avi5c77d212015-09-25 20:08:25512 void didHandleOnloadEvents(blink::WebLocalFrame* frame) override;
513 void didFailLoad(blink::WebLocalFrame* frame,
514 const blink::WebURLError& error,
515 blink::WebHistoryCommitType commit_type) override;
516 void didFinishLoad(blink::WebLocalFrame* frame) override;
517 void didNavigateWithinPage(blink::WebLocalFrame* frame,
518 const blink::WebHistoryItem& item,
avi68a109ab2016-05-15 01:46:32519 blink::WebHistoryCommitType commit_type,
520 bool content_initiated) override;
avi1008732f2016-02-17 17:28:49521 void didUpdateCurrentHistoryItem() override;
avi5c77d212015-09-25 20:08:25522 void didChangeThemeColor() override;
523 void dispatchLoad() override;
tbansal7b6cf8b2016-05-10 19:27:23524 blink::WebEffectiveConnectionType getEffectiveConnectionType() override;
avi5c77d212015-09-25 20:08:25525 void requestNotificationPermission(
[email protected]4459599e2014-07-29 22:40:09526 const blink::WebSecurityOrigin& origin,
avi5c77d212015-09-25 20:08:25527 blink::WebNotificationPermissionCallback* callback) override;
528 void didChangeSelection(bool is_empty_selection) override;
529 blink::WebColorChooser* createColorChooser(
[email protected]eb8c216a2014-04-09 19:19:19530 blink::WebColorChooserClient* client,
[email protected]f3c59d62014-04-09 16:33:55531 const blink::WebColor& initial_color,
avi5c77d212015-09-25 20:08:25532 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override;
533 void runModalAlertDialog(const blink::WebString& message) override;
534 bool runModalConfirmDialog(const blink::WebString& message) override;
535 bool runModalPromptDialog(const blink::WebString& message,
536 const blink::WebString& default_value,
537 blink::WebString* actual_value) override;
avi141dbc1322016-03-11 22:27:42538 bool runModalBeforeUnloadDialog(bool is_reload) override;
avi5c77d212015-09-25 20:08:25539 void showContextMenu(const blink::WebContextMenuData& data) override;
avi5c77d212015-09-25 20:08:25540 void willSendRequest(blink::WebLocalFrame* frame,
541 unsigned identifier,
542 blink::WebURLRequest& request,
543 const blink::WebURLResponse& redirect_response) override;
avi1008732f2016-02-17 17:28:49544 void didReceiveResponse(unsigned identifier,
avi5c77d212015-09-25 20:08:25545 const blink::WebURLResponse& response) override;
546 void didLoadResourceFromMemoryCache(
[email protected]180ef242013-11-07 06:50:46547 const blink::WebURLRequest& request,
avi5c77d212015-09-25 20:08:25548 const blink::WebURLResponse& response) override;
549 void didDisplayInsecureContent() override;
550 void didRunInsecureContent(const blink::WebSecurityOrigin& origin,
551 const blink::WebURL& target) override;
estark910b4572015-12-09 20:55:41552 void didDisplayContentWithCertificateErrors(
553 const blink::WebURL& url,
estarkaeda1422016-05-10 02:31:12554 const blink::WebCString& security_info) override;
estark910b4572015-12-09 20:55:41555 void didRunContentWithCertificateErrors(
556 const blink::WebURL& url,
estarkaeda1422016-05-10 02:31:12557 const blink::WebCString& security_info) override;
avi5c77d212015-09-25 20:08:25558 void didChangePerformanceTiming() override;
csharrisonae811ab2016-04-11 11:32:25559 void didObserveLoadingBehavior(
560 blink::WebLoadingBehaviorFlag behavior) override;
avi5c77d212015-09-25 20:08:25561 void didCreateScriptContext(blink::WebLocalFrame* frame,
562 v8::Local<v8::Context> context,
563 int extension_group,
564 int world_id) override;
565 void willReleaseScriptContext(blink::WebLocalFrame* frame,
566 v8::Local<v8::Context> context,
567 int world_id) override;
568 void didChangeScrollOffset(blink::WebLocalFrame* frame) override;
569 void willInsertBody(blink::WebLocalFrame* frame) override;
570 void reportFindInPageMatchCount(int request_id,
571 int count,
572 bool final_update) override;
573 void reportFindInPageSelection(int request_id,
574 int active_match_ordinal,
575 const blink::WebRect& sel) override;
avif0d894852016-02-17 17:49:12576 void requestStorageQuota(blink::WebStorageQuotaType type,
avi5c77d212015-09-25 20:08:25577 unsigned long long requested_size,
578 blink::WebStorageQuotaCallbacks callbacks) override;
579 void willOpenWebSocket(blink::WebSocketHandle* handle) override;
avi5c77d212015-09-25 20:08:25580 blink::WebPushClient* pushClient() override;
581 blink::WebPresentationClient* presentationClient() override;
582 void willStartUsingPeerConnectionHandler(
avi5c77d212015-09-25 20:08:25583 blink::WebRTCPeerConnectionHandler* handler) override;
584 blink::WebUserMediaClient* userMediaClient() override;
585 blink::WebEncryptedMediaClient* encryptedMediaClient() override;
586 blink::WebMIDIClient* webMIDIClient() override;
avif0d894852016-02-17 17:49:12587 blink::WebString userAgentOverride() override;
588 blink::WebString doNotTrackValue() override;
589 bool allowWebGL(bool default_value) override;
avi5c77d212015-09-25 20:08:25590 blink::WebScreenOrientationClient* webScreenOrientationClient() override;
591 bool isControlledByServiceWorker(blink::WebDataSource& data_source) override;
592 int64_t serviceWorkerID(blink::WebDataSource& data_source) override;
593 void postAccessibilityEvent(const blink::WebAXObject& obj,
594 blink::WebAXEvent event) override;
595 void handleAccessibilityFindInPageResult(
596 int identifier,
597 int match_index,
598 const blink::WebAXObject& start_object,
599 int start_offset,
600 const blink::WebAXObject& end_object,
601 int end_offset) override;
avi1008732f2016-02-17 17:28:49602 void didChangeManifest() override;
avi5c77d212015-09-25 20:08:25603 bool enterFullscreen() override;
604 bool exitFullscreen() override;
605 blink::WebPermissionClient* permissionClient() override;
606 blink::WebAppBannerClient* appBannerClient() override;
607 void registerProtocolHandler(const blink::WebString& scheme,
608 const blink::WebURL& url,
609 const blink::WebString& title) override;
610 void unregisterProtocolHandler(const blink::WebString& scheme,
611 const blink::WebURL& url) override;
612 blink::WebBluetooth* bluetooth() override;
guidou3906a722015-11-12 22:14:42613 void checkIfAudioSinkExistsAndIsAuthorized(
614 const blink::WebString& sink_id,
615 const blink::WebSecurityOrigin& security_origin,
616 blink::WebSetSinkIdCallbacks* web_callbacks) override;
sammcbebeb602016-04-06 06:42:55617 blink::ServiceRegistry* serviceRegistry() override;
[email protected]85d85fd2013-06-19 00:57:41618
lukasza902fcc52015-12-31 04:45:29619 // WebFrameSerializerClient implementation:
lukasza2e296c32015-09-28 23:29:48620 void didSerializeDataForFrame(
lukasza2e296c32015-09-28 23:29:48621 const blink::WebCString& data,
lukasza902fcc52015-12-31 04:45:29622 blink::WebFrameSerializerClient::FrameSerializationStatus status)
623 override;
lukasza2e296c32015-09-28 23:29:48624
rockotf8fdd9b2015-12-16 22:22:35625 // Binds this render frame's service registry.
rockotb00e6462016-04-14 02:24:03626 void BindServiceRegistry(shell::mojom::InterfaceProviderRequest services,
627 shell::mojom::InterfaceProviderPtr exposed_services);
rockotf8fdd9b2015-12-16 22:22:35628
mlamouri4fff1992014-09-30 11:22:46629 ManifestManager* manifest_manager();
630
avi0392dbf52015-03-25 16:55:45631 // TODO(creis): Remove when the only caller, the HistoryController, is no
632 // more.
633 void SetPendingNavigationParams(
dchengcedca5612016-04-09 01:40:15634 std::unique_ptr<NavigationParams> navigation_params);
avi0392dbf52015-03-25 16:55:45635
xhwang5206d4e62016-02-05 02:09:55636 media::MediaPermission* GetMediaPermission();
guoweisf4282b02015-09-24 23:05:22637
creis69b184a472015-11-26 05:29:51638 // Sends the current frame's navigation state to the browser.
639 void SendUpdateState();
640
sammce2f99982016-03-14 22:38:12641 // Creates a MojoBindingsController if Mojo bindings have been enabled for
642 // this frame. For WebUI, this allows the page to communicate with the browser
643 // process; for layout tests, this allows the test to mock out services at
644 // the Mojo IPC layer.
645 void MaybeEnableMojoBindings();
nasko1fa0fb62015-12-09 01:49:57646
lfge0c2792ec2016-05-11 18:52:08647 // Plugin-related functions --------------------------------------------------
648
649#if defined(ENABLE_PLUGINS)
650 PepperPluginInstanceImpl* focused_pepper_plugin() {
651 return focused_pepper_plugin_;
652 }
653 PepperPluginInstanceImpl* pepper_last_mouse_event_target() {
654 return pepper_last_mouse_event_target_;
655 }
656 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) {
657 pepper_last_mouse_event_target_ = plugin;
658 }
659
660 // Indicates that the given instance has been created.
661 void PepperInstanceCreated(PepperPluginInstanceImpl* instance);
662
663 // Indicates that the given instance is being destroyed. This is called from
664 // the destructor, so it's important that the instance is not dereferenced
665 // from this call.
666 void PepperInstanceDeleted(PepperPluginInstanceImpl* instance);
667
668 // Notification that the given plugin is focused or unfocused.
669 void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused);
670#endif // ENABLE_PLUGINS
671
[email protected]2f61bdd2013-07-02 18:38:47672 protected:
jochen664198b2015-06-25 14:13:00673 explicit RenderFrameImpl(const CreateParams& params);
[email protected]2f61bdd2013-07-02 18:38:47674
[email protected]227692c52013-05-31 22:43:04675 private:
kenrbf98a4d22015-04-01 21:59:35676 friend class RenderFrameImplTest;
[email protected]2e2d9632013-12-03 00:55:26677 friend class RenderFrameObserver;
[email protected]95640212014-07-26 18:14:30678 friend class RendererAccessibilityTest;
clamy98a9dee02015-06-24 16:09:10679 friend class TestRenderFrame;
avi485e5fd62014-08-25 23:26:14680 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem);
681 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
682 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
683 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
[email protected]66bbadaf2014-03-28 16:25:54684 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest,
685 AccessibilityMessagesQueueWhileSwappedOut);
[email protected]2e2d9632013-12-03 00:55:26686
twellington376424ad2015-05-04 18:57:25687 // A wrapper class used as the callback for JavaScript executed
688 // in an isolated world.
689 class JavaScriptIsolatedWorldRequest
690 : public blink::WebScriptExecutionCallback {
691 public:
692 JavaScriptIsolatedWorldRequest(
693 int id,
694 bool notify_result,
695 int routing_id,
696 base::WeakPtr<RenderFrameImpl> render_frame_impl);
697 void completed(
698 const blink::WebVector<v8::Local<v8::Value>>& result) override;
699
700 private:
avi5c77d212015-09-25 20:08:25701 ~JavaScriptIsolatedWorldRequest() override;
twellington376424ad2015-05-04 18:57:25702
703 int id_;
704 bool notify_result_;
705 int routing_id_;
706 base::WeakPtr<RenderFrameImpl> render_frame_impl_;
707
708 DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest);
709 };
710
[email protected]37567b432014-02-12 01:12:22711 typedef std::map<GURL, double> HostZoomLevels;
712
dchengc5ef1a52015-08-26 20:58:30713 // Creates a new RenderFrame. |render_view| is the RenderView object that this
714 // frame belongs to.
ddorwinf63505e2016-01-08 00:54:50715 // Callers *must* call |BindToWebFrame| immediately after creation.
avi1023d012015-12-25 02:39:14716 static RenderFrameImpl* Create(RenderViewImpl* render_view,
717 int32_t routing_id);
dchengc5ef1a52015-08-26 20:58:30718
ddorwinf63505e2016-01-08 00:54:50719 // This is called right after creation with the WebLocalFrame for this
720 // RenderFrame. It must be called before Initialize.
721 void BindToWebFrame(blink::WebLocalFrame* web_frame);
722
[email protected]2e2d9632013-12-03 00:55:26723 // Functions to add and remove observers for this object.
724 void AddObserver(RenderFrameObserver* observer);
725 void RemoveObserver(RenderFrameObserver* observer);
[email protected]1c2052f2013-08-28 08:24:34726
dcheng3d886b732015-11-05 19:16:01727 bool IsLocalRoot() const;
728
[email protected]f0906a02014-08-07 07:18:55729 // Builds and sends DidCommitProvisionalLoad to the host.
avi8c46f7e2015-02-03 18:27:35730 void SendDidCommitProvisionalLoad(blink::WebFrame* frame,
creis8b5cd4c2015-06-19 00:11:08731 blink::WebHistoryCommitType commit_type,
732 const blink::WebHistoryItem& item);
[email protected]37567b432014-02-12 01:12:22733
[email protected]b70da4c2014-01-06 19:57:09734 // IPC message handlers ------------------------------------------------------
735 //
736 // The documentation for these functions should be in
737 // content/common/*_messages.h for the message that the function is handling.
clamy98a9dee02015-06-24 16:09:10738 void OnNavigate(const CommonNavigationParams& common_params,
739 const StartNavigationParams& start_params,
740 const RequestNavigationParams& request_params);
clamybfd6a812016-05-30 16:25:17741 void OnBeforeUnload(bool is_reload);
alexmosbc7eafa2014-12-06 01:38:09742 void OnSwapOut(int proxy_routing_id,
nasko3e8c20e2014-12-18 06:54:56743 bool is_loading,
alexmosbc7eafa2014-12-06 01:38:09744 const FrameReplicationState& replicated_frame_state);
naskoeab5c5582015-12-15 05:20:00745 void OnDeleteFrame();
Nasko Oskov85f60222014-08-28 22:53:30746 void OnStop();
[email protected]a09d53ce2014-01-31 00:46:42747 void OnShowContextMenu(const gfx::Point& location);
748 void OnContextMenuClosed(const CustomContextMenuContext& custom_context);
749 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context,
750 unsigned action);
[email protected]4ee64622014-03-21 22:34:15751 void OnUndo();
752 void OnRedo();
[email protected]9c9343b2014-03-08 02:56:07753 void OnCut();
754 void OnCopy();
755 void OnPaste();
[email protected]4ee64622014-03-21 22:34:15756 void OnPasteAndMatchStyle();
757 void OnDelete();
758 void OnSelectAll();
christiankaeed9862014-11-05 10:49:14759 void OnSelectRange(const gfx::Point& base, const gfx::Point& extent);
aurimasab0319022015-07-10 21:57:38760 void OnAdjustSelectionByCharacterOffset(int start_adjust, int end_adjust);
[email protected]4ee64622014-03-21 22:34:15761 void OnUnselect();
christiankaeed9862014-11-05 10:49:14762 void OnMoveRangeSelectionExtent(const gfx::Point& point);
[email protected]1f3fc1d2014-04-03 14:50:17763 void OnReplace(const base::string16& text);
764 void OnReplaceMisspelling(const base::string16& text);
[email protected]e31b8ebb2014-03-07 17:59:34765 void OnCSSInsertRequest(const std::string& css);
peter4eb242002015-06-02 12:45:13766 void OnAddMessageToConsole(ConsoleMessageLevel level,
767 const std::string& message);
[email protected]f13ab892014-03-12 06:48:52768 void OnJavaScriptExecuteRequest(const base::string16& javascript,
769 int id,
770 bool notify_result);
zeeshanq3454e9c2014-09-04 21:30:28771 void OnJavaScriptExecuteRequestForTests(const base::string16& javascript,
772 int id,
jochen2e7d95b2015-05-04 15:28:50773 bool notify_result,
774 bool has_user_gesture);
twellington376424ad2015-05-04 18:57:25775 void OnJavaScriptExecuteRequestInIsolatedWorld(const base::string16& jscript,
776 int id,
777 bool notify_result,
778 int world_id);
avi1023d012015-12-25 02:39:14779 void OnVisualStateRequest(uint64_t key);
[email protected]4ee64622014-03-21 22:34:15780 void OnSetEditableSelectionOffsets(int start, int end);
[email protected]e5e438d62014-03-27 21:47:16781 void OnSetCompositionFromExistingText(
782 int start, int end,
783 const std::vector<blink::WebCompositionUnderline>& underlines);
sammcbc9e99332014-12-18 00:55:24784 void OnExecuteNoValueEditCommand(const std::string& name);
[email protected]e5e438d62014-03-27 21:47:16785 void OnExtendSelectionAndDelete(int before, int after);
toyoshim24a4c7ab2016-04-05 09:24:14786 void OnReload(bool bypass_cache);
megjablon3f5941072016-02-04 23:27:52787 void OnReloadLoFiImages();
jam973236102016-02-09 00:47:05788 void OnTextSurroundingSelectionRequest(uint32_t max_length);
[email protected]95640212014-07-26 18:14:30789 void OnSetAccessibilityMode(AccessibilityMode new_mode);
dmazzoni83ba5c82015-04-14 07:11:51790 void OnSnapshotAccessibilityTree(int callback_id);
alexmos95733002015-08-24 16:38:09791 void OnUpdateOpener(int opener_routing_id);
dcheng5f60abb2015-05-28 01:39:36792 void OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags);
lazyboy70605c32015-11-03 01:27:31793 void OnSetFrameOwnerProperties(
794 const blink::WebFrameOwnerProperties& frame_owner_properties);
alexmos401f0aba2015-12-06 10:07:39795 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id);
alexmos5357efb2015-12-16 21:44:00796 void OnSetFocusedFrame();
dspelle736c9db2015-04-03 04:53:16797 void OnTextTrackSettingsChanged(
798 const FrameMsg_TextTrackSettings_Params& params);
alexmose7da5a12015-04-09 02:22:16799 void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params);
davidbena5496d62014-10-07 18:52:04800 void OnCommitNavigation(const ResourceResponseHead& response,
801 const GURL& stream_url,
clamy9bfeef42014-09-30 20:50:42802 const CommonNavigationParams& common_params,
lukaszad04640f2016-05-25 17:08:44803 const RequestNavigationParams& request_params);
clamy62b271d2015-04-16 11:54:57804 void OnFailedNavigation(const CommonNavigationParams& common_params,
805 const RequestNavigationParams& request_params,
806 bool has_stale_copy_in_cache,
807 int error_code);
lukasza6af746b72015-09-18 23:37:22808 void OnGetSavableResourceLinks();
lukasza2e296c32015-09-28 23:29:48809 void OnGetSerializedHtmlWithLocalLinks(
lukasza777a7dd2016-01-25 23:55:47810 const std::map<GURL, base::FilePath>& url_to_local_path,
811 const std::map<int, base::FilePath>& frame_routing_id_to_local_path);
lukaszaede9cc02015-12-30 23:48:32812 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params);
paulmeyer5d0a5f02016-01-21 20:15:52813 void OnFind(int request_id,
814 const base::string16& search_text,
815 const blink::WebFindOptions& options);
816 void OnStopFinding(StopFindAction action);
clamy91b7abf2016-03-24 15:17:45817 void OnEnableViewSourceMode();
avi6b8dbb32016-04-08 18:59:35818 void OnSuppressFurtherDialogs();
paulmeyer5d0a5f02016-01-21 20:15:52819#if defined(OS_ANDROID)
820 void OnActivateNearestFindResult(int request_id, float x, float y);
821 void OnFindMatchRects(int current_version);
822 void OnSelectPopupMenuItems(bool canceled,
823 const std::vector<int>& selected_indices);
824#elif defined(OS_MACOSX)
825 void OnSelectPopupMenuItem(int selected_index);
826 void OnCopyToFindPboard();
827#endif
clamy9bfeef42014-09-30 20:50:42828
creise18ce072015-12-02 02:00:02829 // Requests that the browser process navigates to |url|. If
830 // |is_history_navigation_in_new_child| is true, the browser process should
831 // look for a matching FrameNavigationEntry in the last committed entry to use
832 // instead of |url|.
japhetb0bae9d82015-10-19 20:43:40833 void OpenURL(const GURL& url,
[email protected]65920f332014-03-04 21:14:18834 const Referrer& referrer,
japhetb0bae9d82015-10-19 20:43:40835 blink::WebNavigationPolicy policy,
creise18ce072015-12-02 02:00:02836 bool should_replace_current_entry,
837 bool is_history_navigation_in_new_child);
[email protected]a09d53ce2014-01-31 00:46:42838
clamyd6983032015-04-29 14:48:12839 // Performs a navigation in the frame. This provides a unified function for
840 // the current code path and the browser-side navigation path (in
841 // development). Currently used by OnNavigate, with all *NavigationParams
842 // provided by the browser. |stream_params| should be null.
843 // PlzNavigate: used by OnCommitNavigation, with |common_params| and
844 // |request_params| received by the browser. |stream_params| should be non
845 // null and created from the information provided by the browser.
846 // |start_params| is not used.
dchengcedca5612016-04-09 01:40:15847 void NavigateInternal(
848 const CommonNavigationParams& common_params,
849 const StartNavigationParams& start_params,
850 const RequestNavigationParams& request_params,
lukaszad04640f2016-05-25 17:08:44851 std::unique_ptr<StreamOverrideParameters> stream_params);
clamyd6983032015-04-29 14:48:12852
[email protected]ef3adfc2014-05-11 00:04:54853 // Update current main frame's encoding and send it to browser window.
854 // Since we want to let users see the right encoding info from menu
855 // before finishing loading, we call the UpdateEncoding in
856 // a) function:DidCommitLoadForFrame. When this function is called,
857 // that means we have got first data. In here we try to get encoding
858 // of page if it has been specified in http header.
859 // b) function:DidReceiveTitle. When this function is called,
860 // that means we have got specified title. Because in most of webpages,
861 // title tags will follow meta tags. In here we try to get encoding of
862 // page if it has been specified in meta tag.
863 // c) function:DidFinishDocumentLoadForFrame. When this function is
864 // called, that means we have got whole html page. In here we should
865 // finally get right encoding of page.
866 void UpdateEncoding(blink::WebFrame* frame,
867 const std::string& encoding_name);
868
[email protected]4ee64622014-03-21 22:34:15869 // Dispatches the current state of selection on the webpage to the browser if
870 // it has changed.
871 // TODO(varunjain): delete this method once we figure out how to keep
872 // selection handles in sync with the webpage.
873 void SyncSelectionIfRequired();
874
[email protected]87de04b02014-04-08 22:14:49875 bool RunJavaScriptMessage(JavaScriptMessageType type,
876 const base::string16& message,
877 const base::string16& default_value,
878 const GURL& frame_url,
879 base::string16* result);
880
[email protected]457736d2014-04-30 15:54:27881 // Loads the appropriate error page for the specified failure into the frame.
882 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request,
883 const blink::WebURLError& error,
884 bool replace);
885
zeeshanq3454e9c2014-09-04 21:30:28886 void HandleJavascriptExecutionResult(const base::string16& javascript,
887 int id,
888 bool notify_result,
deepak.s750d68f2015-04-30 07:32:41889 v8::Local<v8::Value> result);
zeeshanq3454e9c2014-09-04 21:30:28890
[email protected]977db4a42014-07-17 08:04:32891 // Initializes |web_user_media_client_|. If this fails, because it wasn't
892 // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then
893 // |web_user_media_client_| will remain NULL.
894 void InitializeUserMediaClient();
[email protected]96307312014-05-04 01:00:19895
896 blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream(
guidou9c3cc3e2015-10-27 13:38:15897 blink::WebMediaPlayerClient* client,
898 const blink::WebString& sink_id,
899 const blink::WebSecurityOrigin& security_origin);
[email protected]96307312014-05-04 01:00:19900
[email protected]ae2477e2014-05-27 23:47:08901 // Creates a factory object used for creating audio and video renderers.
dchengcedca5612016-04-09 01:40:15902 std::unique_ptr<MediaStreamRendererFactory> CreateRendererFactory();
[email protected]ae2477e2014-05-27 23:47:08903
avi5cad4912015-06-19 05:25:44904 // Does preparation for the navigation to |url|.
905 void PrepareRenderViewForNavigation(
clamyda97e8322014-10-07 21:57:25906 const GURL& url,
toyoshimf3f7f682016-04-08 07:47:48907 const RequestNavigationParams& request_params);
clamyda97e8322014-10-07 21:57:25908
clamyece38882014-11-19 15:00:20909 // PlzNavigate
910 // Sends a FrameHostMsg_BeginNavigation to the browser based on the contents
911 // of the WebURLRequest.
clamyd3edf862016-02-01 12:39:28912 // |should_replace_current_entry| indicates that the current history entry
913 // will be replaced when the navigation commits. |is_client_redirect|
914 // indicates that the navigation originated as a client redirect.
915 // Note: those two concepts are separate. For example, a location.assign is a
916 // client redirect but it only replaces the current entry if called before
917 // load stop. location.replace on the other hand is a client redirect and
918 // always replaces the current entry.
919 void BeginNavigation(blink::WebURLRequest* request,
920 bool should_replace_current_entry,
921 bool is_client_redirect);
clamyece38882014-11-19 15:00:20922
clamy4cc9b8202015-03-02 13:51:36923 // Loads a data url.
924 void LoadDataURL(const CommonNavigationParams& params,
mnaganovbf087422015-12-16 05:10:03925 const RequestNavigationParams& request_params,
clamy0f4ccc82016-02-24 12:43:53926 blink::WebLocalFrame* frame,
927 blink::WebFrameLoadType load_type,
928 blink::WebHistoryItem item_for_history_navigation,
929 blink::WebHistoryLoadType history_load_type,
930 bool is_client_redirect);
clamy4cc9b8202015-03-02 13:51:36931
clamy62b271d2015-04-16 11:54:57932 // Sends a proper FrameHostMsg_DidFailProvisionalLoadWithError_Params IPC for
933 // the failed request |request|.
934 void SendFailedProvisionalLoad(const blink::WebURLRequest& request,
935 const blink::WebURLError& error,
936 blink::WebLocalFrame* frame);
937
938 bool ShouldDisplayErrorPageForFailedLoad(int error_code,
939 const GURL& unreachable_url);
940
[email protected]f3a95312014-06-12 16:46:58941 // Returns the URL being loaded by the |frame_|'s request.
942 GURL GetLoadingUrl() const;
943
avi0392dbf52015-03-25 16:55:45944 // If we initiated a navigation, this function will populate |document_state|
945 // with the navigation information saved in OnNavigate().
946 void PopulateDocumentStateFromPending(DocumentState* document_state);
947
948 // Returns a new NavigationState populated with the navigation information
949 // saved in OnNavigate().
950 NavigationState* CreateNavigationStateFromPending();
951
csharrison1ce0e852015-11-07 16:45:13952 // Sets the NavigationState on the DocumentState based on
953 // the value of |pending_navigation_params_|.
boliuac512fd2016-03-16 23:33:35954 void UpdateNavigationState(DocumentState* document_state,
avi68a109ab2016-05-15 01:46:32955 bool was_within_same_page,
956 bool content_initiated);
csharrison1ce0e852015-11-07 16:45:13957
[email protected]96307312014-05-04 01:00:19958#if defined(OS_ANDROID)
[email protected]65f3d1aa2014-05-29 01:57:00959 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer(
jrummell65b7d272014-09-24 20:49:27960 blink::WebMediaPlayerClient* client,
srirama.m26f864d02015-07-14 05:21:46961 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client,
dalecurtis49f363882015-08-25 21:05:38962 const media::WebMediaPlayerParams& params);
[email protected]a017938b2014-05-27 21:17:17963
[email protected]65f3d1aa2014-05-29 01:57:00964 RendererMediaPlayerManager* GetMediaPlayerManager();
davve859f4f92015-11-27 10:16:19965
966 RendererMediaSessionManager* GetMediaSessionManager();
[email protected]4b556cf2014-06-10 23:21:53967#endif
968
sandersd02d9aea2015-05-12 02:29:26969 bool AreSecureCodecsSupported();
xhwang33f939e2015-06-23 04:33:42970
xhwange70b7ee12015-06-25 09:17:17971#if defined(ENABLE_MOJO_MEDIA)
rockotb00e6462016-04-14 02:24:03972 shell::mojom::InterfaceProvider* GetMediaInterfaceProvider();
xhwang33f939e2015-06-23 04:33:42973#endif
974
xhwangd7180832015-04-03 05:38:15975 media::CdmFactory* GetCdmFactory();
xhwang409e53552016-02-23 00:52:44976 media::DecoderFactory* GetDecoderFactory();
[email protected]96307312014-05-04 01:00:19977
halton.huoca2eabd2015-07-06 08:17:40978 void RegisterMojoServices();
979
xhwang6bca21e2016-02-06 00:21:45980 // Connect to an interface provided by the service registry.
981 template <typename Interface>
bene3bc9022016-02-10 17:38:24982 void GetInterface(mojo::InterfaceRequest<Interface> request);
xhwang6bca21e2016-02-06 00:21:45983
rockotd9260982015-08-21 22:26:30984 // Connects to a Mojo application and returns a proxy to its exposed
985 // ServiceProvider.
rockotb00e6462016-04-14 02:24:03986 shell::mojom::InterfaceProviderPtr ConnectToApplication(const GURL& url);
rockotd9260982015-08-21 22:26:30987
dalecurtisa12e6062015-11-10 23:13:14988 // Returns the media delegate for WebMediaPlayer usage. If
989 // |media_player_delegate_| is NULL, one is created.
990 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate();
991
paulmeyer5d0a5f02016-01-21 20:15:52992 // Called to get the WebPlugin to handle find requests in the document.
993 // Returns nullptr if there is no such WebPlugin.
994 blink::WebPlugin* GetWebPluginForFind();
995
996 // Sends a reply to the current find operation handling if it was a
997 // synchronous find request.
998 void SendFindReply(int request_id,
999 int match_count,
1000 int ordinal,
1001 const blink::WebRect& selection_rect,
1002 bool final_status_update);
1003
skyostilb4cce1b2016-03-31 17:56:341004 void InitializeBlameContext(RenderFrameImpl* parent_frame);
1005
creiscfaa4462015-03-16 19:27:181006 // Stores the WebLocalFrame we are associated with. This is null from the
ddorwinf63505e2016-01-08 00:54:501007 // constructor until BindToWebFrame is called, and it is null after
creiscfaa4462015-03-16 19:27:181008 // frameDetached is called until destruction (which is asynchronous in the
1009 // case of the main frame, but not subframes).
[email protected]35b2a972014-04-04 15:50:221010 blink::WebLocalFrame* frame_;
[email protected]b70da4c2014-01-06 19:57:091011
dglazkov2e140f52015-09-28 16:10:071012 // Boolean value indicating whether this RenderFrameImpl object is for the
1013 // main frame or not. It remains accurate during destruction, even when
1014 // |frame_| has been invalidated.
1015 bool is_main_frame_;
nasko8b9d9bd2015-05-06 19:23:191016
naskoeab5c5582015-12-15 05:20:001017 // When a frame is detached in response to a message from the browser process,
1018 // this RenderFrame should not be sending notifications back to it. This
1019 // boolean is used to indicate this case.
1020 bool in_browser_initiated_detach_;
1021
1022 // Indicates whether the frame has been inserted into the frame tree yet or
1023 // not.
1024 //
1025 // When a frame is created by the browser process, it is for a pending
1026 // navigation. In this case, it is not immediately attached to the frame tree
1027 // if there is a RenderFrameProxy for the same frame. It is inserted into the
1028 // frame tree at the time the pending navigation commits.
1029 // Frames added by the parent document are created from the renderer process
1030 // and are immediately inserted in the frame tree.
1031 // TODO(dcheng): Remove this once we have FrameTreeHandle and can use the
1032 // Blink Web* layer to check for provisional frames.
1033 bool in_frame_tree_;
1034
[email protected]abc501e2014-01-27 19:27:261035 base::WeakPtr<RenderViewImpl> render_view_;
[email protected]227692c52013-05-31 22:43:041036 int routing_id_;
nasko8b9d9bd2015-05-06 19:23:191037
[email protected]1c2052f2013-08-28 08:24:341038 bool is_detaching_;
[email protected]227692c52013-05-31 22:43:041039
japhete6adf142014-10-31 00:01:491040 // If this frame was created to replace a proxy, this will store the routing
1041 // id of the proxy to replace at commit-time, at which time it will be
1042 // cleared.
1043 // TODO(creis): Remove this after switching to PlzNavigate.
1044 int proxy_routing_id_;
1045
dcheng3d886b732015-11-05 19:16:011046 // Non-null when the RenderFrame is a local root for compositing, input,
1047 // layout, etc. A local frame is also a local root iff it does not have a
1048 // parent that is a local frame.
kenrba7199832015-01-22 23:44:591049 scoped_refptr<RenderWidget> render_widget_;
1050
avi0392dbf52015-03-25 16:55:451051 // Temporarily holds state pertaining to a navigation that has been initiated
1052 // until the NavigationState corresponding to the new navigation is created in
1053 // didCreateDataSource().
dchengcedca5612016-04-09 01:40:151054 std::unique_ptr<NavigationParams> pending_navigation_params_;
avi0392dbf52015-03-25 16:55:451055
creis8eb8ef22015-11-04 22:51:381056 // Stores the current history item for this frame, so that updates to it can
1057 // be reported to the browser process via SendUpdateState.
1058 blink::WebHistoryItem current_history_item_;
1059
[email protected]7a4e2532013-12-02 21:30:021060#if defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:021061 // Current text input composition text. Empty if no composition is in
1062 // progress.
[email protected]fcf75d42013-12-03 20:11:261063 base::string16 pepper_composition_text_;
tommyclieb25b2a2014-11-03 19:45:091064
tommycli59bd86c2014-12-10 02:09:381065 PluginPowerSaverHelper* plugin_power_saver_helper_;
paulmeyer5d0a5f02016-01-21 20:15:521066
1067 PepperPluginInstanceImpl* plugin_find_handler_;
[email protected]7a4e2532013-12-02 21:30:021068#endif
1069
[email protected]f3add922013-12-20 23:17:161070 RendererWebCookieJarImpl cookie_jar_;
1071
[email protected]2e2d9632013-12-03 00:55:261072 // All the registered observers.
brettw236d3172015-06-03 16:31:431073 base::ObserverList<RenderFrameObserver> observers_;
[email protected]2e2d9632013-12-03 00:55:261074
[email protected]bffc8302014-01-23 20:52:161075 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
1076
[email protected]a09d53ce2014-01-31 00:46:421077 // External context menu requests we're waiting for. "Internal"
1078 // (WebKit-originated) context menu events will have an ID of 0 and will not
1079 // be in this map.
1080 //
1081 // We don't want to add internal ones since some of the "special" page
1082 // handlers in the browser process just ignore the context menu requests so
1083 // avoid showing context menus, and so this will cause right clicks to leak
1084 // entries in this map. Most users of the custom context menu (e.g. Pepper
1085 // plugins) are normally only on "regular" pages and the regular pages will
1086 // always respond properly to the request, so we don't have to worry so
1087 // much about leaks.
1088 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_;
1089
[email protected]4ee64622014-03-21 22:34:151090 // The text selection the last time DidChangeSelection got called. May contain
1091 // additional characters before and after the selected text, for IMEs. The
1092 // portion of this string that is the actual selected text starts at index
1093 // |selection_range_.GetMin() - selection_text_offset_| and has length
1094 // |selection_range_.length()|.
1095 base::string16 selection_text_;
1096 // The offset corresponding to the start of |selection_text_| in the document.
1097 size_t selection_text_offset_;
1098 // Range over the document corresponding to the actual selected text (which
1099 // could correspond to a substring of |selection_text_|; see above).
1100 gfx::Range selection_range_;
1101 // Used to inform didChangeSelection() when it is called in the context
1102 // of handling a InputMsg_SelectRange IPC.
1103 bool handling_select_range_;
1104
[email protected]2626d142014-04-22 17:24:021105 // The next group of objects all implement RenderFrameObserver, so are deleted
1106 // along with the RenderFrame automatically. This is why we just store weak
1107 // references.
1108
[email protected]4459599e2014-07-29 22:40:091109 // Dispatches permission requests for Web Notifications.
1110 NotificationPermissionDispatcher* notification_permission_dispatcher_;
1111
[email protected]977db4a42014-07-17 08:04:321112 // Destroyed via the RenderFrameObserver::OnDestruct() mechanism.
perkj1a2d0432014-09-03 13:52:331113 UserMediaClientImpl* web_user_media_client_;
[email protected]96307312014-05-04 01:00:191114
jrummell109c3a602014-12-18 01:08:501115 // EncryptedMediaClient attached to this frame; lazily initialized.
dchengcedca5612016-04-09 01:40:151116 std::unique_ptr<media::WebEncryptedMediaClientImpl>
1117 web_encrypted_media_client_;
jrummell109c3a602014-12-18 01:08:501118
xhwang6bca21e2016-02-06 00:21:451119 // The media permission dispatcher attached to this frame.
dchengcedca5612016-04-09 01:40:151120 std::unique_ptr<MediaPermissionDispatcher> media_permission_dispatcher_;
xhwang36b1f3b2015-01-27 17:54:011121
xhwange70b7ee12015-06-25 09:17:171122#if defined(ENABLE_MOJO_MEDIA)
xhwanga5967e552016-02-26 00:54:081123 // The media interface provider attached to this frame, lazily initialized.
dchengcedca5612016-04-09 01:40:151124 std::unique_ptr<MediaInterfaceProvider> media_interface_provider_;
xhwang065b54b2015-06-03 22:25:551125#endif
1126
[email protected]52d3e172014-06-16 16:57:021127 // MidiClient attached to this frame; lazily initialized.
1128 MidiDispatcher* midi_dispatcher_;
1129
[email protected]a017938b2014-05-27 21:17:171130#if defined(OS_ANDROID)
davve859f4f92015-11-27 10:16:191131 // Manages all media players and sessions in this render frame for
1132 // communicating with the real media player and sessions in the
1133 // browser process. It's okay to use raw pointers since they're both
1134 // RenderFrameObservers.
[email protected]a017938b2014-05-27 21:17:171135 RendererMediaPlayerManager* media_player_manager_;
davve859f4f92015-11-27 10:16:191136 RendererMediaSessionManager* media_session_manager_;
[email protected]4b556cf2014-06-10 23:21:531137#endif
1138
watkdee516f2016-02-18 02:22:191139 media::SurfaceManager* media_surface_manager_;
1140
[email protected]4b556cf2014-06-10 23:21:531141#if defined(ENABLE_BROWSER_CDMS)
1142 // Manage all CDMs in this render frame for communicating with the real CDM in
1143 // the browser process. It's okay to use a raw pointer since it's a
1144 // RenderFrameObserver.
[email protected]65f3d1aa2014-05-29 01:57:001145 RendererCdmManager* cdm_manager_;
[email protected]a017938b2014-05-27 21:17:171146#endif
1147
xhwang409e53552016-02-23 00:52:441148 // The CDM and decoder factory attached to this frame, lazily initialized.
dchengcedca5612016-04-09 01:40:151149 std::unique_ptr<media::CdmFactory> cdm_factory_;
1150 std::unique_ptr<media::DecoderFactory> decoder_factory_;
xhwangd7180832015-04-03 05:38:151151
hubbe5f0ad43b2015-12-14 20:57:261152 // Media resource cache, lazily initialized.
1153 linked_ptr<media::UrlIndex> url_index_;
1154
[email protected]a6e21c372014-07-12 02:27:211155#if defined(VIDEO_HOLE)
1156 // Whether or not this RenderFrameImpl contains a media player. Used to
1157 // register as an observer for video-hole-specific events.
1158 bool contains_media_player_;
1159#endif
1160
dgozman358ba322015-03-26 15:05:301161 // The devtools agent for this frame; only created for main frame and
1162 // local roots.
1163 DevToolsAgent* devtools_agent_;
1164
[email protected]45920862014-07-02 12:53:021165 // The push messaging dispatcher attached to this frame, lazily initialized.
1166 PushMessagingDispatcher* push_messaging_dispatcher_;
1167
avayvodbca35fad2015-01-29 20:20:571168 // The presentation dispatcher implementation attached to this frame, lazily
1169 // initialized.
1170 PresentationDispatcher* presentation_dispatcher_;
1171
rockotf8fdd9b2015-12-16 22:22:351172 ServiceRegistryImpl service_registry_;
sammcbebeb602016-04-06 06:42:551173 BlinkServiceRegistryImpl blink_service_registry_;
[email protected]c52a1412014-06-25 06:09:251174
rockotd9260982015-08-21 22:26:301175 // The shell proxy used to connect to Mojo applications.
rockotb00e6462016-04-14 02:24:031176 shell::mojom::ConnectorPtr connector_;
rockotd9260982015-08-21 22:26:301177
[email protected]45920862014-07-02 12:53:021178 // The screen orientation dispatcher attached to the frame, lazily
1179 // initialized.
[email protected]cf78eda2014-06-13 16:57:411180 ScreenOrientationDispatcher* screen_orientation_dispatcher_;
1181
mlamouriefdca9d2014-09-16 16:55:401182 // The Manifest Manager handles the manifest requests from the browser
1183 // process.
1184 ManifestManager* manifest_manager_;
1185
[email protected]95640212014-07-26 18:14:301186 // The current accessibility mode.
1187 AccessibilityMode accessibility_mode_;
1188
1189 // Only valid if |accessibility_mode_| is anything other than
1190 // AccessibilityModeOff.
1191 RendererAccessibility* renderer_accessibility_;
1192
dchengcedca5612016-04-09 01:40:151193 std::unique_ptr<PermissionDispatcher> permission_client_;
mlamouri670a86d2015-03-17 16:06:251194
dchengcedca5612016-04-09 01:40:151195 std::unique_ptr<blink::WebAppBannerClient> app_banner_client_;
benwells04ab5b962015-05-06 08:29:401196
dchengcedca5612016-04-09 01:40:151197 std::unique_ptr<blink::WebBluetooth> bluetooth_;
jyasskinf89a11b2015-07-21 00:27:481198
dalecurtisa12e6062015-11-10 23:13:141199 // Manages play, pause notifications for WebMediaPlayer implementations; its
1200 // lifetime is tied to the RenderFrame via the RenderFrameObserver interface.
1201 media::RendererWebMediaPlayerDelegate* media_player_delegate_;
1202
megjablond5ac7d52015-10-22 23:56:121203 // Whether or not this RenderFrame is using Lo-Fi mode.
1204 bool is_using_lofi_;
1205
tbansal7b6cf8b2016-05-10 19:27:231206 // Effective connection type when the document of this frame was fetched.
1207 blink::WebEffectiveConnectionType effective_connection_type_;
1208
ellyjonesdb20fae12015-12-04 16:47:551209 // Whether or not this RenderFrame is currently pasting.
1210 bool is_pasting_;
1211
avi6b8dbb32016-04-08 18:59:351212 // Whether we must stop creating nested message loops for modal dialogs. This
1213 // is necessary because modal dialogs have a ScopedPageLoadDeferrer on the
1214 // stack that interferes with swapping out.
1215 bool suppress_further_dialogs_;
1216
avi485e5fd62014-08-25 23:26:141217#if defined(OS_MACOSX) || defined(OS_ANDROID)
1218 // The external popup for the currently showing select popup.
dchengcedca5612016-04-09 01:40:151219 std::unique_ptr<ExternalPopupMenu> external_popup_menu_;
avi485e5fd62014-08-25 23:26:141220#endif
1221
skyostilaebd9e42016-04-22 14:43:291222 FrameBlameContext* blame_context_; // Not owned.
skyostilb4cce1b2016-03-31 17:56:341223
lfge0c2792ec2016-05-11 18:52:081224 // Plugins -------------------------------------------------------------------
1225#if defined(ENABLE_PLUGINS)
1226 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet;
1227 PepperPluginSet active_pepper_instances_;
1228
1229 // Whether or not the focus is on a PPAPI plugin
1230 PepperPluginInstanceImpl* focused_pepper_plugin_;
1231
1232 // The plugin instance that received the last mouse event. It is set to NULL
1233 // if the last mouse event went to elements other than Pepper plugins.
1234 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on
1235 // the RenderFrameImpl to NULL it out when it destructs.
1236 PepperPluginInstanceImpl* pepper_last_mouse_event_target_;
1237#endif
1238
[email protected]96307312014-05-04 01:00:191239 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
1240
[email protected]227692c52013-05-31 22:43:041241 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
1242};
1243
1244} // namespace content
1245
[email protected]85d85fd2013-06-19 00:57:411246#endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_