blob: 33b8427eaaf772edf0eff9248052948d58397b84 [file] [log] [blame]
[email protected]227692c52013-05-31 22:43:041// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6#define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7
[email protected]7a4e2532013-12-02 21:30:028#include <vector>
9
[email protected]227692c52013-05-31 22:43:0410#include "base/basictypes.h"
[email protected]7a4e2532013-12-02 21:30:0211#include "base/files/file_path.h"
[email protected]a09d53ce2014-01-31 00:46:4212#include "base/gtest_prod_util.h"
13#include "base/id_map.h"
xhwang430baee2015-01-22 05:46:2014#include "base/memory/scoped_ptr.h"
[email protected]abc501e2014-01-27 19:27:2615#include "base/memory/weak_ptr.h"
[email protected]2e2d9632013-12-03 00:55:2616#include "base/observer_list.h"
[email protected]7a4e2532013-12-02 21:30:0217#include "base/process/process_handle.h"
[email protected]95640212014-07-26 18:14:3018#include "content/common/accessibility_mode_enums.h"
clamyda97e8322014-10-07 21:57:2519#include "content/common/frame_message_enums.h"
[email protected]c52a1412014-06-25 06:09:2520#include "content/common/mojo/service_registry_impl.h"
[email protected]87de04b02014-04-08 22:14:4921#include "content/public/common/javascript_message_type.h"
[email protected]65920f332014-03-04 21:14:1822#include "content/public/common/referrer.h"
[email protected]227692c52013-05-31 22:43:0423#include "content/public/renderer/render_frame.h"
[email protected]5a7100d2014-05-19 01:29:0424#include "content/renderer/render_frame_proxy.h"
[email protected]f3add922013-12-20 23:17:1625#include "content/renderer/renderer_webcookiejar_impl.h"
[email protected]227692c52013-05-31 22:43:0426#include "ipc/ipc_message.h"
acolwell9e0840d2014-09-06 19:01:3227#include "media/blink/webmediaplayer_delegate.h"
[email protected]95640212014-07-26 18:14:3028#include "third_party/WebKit/public/web/WebAXObject.h"
[email protected]85d85fd2013-06-19 00:57:4129#include "third_party/WebKit/public/web/WebDataSource.h"
30#include "third_party/WebKit/public/web/WebFrameClient.h"
[email protected]680575542014-04-03 17:12:5231#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
zhenwd47fd722014-11-13 00:43:4732#include "third_party/WebKit/public/web/WebTransitionElementData.h"
[email protected]4ee64622014-03-21 22:34:1533#include "ui/gfx/range/range.h"
[email protected]227692c52013-05-31 22:43:0434
tommyclid481c482014-12-03 01:50:4135#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:3836#include "content/renderer/pepper/plugin_power_saver_helper.h"
tommyclid481c482014-12-03 01:50:4137#endif
38
[email protected]a017938b2014-05-27 21:17:1739#if defined(OS_ANDROID)
40#include "content/renderer/media/android/renderer_media_player_manager.h"
41#endif
42
clamy9bfeef42014-09-30 20:50:4243class GURL;
[email protected]7a4e2532013-12-02 21:30:0244class TransportDIB;
zhenw70986bd2014-10-20 18:50:2645struct FrameHostMsg_AddNavigationTransitionData_Params;
[email protected]c6bc20332014-02-28 18:30:3946struct FrameMsg_Navigate_Params;
kenrba7199832015-01-22 23:44:5947struct FrameMsg_NewFrame_WidgetParams;
clamy79b3da62014-10-14 08:50:3748struct FrameMsg_RequestNavigation_Params;
[email protected]7a4e2532013-12-02 21:30:0249
50namespace blink {
[email protected]5ee7f182014-04-25 19:45:2651class WebGeolocationClient;
[email protected]7a4e2532013-12-02 21:30:0252class WebMouseEvent;
[email protected]82ce5b92014-03-22 05:15:2653class WebContentDecryptionModule;
[email protected]96307312014-05-04 01:00:1954class WebMediaPlayer;
avayvodbca35fad2015-01-29 20:20:5755class WebPresentationClient;
[email protected]45920862014-07-02 12:53:0256class WebPushClient;
[email protected]82ce5b92014-03-22 05:15:2657class WebSecurityOrigin;
[email protected]7a4e2532013-12-02 21:30:0258struct WebCompositionUnderline;
[email protected]a09d53ce2014-01-31 00:46:4259struct WebContextMenuData;
[email protected]7a4e2532013-12-02 21:30:0260struct WebCursorInfo;
zhenwd47fd722014-11-13 00:43:4761struct WebTransitionElementData;
[email protected]7a4e2532013-12-02 21:30:0262}
63
64namespace gfx {
[email protected]a09d53ce2014-01-31 00:46:4265class Point;
[email protected]7a4e2532013-12-02 21:30:0266class Range;
67class Rect;
68}
69
jrummell109c3a602014-12-18 01:08:5070namespace media {
xhwang60b430a2015-02-01 05:20:4671class MediaPermission;
jrummell109c3a602014-12-18 01:08:5072class WebEncryptedMediaClientImpl;
73}
74
[email protected]227692c52013-05-31 22:43:0475namespace content {
76
[email protected]bffc8302014-01-23 20:52:1677class ChildFrameCompositingHelper;
kenrba7199832015-01-22 23:44:5978class CompositorDependencies;
avi485e5fd62014-08-25 23:26:1479class ExternalPopupMenu;
[email protected]8eae0802014-06-02 21:35:5580class GeolocationDispatcher;
mlamouriefdca9d2014-09-16 16:55:4081class ManifestManager;
[email protected]977db4a42014-07-17 08:04:3282class MediaStreamDispatcher;
[email protected]ae2477e2014-05-27 23:47:0883class MediaStreamRendererFactory;
xhwang36b1f3b2015-01-27 17:54:0184class MediaPermissionDispatcher;
[email protected]52d3e172014-06-16 16:57:0285class MidiDispatcher;
[email protected]4459599e2014-07-29 22:40:0986class NotificationPermissionDispatcher;
clamyda97e8322014-10-07 21:57:2587class PageState;
[email protected]7a4e2532013-12-02 21:30:0288class PepperPluginInstanceImpl;
avayvodbca35fad2015-01-29 20:20:5789class PresentationDispatcher;
[email protected]45920862014-07-02 12:53:0290class PushMessagingDispatcher;
[email protected]95640212014-07-26 18:14:3091class RendererAccessibility;
[email protected]4b556cf2014-06-10 23:21:5392class RendererCdmManager;
93class RendererMediaPlayerManager;
[email protected]7a4e2532013-12-02 21:30:0294class RendererPpapiHost;
[email protected]2e2d9632013-12-03 00:55:2695class RenderFrameObserver;
[email protected]227692c52013-05-31 22:43:0496class RenderViewImpl;
[email protected]7a4e2532013-12-02 21:30:0297class RenderWidget;
98class RenderWidgetFullscreenPepper;
[email protected]cf78eda2014-06-13 16:57:4199class ScreenOrientationDispatcher;
perkj1a2d0432014-09-03 13:52:33100class UserMediaClientImpl;
alexmose48b1df932015-01-16 01:34:17101enum class SandboxFlags;
clamy9bfeef42014-09-30 20:50:42102struct CommitNavigationParams;
103struct CommonNavigationParams;
[email protected]a09d53ce2014-01-31 00:46:42104struct CustomContextMenuContext;
alexmosbc7eafa2014-12-06 01:38:09105struct FrameReplicationState;
clamycbe86a0c2015-03-05 17:40:02106struct HistoryNavigationParams;
clamy79b3da62014-10-14 08:50:37107struct RequestNavigationParams;
davidbena5496d62014-10-07 18:52:04108struct ResourceResponseHead;
[email protected]227692c52013-05-31 22:43:04109
[email protected]85d85fd2013-06-19 00:57:41110class CONTENT_EXPORT RenderFrameImpl
111 : public RenderFrame,
[email protected]96307312014-05-04 01:00:19112 NON_EXPORTED_BASE(public blink::WebFrameClient),
acolwell9e0840d2014-09-06 19:01:32113 NON_EXPORTED_BASE(public media::WebMediaPlayerDelegate) {
[email protected]227692c52013-05-31 22:43:04114 public:
[email protected]2f61bdd2013-07-02 18:38:47115 // Creates a new RenderFrame. |render_view| is the RenderView object that this
116 // frame belongs to.
[email protected]b70da4c2014-01-06 19:57:09117 // Callers *must* call |SetWebFrame| immediately after creation.
[email protected]82307f6b2014-08-07 03:30:12118 // Note: This is called only when RenderFrame is created by Blink through
119 // createChildFrame.
[email protected]b70da4c2014-01-06 19:57:09120 // TODO(creis): We should structure this so that |SetWebFrame| isn't needed.
[email protected]2f61bdd2013-07-02 18:38:47121 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id);
122
[email protected]82307f6b2014-08-07 03:30:12123 // Creates a new RenderFrame with |routing_id| as a child of the RenderFrame
124 // identified by |parent_routing_id| or as the top-level frame if the latter
japhete6adf142014-10-31 00:01:49125 // is MSG_ROUTING_NONE. If |proxy_routing_id| is MSG_ROUTING_NONE, it creates
126 // the Blink WebLocalFrame and inserts it in the proper place in the frame
127 // tree. Otherwise, the frame is semi-orphaned until it commits, at which
128 // point it replaces the proxy identified by |proxy_routing_id|.
[email protected]82307f6b2014-08-07 03:30:12129 // Note: This is called only when RenderFrame is being created in response to
130 // IPC message from the browser process. All other frame creation is driven
131 // through Blink and Create.
japhete6adf142014-10-31 00:01:49132 static void CreateFrame(int routing_id,
133 int parent_routing_id,
alexmose48b1df932015-01-16 01:34:17134 int proxy_routing_id,
kenrba7199832015-01-22 23:44:59135 const FrameReplicationState& replicated_state,
136 CompositorDependencies* compositor_deps,
137 const FrameMsg_NewFrame_WidgetParams& params);
[email protected]82307f6b2014-08-07 03:30:12138
[email protected]5a7100d2014-05-19 01:29:04139 // Returns the RenderFrameImpl for the given routing ID.
140 static RenderFrameImpl* FromRoutingID(int routing_id);
141
[email protected]a5ac6dc2014-01-15 07:02:14142 // Just like RenderFrame::FromWebFrame but returns the implementation.
143 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:09144
[email protected]2f61bdd2013-07-02 18:38:47145 // Used by content_layouttest_support to hook into the creation of
146 // RenderFrameImpls.
dongseong.hwangb721ddf2014-12-10 21:22:50147 using CreateRenderFrameImplFunction = RenderFrameImpl* (*)(RenderViewImpl*,
148 int32);
[email protected]2f61bdd2013-07-02 18:38:47149 static void InstallCreateHook(
dongseong.hwangb721ddf2014-12-10 21:22:50150 CreateRenderFrameImplFunction create_render_frame_impl);
[email protected]2f61bdd2013-07-02 18:38:47151
alexmose48b1df932015-01-16 01:34:17152 static content::SandboxFlags WebToContentSandboxFlags(
153 blink::WebSandboxFlags flags);
154
155 static blink::WebSandboxFlags ContentToWebSandboxFlags(
156 content::SandboxFlags flags);
157
[email protected]227692c52013-05-31 22:43:04158 virtual ~RenderFrameImpl();
159
[email protected]b70da4c2014-01-06 19:57:09160 bool is_swapped_out() const {
161 return is_swapped_out_;
162 }
163
[email protected]5a7100d2014-05-19 01:29:04164 // TODO(nasko): This can be removed once we don't have a swapped out state on
165 // RenderFrames. See https://crbug.com/357747.
166 void set_render_frame_proxy(RenderFrameProxy* proxy) {
167 render_frame_proxy_ = proxy;
168 }
169
[email protected]bffc8302014-01-23 20:52:16170 // Out-of-process child frames receive a signal from RenderWidgetCompositor
171 // when a compositor frame has committed.
172 void DidCommitCompositorFrame();
173
[email protected]7a4e2532013-12-02 21:30:02174 // TODO(jam): this is a temporary getter until all the code is transitioned
175 // to using RenderFrame instead of RenderView.
[email protected]abc501e2014-01-27 19:27:26176 RenderViewImpl* render_view() { return render_view_.get(); }
[email protected]7a4e2532013-12-02 21:30:02177
[email protected]f3add922013-12-20 23:17:16178 RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; }
179
[email protected]7a4e2532013-12-02 21:30:02180 // Returns the RenderWidget associated with this frame.
181 RenderWidget* GetRenderWidget();
182
[email protected]35b2a972014-04-04 15:50:22183 // This is called right after creation with the WebLocalFrame for this
[email protected]0287e762014-04-11 13:07:58184 // RenderFrame. It must be called before Initialize.
[email protected]35b2a972014-04-04 15:50:22185 void SetWebFrame(blink::WebLocalFrame* web_frame);
[email protected]b70da4c2014-01-06 19:57:09186
[email protected]0287e762014-04-11 13:07:58187 // This method must be called after the frame has been added to the frame
188 // tree. It creates all objects that depend on the frame being at its proper
189 // spot.
190 void Initialize();
191
[email protected]de3c5d82014-05-28 22:12:59192 // Notifications from RenderWidget.
193 void WasHidden();
194 void WasShown();
195
[email protected]723971b2014-02-12 11:08:25196 // Start/Stop loading notifications.
197 // TODO(nasko): Those are page-level methods at this time and come from
198 // WebViewClient. We should move them to be WebFrameClient calls and put
199 // logic in the browser side to balance starts/stops.
[email protected]e3b10d12014-03-28 16:06:09200 // |to_different_document| will be true unless the load is a fragment
201 // navigation, or triggered by history.pushState/replaceState.
[email protected]6dd5c322014-03-12 07:58:46202 virtual void didStartLoading(bool to_different_document);
203 virtual void didStopLoading();
204 virtual void didChangeLoadProgress(double load_progress);
[email protected]723971b2014-02-12 11:08:25205
[email protected]95640212014-07-26 18:14:30206 AccessibilityMode accessibility_mode() {
207 return accessibility_mode_;
208 }
209
210 RendererAccessibility* renderer_accessibility() {
211 return renderer_accessibility_;
212 }
213
214 void HandleWebAccessibilityEvent(const blink::WebAXObject& obj,
215 blink::WebAXEvent event);
216
estade31c54342015-01-23 03:34:36217 // The focused node changed to |node|. If focus was lost from this frame,
218 // |node| will be null.
[email protected]95640212014-07-26 18:14:30219 void FocusedNodeChanged(const blink::WebNode& node);
220
estade31c54342015-01-23 03:34:36221 // TODO(dmazzoni): the only reason this is here is to plumb it through to
222 // RendererAccessibility. It should use the RenderFrameObserver method, once
223 // blink has a separate accessibility tree per frame.
224 void FocusedNodeChangedForAccessibility(const blink::WebNode& node);
225
[email protected]7a4e2532013-12-02 21:30:02226#if defined(ENABLE_PLUGINS)
[email protected]271ff5792013-12-04 22:29:31227 // Notification that a PPAPI plugin has been created.
228 void PepperPluginCreated(RendererPpapiHost* host);
229
[email protected]7a4e2532013-12-02 21:30:02230 // Notifies that |instance| has changed the cursor.
231 // This will update the cursor appearance if it is currently over the plugin
232 // instance.
233 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance,
234 const blink::WebCursorInfo& cursor);
235
236 // Notifies that |instance| has received a mouse event.
237 void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance);
238
[email protected]7a4e2532013-12-02 21:30:02239 // Informs the render view that a PPAPI plugin has changed text input status.
240 void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance);
241 void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance);
242
243 // Cancels current composition.
244 void PepperCancelComposition(PepperPluginInstanceImpl* instance);
245
246 // Informs the render view that a PPAPI plugin has changed selection.
247 void PepperSelectionChanged(PepperPluginInstanceImpl* instance);
248
249 // Creates a fullscreen container for a pepper plugin instance.
250 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
251 PepperPluginInstanceImpl* plugin);
252
[email protected]7a4e2532013-12-02 21:30:02253 bool IsPepperAcceptingCompositionEvents() const;
254
255 // Notification that the given plugin has crashed.
256 void PluginCrashed(const base::FilePath& plugin_path,
257 base::ProcessId plugin_pid);
258
[email protected]7a4e2532013-12-02 21:30:02259 // Simulates IME events for testing purpose.
260 void SimulateImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26261 const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02262 const std::vector<blink::WebCompositionUnderline>& underlines,
263 int selection_start,
264 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26265 void SimulateImeConfirmComposition(const base::string16& text,
[email protected]7a4e2532013-12-02 21:30:02266 const gfx::Range& replacement_range);
267
268 // TODO(jam): remove these once the IPC handler moves from RenderView to
269 // RenderFrame.
270 void OnImeSetComposition(
tommyclie6633ca72014-10-31 00:40:42271 const base::string16& text,
272 const std::vector<blink::WebCompositionUnderline>& underlines,
273 int selection_start,
274 int selection_end);
275 void OnImeConfirmComposition(const base::string16& text,
276 const gfx::Range& replacement_range,
277 bool keep_selection);
278#endif // defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02279
[email protected]977db4a42014-07-17 08:04:32280 // May return NULL in some cases, especially if userMediaClient() returns
281 // NULL.
282 MediaStreamDispatcher* GetMediaStreamDispatcher();
283
avi485e5fd62014-08-25 23:26:14284#if defined(OS_MACOSX) || defined(OS_ANDROID)
285 void DidHideExternalPopupMenu();
286#endif
287
[email protected]227692c52013-05-31 22:43:04288 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52289 bool Send(IPC::Message* msg) override;
[email protected]227692c52013-05-31 22:43:04290
291 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52292 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]227692c52013-05-31 22:43:04293
[email protected]271ff5792013-12-04 22:29:31294 // RenderFrame implementation:
dcheng6d18e402014-10-21 12:32:52295 RenderView* GetRenderView() override;
296 int GetRoutingID() override;
297 blink::WebLocalFrame* GetWebFrame() override;
estade78d655f82015-01-30 01:55:08298 blink::WebElement GetFocusedElement() const override;
dcheng6d18e402014-10-21 12:32:52299 WebPreferences& GetWebkitPreferences() override;
300 int ShowContextMenu(ContextMenuClient* client,
301 const ContextMenuParams& params) override;
302 void CancelContextMenu(int request_id) override;
303 blink::WebNode GetContextMenuNode() const override;
tommycli59bd86c2014-12-10 02:09:38304 blink::WebPlugin* CreatePlugin(
305 blink::WebFrame* frame,
306 const WebPluginInfo& info,
307 const blink::WebPluginParams& params,
tommyclie8722702015-01-16 11:40:41308 scoped_ptr<PluginInstanceThrottler> throttler) override;
dcheng6d18e402014-10-21 12:32:52309 void LoadURLExternally(blink::WebLocalFrame* frame,
310 const blink::WebURLRequest& request,
311 blink::WebNavigationPolicy policy) override;
312 void ExecuteJavaScript(const base::string16& javascript) override;
313 bool IsHidden() override;
314 ServiceRegistry* GetServiceRegistry() override;
tommyclid481c482014-12-03 01:50:41315#if defined(ENABLE_PLUGINS)
tommycli59bd86c2014-12-10 02:09:38316 void RegisterPeripheralPlugin(
317 const GURL& content_origin,
318 const base::Closure& unthrottle_callback) override;
tommyclid7798e12015-02-09 21:08:56319 PluginPowerSaverHelper* plugin_power_saver_helper() {
320 return plugin_power_saver_helper_;
321 }
tommyclid481c482014-12-03 01:50:41322#endif
dcheng6d18e402014-10-21 12:32:52323 bool IsFTPDirectoryListing() override;
324 void AttachGuest(int element_instance_id) override;
fsamuela95fef42014-12-03 20:16:52325 void DetachGuest(int element_instance_id) override;
dcheng6d18e402014-10-21 12:32:52326 void SetSelectedText(const base::string16& selection_text,
327 size_t offset,
328 const gfx::Range& range) override;
329 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate,
330 v8::Handle<v8::Context> context) override;
[email protected]271ff5792013-12-04 22:29:31331
[email protected]96307312014-05-04 01:00:19332 // blink::WebFrameClient implementation:
jbroman73e9f7962014-10-30 00:43:45333 blink::WebPluginPlaceholder* createPluginPlaceholder(
334 blink::WebLocalFrame*,
335 const blink::WebPluginParams&) override;
[email protected]35b2a972014-04-04 15:50:22336 virtual blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame,
337 const blink::WebPluginParams& params);
jrummell65b7d272014-09-24 20:49:27338 // TODO(jrummell): Remove this method once blink updated.
[email protected]180ef242013-11-07 06:50:46339 virtual blink::WebMediaPlayer* createMediaPlayer(
[email protected]35b2a972014-04-04 15:50:22340 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46341 const blink::WebURL& url,
342 blink::WebMediaPlayerClient* client);
jrummell65b7d272014-09-24 20:49:27343 virtual blink::WebMediaPlayer* createMediaPlayer(
344 blink::WebLocalFrame* frame,
345 const blink::WebURL& url,
346 blink::WebMediaPlayerClient* client,
347 blink::WebContentDecryptionModule* initial_cdm);
[email protected]180ef242013-11-07 06:50:46348 virtual blink::WebApplicationCacheHost* createApplicationCacheHost(
[email protected]35b2a972014-04-04 15:50:22349 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46350 blink::WebApplicationCacheHostClient* client);
351 virtual blink::WebWorkerPermissionClientProxy*
[email protected]35b2a972014-04-04 15:50:22352 createWorkerPermissionClientProxy(blink::WebLocalFrame* frame);
[email protected]b20c3222014-08-22 00:50:22353 virtual blink::WebExternalPopupMenu* createExternalPopupMenu(
354 const blink::WebPopupMenuInfo& popup_menu_info,
355 blink::WebExternalPopupMenuClient* popup_menu_client);
[email protected]35b2a972014-04-04 15:50:22356 virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame);
[email protected]180ef242013-11-07 06:50:46357 virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider(
[email protected]35b2a972014-04-04 15:50:22358 blink::WebLocalFrame* frame);
359 virtual void didAccessInitialDocument(blink::WebLocalFrame* frame);
alexmose48b1df932015-01-16 01:34:17360 virtual blink::WebFrame* createChildFrame(
361 blink::WebLocalFrame* parent,
362 const blink::WebString& name,
363 blink::WebSandboxFlags sandboxFlags);
[email protected]35b2a972014-04-04 15:50:22364 virtual void didDisownOpener(blink::WebLocalFrame* frame);
[email protected]180ef242013-11-07 06:50:46365 virtual void frameDetached(blink::WebFrame* frame);
[email protected]9c9343b2014-03-08 02:56:07366 virtual void frameFocused();
[email protected]180ef242013-11-07 06:50:46367 virtual void willClose(blink::WebFrame* frame);
[email protected]35b2a972014-04-04 15:50:22368 virtual void didChangeName(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46369 const blink::WebString& name);
alexmos6b294562015-03-05 19:24:10370 virtual void didChangeSandboxFlags(blink::WebFrame* child_frame,
371 blink::WebSandboxFlags flags);
[email protected]f5b6dd1122013-10-04 02:42:50372 virtual void didMatchCSS(
[email protected]35b2a972014-04-04 15:50:22373 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46374 const blink::WebVector<blink::WebString>& newly_matching_selectors,
375 const blink::WebVector<blink::WebString>& stopped_matching_selectors);
[email protected]c31a84802014-04-03 15:55:49376 virtual bool shouldReportDetailedMessageForSource(
377 const blink::WebString& source);
378 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message,
379 const blink::WebString& source_name,
380 unsigned source_line,
381 const blink::WebString& stack_trace);
[email protected]35b2a972014-04-04 15:50:22382 virtual void loadURLExternally(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46383 const blink::WebURLRequest& request,
[email protected]35b2a972014-04-04 15:50:22384 blink::WebNavigationPolicy policy,
385 const blink::WebString& suggested_name);
[email protected]1a4e9752013-12-31 20:10:58386 // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass.
[email protected]180ef242013-11-07 06:50:46387 virtual blink::WebNavigationPolicy decidePolicyForNavigation(
[email protected]0c3c54f2014-07-31 01:29:00388 const NavigationPolicyInfo& info);
[email protected]680575542014-04-03 17:12:52389 virtual blink::WebHistoryItem historyItemForNewChildFrame(
390 blink::WebFrame* frame);
[email protected]35b2a972014-04-04 15:50:22391 virtual void willSendSubmitEvent(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46392 const blink::WebFormElement& form);
[email protected]35b2a972014-04-04 15:50:22393 virtual void willSubmitForm(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46394 const blink::WebFormElement& form);
[email protected]35b2a972014-04-04 15:50:22395 virtual void didCreateDataSource(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46396 blink::WebDataSource* datasource);
[email protected]0c3c54f2014-07-31 01:29:00397 virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame,
japhet69a06302014-12-12 19:37:14398 bool is_transition_navigation,
399 double triggering_event_time);
[email protected]85d85fd2013-06-19 00:57:41400 virtual void didReceiveServerRedirectForProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22401 blink::WebLocalFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41402 virtual void didFailProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22403 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46404 const blink::WebURLError& error);
[email protected]680575542014-04-03 17:12:52405 virtual void didCommitProvisionalLoad(
[email protected]45d877f2014-04-05 07:36:22406 blink::WebLocalFrame* frame,
[email protected]680575542014-04-03 17:12:52407 const blink::WebHistoryItem& item,
408 blink::WebHistoryCommitType commit_type);
rob5ef11ff2014-11-17 23:56:20409 virtual void didCreateNewDocument(blink::WebLocalFrame* frame);
[email protected]06181e52014-05-10 11:59:09410 virtual void didClearWindowObject(blink::WebLocalFrame* frame);
[email protected]35b2a972014-04-04 15:50:22411 virtual void didCreateDocumentElement(blink::WebLocalFrame* frame);
412 virtual void didReceiveTitle(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46413 const blink::WebString& title,
414 blink::WebTextDirection direction);
[email protected]35b2a972014-04-04 15:50:22415 virtual void didChangeIcon(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46416 blink::WebIconURL::Type icon_type);
[email protected]35b2a972014-04-04 15:50:22417 virtual void didFinishDocumentLoad(blink::WebLocalFrame* frame);
418 virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame);
419 virtual void didFailLoad(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46420 const blink::WebURLError& error);
[email protected]45d877f2014-04-05 07:36:22421 virtual void didFinishLoad(blink::WebLocalFrame* frame);
422 virtual void didNavigateWithinPage(blink::WebLocalFrame* frame,
[email protected]680575542014-04-03 17:12:52423 const blink::WebHistoryItem& item,
424 blink::WebHistoryCommitType commit_type);
[email protected]35b2a972014-04-04 15:50:22425 virtual void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame);
[email protected]9e6bea412014-08-08 06:35:25426 virtual void addNavigationTransitionData(
zhenwd47fd722014-11-13 00:43:47427 const blink::WebTransitionElementData& data);
[email protected]37b64c52014-07-11 21:14:05428 virtual void didChangeThemeColor();
alexmosf40ce5b02015-02-25 20:19:56429 virtual void dispatchLoad();
[email protected]4459599e2014-07-29 22:40:09430 virtual void requestNotificationPermission(
431 const blink::WebSecurityOrigin& origin,
432 blink::WebNotificationPermissionCallback* callback);
[email protected]c3f2c702014-03-19 23:39:48433 virtual void didChangeSelection(bool is_empty_selection);
[email protected]f3c59d62014-04-09 16:33:55434 virtual blink::WebColorChooser* createColorChooser(
[email protected]eb8c216a2014-04-09 19:19:19435 blink::WebColorChooserClient* client,
[email protected]f3c59d62014-04-09 16:33:55436 const blink::WebColor& initial_color,
437 const blink::WebVector<blink::WebColorSuggestion>& suggestions);
[email protected]87de04b02014-04-08 22:14:49438 virtual void runModalAlertDialog(const blink::WebString& message);
439 virtual bool runModalConfirmDialog(const blink::WebString& message);
440 virtual bool runModalPromptDialog(const blink::WebString& message,
441 const blink::WebString& default_value,
442 blink::WebString* actual_value);
443 virtual bool runModalBeforeUnloadDialog(bool is_reload,
444 const blink::WebString& message);
[email protected]12cc5112014-03-03 17:01:10445 virtual void showContextMenu(const blink::WebContextMenuData& data);
[email protected]91070342014-03-07 00:29:02446 virtual void clearContextMenu();
[email protected]35b2a972014-04-04 15:50:22447 virtual void willSendRequest(blink::WebLocalFrame* frame,
448 unsigned identifier,
449 blink::WebURLRequest& request,
450 const blink::WebURLResponse& redirect_response);
451 virtual void didReceiveResponse(blink::WebLocalFrame* frame,
452 unsigned identifier,
453 const blink::WebURLResponse& response);
454 virtual void didFinishResourceLoad(blink::WebLocalFrame* frame,
[email protected]255eea092013-06-28 17:19:14455 unsigned identifier);
[email protected]85d85fd2013-06-19 00:57:41456 virtual void didLoadResourceFromMemoryCache(
[email protected]35b2a972014-04-04 15:50:22457 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46458 const blink::WebURLRequest& request,
459 const blink::WebURLResponse& response);
[email protected]35b2a972014-04-04 15:50:22460 virtual void didDisplayInsecureContent(blink::WebLocalFrame* frame);
461 virtual void didRunInsecureContent(blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46462 const blink::WebSecurityOrigin& origin,
463 const blink::WebURL& target);
[email protected]35b2a972014-04-04 15:50:22464 virtual void didAbortLoading(blink::WebLocalFrame* frame);
465 virtual void didCreateScriptContext(blink::WebLocalFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41466 v8::Handle<v8::Context> context,
467 int extension_group,
[email protected]255eea092013-06-28 17:19:14468 int world_id);
[email protected]35b2a972014-04-04 15:50:22469 virtual void willReleaseScriptContext(blink::WebLocalFrame* frame,
[email protected]85d85fd2013-06-19 00:57:41470 v8::Handle<v8::Context> context,
[email protected]255eea092013-06-28 17:19:14471 int world_id);
[email protected]35b2a972014-04-04 15:50:22472 virtual void didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame);
[email protected]35b2a972014-04-04 15:50:22473 virtual void didChangeScrollOffset(blink::WebLocalFrame* frame);
474 virtual void willInsertBody(blink::WebLocalFrame* frame);
[email protected]85d85fd2013-06-19 00:57:41475 virtual void reportFindInPageMatchCount(int request_id,
476 int count,
[email protected]255eea092013-06-28 17:19:14477 bool final_update);
[email protected]85d85fd2013-06-19 00:57:41478 virtual void reportFindInPageSelection(int request_id,
479 int active_match_ordinal,
[email protected]180ef242013-11-07 06:50:46480 const blink::WebRect& sel);
[email protected]35b2a972014-04-04 15:50:22481 virtual void requestStorageQuota(blink::WebLocalFrame* frame,
482 blink::WebStorageQuotaType type,
483 unsigned long long requested_size,
484 blink::WebStorageQuotaCallbacks callbacks);
[email protected]a14903e02014-06-02 07:35:12485 virtual void willOpenWebSocket(blink::WebSocketHandle* handle);
[email protected]5ee7f182014-04-25 19:45:26486 virtual blink::WebGeolocationClient* geolocationClient();
[email protected]45920862014-07-02 12:53:02487 virtual blink::WebPushClient* pushClient();
avayvodbca35fad2015-01-29 20:20:57488 virtual blink::WebPresentationClient* presentationClient();
[email protected]85d85fd2013-06-19 00:57:41489 virtual void willStartUsingPeerConnectionHandler(
[email protected]35b2a972014-04-04 15:50:22490 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:46491 blink::WebRTCPeerConnectionHandler* handler);
[email protected]bfe45e22014-04-25 16:47:53492 virtual blink::WebUserMediaClient* userMediaClient();
jrummell109c3a602014-12-18 01:08:50493 virtual blink::WebEncryptedMediaClient* encryptedMediaClient();
[email protected]8538385f2014-04-25 19:45:04494 virtual blink::WebMIDIClient* webMIDIClient();
[email protected]85d85fd2013-06-19 00:57:41495 virtual bool willCheckAndDispatchMessageEvent(
[email protected]ce5064f2014-05-07 22:49:20496 blink::WebLocalFrame* source_frame,
497 blink::WebFrame* target_frame,
498 blink::WebSecurityOrigin target_origin,
[email protected]180ef242013-11-07 06:50:46499 blink::WebDOMMessageEvent event);
[email protected]35b2a972014-04-04 15:50:22500 virtual blink::WebString userAgentOverride(blink::WebLocalFrame* frame,
501 const blink::WebURL& url);
502 virtual blink::WebString doNotTrackValue(blink::WebLocalFrame* frame);
503 virtual bool allowWebGL(blink::WebLocalFrame* frame, bool default_value);
504 virtual void didLoseWebGLContext(blink::WebLocalFrame* frame,
[email protected]255eea092013-06-28 17:19:14505 int arb_robustness_status_code);
[email protected]cf78eda2014-06-13 16:57:41506 virtual blink::WebScreenOrientationClient* webScreenOrientationClient();
nhirokifebadeed2014-10-29 04:02:47507 virtual bool isControlledByServiceWorker(blink::WebDataSource& data_source);
508 virtual int64_t serviceWorkerID(blink::WebDataSource& data_source);
dmazzoni0b5d2482014-09-10 19:45:57509 virtual void postAccessibilityEvent(const blink::WebAXObject& obj,
510 blink::WebAXEvent event);
dmazzoni1a69e2b32014-11-06 20:34:28511 virtual void handleAccessibilityFindInPageResult(
512 int identifier,
513 int match_index,
514 const blink::WebAXObject& start_object,
515 int start_offset,
516 const blink::WebAXObject& end_object,
517 int end_offset);
mlamouriefdca9d2014-09-16 16:55:40518 virtual void didChangeManifest(blink::WebLocalFrame*);
mlamouri7a78d6fd2015-01-17 13:23:53519 virtual bool enterFullscreen();
520 virtual bool exitFullscreen();
clamydf1975e2015-02-05 19:12:24521 void suddenTerminationDisablerChanged(
522 bool present,
523 blink::WebFrameClient::SuddenTerminationDisablerType type) override;
[email protected]85d85fd2013-06-19 00:57:41524
[email protected]96307312014-05-04 01:00:19525 // WebMediaPlayerDelegate implementation:
dcheng6d18e402014-10-21 12:32:52526 void DidPlay(blink::WebMediaPlayer* player) override;
527 void DidPause(blink::WebMediaPlayer* player) override;
528 void PlayerGone(blink::WebMediaPlayer* player) override;
[email protected]96307312014-05-04 01:00:19529
[email protected]c6bc20332014-02-28 18:30:39530 // TODO(nasko): Make all tests in RenderViewImplTest friends and then move
531 // this back to private member.
532 void OnNavigate(const FrameMsg_Navigate_Params& params);
533
nasko78f06bc2014-11-18 18:18:57534 // Make this frame show an empty, unscriptable page.
535 // TODO(nasko): Remove this method once swapped out state is no longer used.
536 void NavigateToSwappedOutURL();
537
rockot775ce0d2015-01-27 18:35:01538 // Binds this render frame's service registry.
[email protected]c52a1412014-06-25 06:09:25539 void BindServiceRegistry(
rockot775ce0d2015-01-27 18:35:01540 mojo::InterfaceRequest<mojo::ServiceProvider> services,
541 mojo::ServiceProviderPtr exposed_services);
[email protected]c52a1412014-06-25 06:09:25542
mlamouri4fff1992014-09-30 11:22:46543 ManifestManager* manifest_manager();
544
[email protected]2f61bdd2013-07-02 18:38:47545 protected:
546 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id);
547
[email protected]227692c52013-05-31 22:43:04548 private:
[email protected]2e2d9632013-12-03 00:55:26549 friend class RenderFrameObserver;
[email protected]95640212014-07-26 18:14:30550 friend class RendererAccessibilityTest;
avi485e5fd62014-08-25 23:26:14551 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem);
552 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
553 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
554 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
[email protected]66bbadaf2014-03-28 16:25:54555 FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest,
556 AccessibilityMessagesQueueWhileSwappedOut);
[email protected]4ee64622014-03-21 22:34:15557 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
558 OnExtendSelectionAndDelete);
[email protected]66bbadaf2014-03-28 16:25:54559 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut);
560 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK);
alexmosbc7eafa2014-12-06 01:38:09561 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OriginReplicationForSwapOut);
[email protected]4ee64622014-03-21 22:34:15562 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
563 SetEditableSelectionAndComposition);
[email protected]95640212014-07-26 18:14:30564 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
565 OnSetAccessibilityMode);
[email protected]2e2d9632013-12-03 00:55:26566
[email protected]37567b432014-02-12 01:12:22567 typedef std::map<GURL, double> HostZoomLevels;
568
[email protected]2e2d9632013-12-03 00:55:26569 // Functions to add and remove observers for this object.
570 void AddObserver(RenderFrameObserver* observer);
571 void RemoveObserver(RenderFrameObserver* observer);
[email protected]1c2052f2013-08-28 08:24:34572
[email protected]f0906a02014-08-07 07:18:55573 // Builds and sends DidCommitProvisionalLoad to the host.
avi8c46f7e2015-02-03 18:27:35574 void SendDidCommitProvisionalLoad(blink::WebFrame* frame,
575 blink::WebHistoryCommitType commit_type);
[email protected]37567b432014-02-12 01:12:22576
[email protected]b70da4c2014-01-06 19:57:09577 // IPC message handlers ------------------------------------------------------
578 //
579 // The documentation for these functions should be in
580 // content/common/*_messages.h for the message that the function is handling.
[email protected]f76f32232014-03-11 17:36:17581 void OnBeforeUnload();
alexmosbc7eafa2014-12-06 01:38:09582 void OnSwapOut(int proxy_routing_id,
nasko3e8c20e2014-12-18 06:54:56583 bool is_loading,
alexmosbc7eafa2014-12-06 01:38:09584 const FrameReplicationState& replicated_frame_state);
Nasko Oskov85f60222014-08-28 22:53:30585 void OnStop();
[email protected]a09d53ce2014-01-31 00:46:42586 void OnShowContextMenu(const gfx::Point& location);
587 void OnContextMenuClosed(const CustomContextMenuContext& custom_context);
588 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context,
589 unsigned action);
[email protected]4ee64622014-03-21 22:34:15590 void OnUndo();
591 void OnRedo();
[email protected]9c9343b2014-03-08 02:56:07592 void OnCut();
593 void OnCopy();
594 void OnPaste();
[email protected]4ee64622014-03-21 22:34:15595 void OnPasteAndMatchStyle();
596 void OnDelete();
597 void OnSelectAll();
christiankaeed9862014-11-05 10:49:14598 void OnSelectRange(const gfx::Point& base, const gfx::Point& extent);
[email protected]4ee64622014-03-21 22:34:15599 void OnUnselect();
christiankaeed9862014-11-05 10:49:14600 void OnMoveRangeSelectionExtent(const gfx::Point& point);
[email protected]1f3fc1d2014-04-03 14:50:17601 void OnReplace(const base::string16& text);
602 void OnReplaceMisspelling(const base::string16& text);
[email protected]e31b8ebb2014-03-07 17:59:34603 void OnCSSInsertRequest(const std::string& css);
[email protected]f13ab892014-03-12 06:48:52604 void OnJavaScriptExecuteRequest(const base::string16& javascript,
605 int id,
606 bool notify_result);
zeeshanq3454e9c2014-09-04 21:30:28607 void OnJavaScriptExecuteRequestForTests(const base::string16& javascript,
608 int id,
609 bool notify_result);
igsolla1cea67b72015-02-11 16:25:04610 void OnVisualStateRequest(uint64 key);
[email protected]4ee64622014-03-21 22:34:15611 void OnSetEditableSelectionOffsets(int start, int end);
[email protected]e5e438d62014-03-27 21:47:16612 void OnSetCompositionFromExistingText(
613 int start, int end,
614 const std::vector<blink::WebCompositionUnderline>& underlines);
sammcbc9e99332014-12-18 00:55:24615 void OnExecuteNoValueEditCommand(const std::string& name);
[email protected]e5e438d62014-03-27 21:47:16616 void OnExtendSelectionAndDelete(int before, int after);
[email protected]4fed3702014-04-01 09:08:00617 void OnReload(bool ignore_cache);
[email protected]96bb6132014-06-16 17:22:19618 void OnTextSurroundingSelectionRequest(size_t max_length);
[email protected]2e531f72014-06-20 23:23:39619 void OnAddStyleSheetByURL(const std::string& url);
[email protected]9e6bea412014-08-08 06:35:25620 void OnSetupTransitionView(const std::string& markup);
zhenwe8f14fc2014-11-25 01:00:54621 void OnBeginExitTransition(const std::string& css_selector,
622 bool exit_to_native_app);
zhenw5a707892014-12-10 02:31:03623 void OnRevertExitTransition();
zhenwabf9b9d2014-11-15 04:04:18624 void OnHideTransitionElements(const std::string& css_selector);
625 void OnShowTransitionElements(const std::string& css_selector);
[email protected]95640212014-07-26 18:14:30626 void OnSetAccessibilityMode(AccessibilityMode new_mode);
creisbbbeb062014-08-25 18:20:31627 void OnDisownOpener();
alexmos6b294562015-03-05 19:24:10628 void OnDidUpdateSandboxFlags(SandboxFlags flags);
avi485e5fd62014-08-25 23:26:14629#if defined(OS_ANDROID)
630 void OnSelectPopupMenuItems(bool canceled,
631 const std::vector<int>& selected_indices);
632#elif defined(OS_MACOSX)
633 void OnSelectPopupMenuItem(int selected_index);
[email protected]4ee64622014-03-21 22:34:15634 void OnCopyToFindPboard();
635#endif
[email protected]9c9343b2014-03-08 02:56:07636
davidbena5496d62014-10-07 18:52:04637 void OnCommitNavigation(const ResourceResponseHead& response,
638 const GURL& stream_url,
clamy9bfeef42014-09-30 20:50:42639 const CommonNavigationParams& common_params,
clamycbe86a0c2015-03-05 17:40:02640 const CommitNavigationParams& commit_params,
641 const HistoryNavigationParams& history_params);
clamy9bfeef42014-09-30 20:50:42642
[email protected]65920f332014-03-04 21:14:18643 // Virtual since overridden by WebTestProxy for layout tests.
644 virtual blink::WebNavigationPolicy DecidePolicyForNavigation(
645 RenderFrame* render_frame,
[email protected]0c3c54f2014-07-31 01:29:00646 const NavigationPolicyInfo& info);
[email protected]65920f332014-03-04 21:14:18647 void OpenURL(blink::WebFrame* frame,
648 const GURL& url,
649 const Referrer& referrer,
650 blink::WebNavigationPolicy policy);
[email protected]a09d53ce2014-01-31 00:46:42651
[email protected]ef3adfc2014-05-11 00:04:54652 // Update current main frame's encoding and send it to browser window.
653 // Since we want to let users see the right encoding info from menu
654 // before finishing loading, we call the UpdateEncoding in
655 // a) function:DidCommitLoadForFrame. When this function is called,
656 // that means we have got first data. In here we try to get encoding
657 // of page if it has been specified in http header.
658 // b) function:DidReceiveTitle. When this function is called,
659 // that means we have got specified title. Because in most of webpages,
660 // title tags will follow meta tags. In here we try to get encoding of
661 // page if it has been specified in meta tag.
662 // c) function:DidFinishDocumentLoadForFrame. When this function is
663 // called, that means we have got whole html page. In here we should
664 // finally get right encoding of page.
665 void UpdateEncoding(blink::WebFrame* frame,
666 const std::string& encoding_name);
667
[email protected]4ee64622014-03-21 22:34:15668 // Dispatches the current state of selection on the webpage to the browser if
669 // it has changed.
670 // TODO(varunjain): delete this method once we figure out how to keep
671 // selection handles in sync with the webpage.
672 void SyncSelectionIfRequired();
673
[email protected]87de04b02014-04-08 22:14:49674 bool RunJavaScriptMessage(JavaScriptMessageType type,
675 const base::string16& message,
676 const base::string16& default_value,
677 const GURL& frame_url,
678 base::string16* result);
679
[email protected]457736d2014-04-30 15:54:27680 // Loads the appropriate error page for the specified failure into the frame.
681 void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request,
682 const blink::WebURLError& error,
683 bool replace);
684
zeeshanq3454e9c2014-09-04 21:30:28685 void HandleJavascriptExecutionResult(const base::string16& javascript,
686 int id,
687 bool notify_result,
688 v8::Handle<v8::Value> result);
689
[email protected]977db4a42014-07-17 08:04:32690 // Initializes |web_user_media_client_|. If this fails, because it wasn't
691 // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then
692 // |web_user_media_client_| will remain NULL.
693 void InitializeUserMediaClient();
[email protected]96307312014-05-04 01:00:19694
695 blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream(
696 const blink::WebURL& url,
697 blink::WebMediaPlayerClient* client);
698
[email protected]ae2477e2014-05-27 23:47:08699 // Creates a factory object used for creating audio and video renderers.
700 // The method is virtual so that layouttests can override it.
701 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory();
702
clamyda97e8322014-10-07 21:57:25703 // Checks that the RenderView is ready to display the navigation to |url|. If
sungmann.cho12349f0e2014-12-05 23:42:19704 // the return value is false, the navigation should be abandoned.
clamyda97e8322014-10-07 21:57:25705 bool PrepareRenderViewForNavigation(
706 const GURL& url,
avi2b177592014-12-10 02:08:02707 bool is_history_navigation,
clamycbe86a0c2015-03-05 17:40:02708 const HistoryNavigationParams& history_params,
clamyda97e8322014-10-07 21:57:25709 bool* is_reload,
710 blink::WebURLRequest::CachePolicy* cache_policy);
711
clamyece38882014-11-19 15:00:20712 // PlzNavigate
713 // Sends a FrameHostMsg_BeginNavigation to the browser based on the contents
714 // of the WebURLRequest.
715 void BeginNavigation(blink::WebURLRequest* request);
716
clamy4cc9b8202015-03-02 13:51:36717 // Loads a data url.
718 void LoadDataURL(const CommonNavigationParams& params,
719 blink::WebFrame* frame);
720
[email protected]f3a95312014-06-12 16:46:58721 // Returns the URL being loaded by the |frame_|'s request.
722 GURL GetLoadingUrl() const;
723
[email protected]96307312014-05-04 01:00:19724#if defined(OS_ANDROID)
[email protected]65f3d1aa2014-05-29 01:57:00725 blink::WebMediaPlayer* CreateAndroidWebMediaPlayer(
[email protected]96307312014-05-04 01:00:19726 const blink::WebURL& url,
jrummell65b7d272014-09-24 20:49:27727 blink::WebMediaPlayerClient* client,
xhwang60b430a2015-02-01 05:20:46728 media::MediaPermission* media_permission,
jrummell65b7d272014-09-24 20:49:27729 blink::WebContentDecryptionModule* initial_cdm);
[email protected]a017938b2014-05-27 21:17:17730
[email protected]65f3d1aa2014-05-29 01:57:00731 RendererMediaPlayerManager* GetMediaPlayerManager();
[email protected]4b556cf2014-06-10 23:21:53732#endif
733
734#if defined(ENABLE_BROWSER_CDMS)
[email protected]65f3d1aa2014-05-29 01:57:00735 RendererCdmManager* GetCdmManager();
[email protected]96307312014-05-04 01:00:19736#endif
737
[email protected]35b2a972014-04-04 15:50:22738 // Stores the WebLocalFrame we are associated with.
739 blink::WebLocalFrame* frame_;
[email protected]b70da4c2014-01-06 19:57:09740
[email protected]abc501e2014-01-27 19:27:26741 base::WeakPtr<RenderViewImpl> render_view_;
[email protected]227692c52013-05-31 22:43:04742 int routing_id_;
[email protected]1c2052f2013-08-28 08:24:34743 bool is_swapped_out_;
[email protected]5a7100d2014-05-19 01:29:04744 // RenderFrameProxy exists only when is_swapped_out_ is true.
745 // TODO(nasko): This can be removed once we don't have a swapped out state on
746 // RenderFrame. See https://crbug.com/357747.
747 RenderFrameProxy* render_frame_proxy_;
[email protected]1c2052f2013-08-28 08:24:34748 bool is_detaching_;
[email protected]227692c52013-05-31 22:43:04749
japhete6adf142014-10-31 00:01:49750 // If this frame was created to replace a proxy, this will store the routing
751 // id of the proxy to replace at commit-time, at which time it will be
752 // cleared.
753 // TODO(creis): Remove this after switching to PlzNavigate.
754 int proxy_routing_id_;
755
kenrba7199832015-01-22 23:44:59756 // Used when the RenderFrame is a local root. For now, RenderWidgets are
757 // added only when a child frame is in a different process from its parent
758 // frame, but eventually this will also apply to top-level frames.
759 // TODO(kenrb): Correct the above statement when top-level frames have their
760 // own RenderWidgets.
761 scoped_refptr<RenderWidget> render_widget_;
762
[email protected]7a4e2532013-12-02 21:30:02763#if defined(ENABLE_PLUGINS)
[email protected]7a4e2532013-12-02 21:30:02764 // Current text input composition text. Empty if no composition is in
765 // progress.
[email protected]fcf75d42013-12-03 20:11:26766 base::string16 pepper_composition_text_;
tommyclieb25b2a2014-11-03 19:45:09767
tommycli59bd86c2014-12-10 02:09:38768 PluginPowerSaverHelper* plugin_power_saver_helper_;
[email protected]7a4e2532013-12-02 21:30:02769#endif
770
[email protected]f3add922013-12-20 23:17:16771 RendererWebCookieJarImpl cookie_jar_;
772
[email protected]2e2d9632013-12-03 00:55:26773 // All the registered observers.
774 ObserverList<RenderFrameObserver> observers_;
775
[email protected]bffc8302014-01-23 20:52:16776 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_;
777
[email protected]4ecee352014-03-11 21:12:19778 // The node that the context menu was pressed over.
779 blink::WebNode context_menu_node_;
780
[email protected]a09d53ce2014-01-31 00:46:42781 // External context menu requests we're waiting for. "Internal"
782 // (WebKit-originated) context menu events will have an ID of 0 and will not
783 // be in this map.
784 //
785 // We don't want to add internal ones since some of the "special" page
786 // handlers in the browser process just ignore the context menu requests so
787 // avoid showing context menus, and so this will cause right clicks to leak
788 // entries in this map. Most users of the custom context menu (e.g. Pepper
789 // plugins) are normally only on "regular" pages and the regular pages will
790 // always respond properly to the request, so we don't have to worry so
791 // much about leaks.
792 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_;
793
[email protected]4ee64622014-03-21 22:34:15794 // The text selection the last time DidChangeSelection got called. May contain
795 // additional characters before and after the selected text, for IMEs. The
796 // portion of this string that is the actual selected text starts at index
797 // |selection_range_.GetMin() - selection_text_offset_| and has length
798 // |selection_range_.length()|.
799 base::string16 selection_text_;
800 // The offset corresponding to the start of |selection_text_| in the document.
801 size_t selection_text_offset_;
802 // Range over the document corresponding to the actual selected text (which
803 // could correspond to a substring of |selection_text_|; see above).
804 gfx::Range selection_range_;
805 // Used to inform didChangeSelection() when it is called in the context
806 // of handling a InputMsg_SelectRange IPC.
807 bool handling_select_range_;
808
[email protected]2626d142014-04-22 17:24:02809 // The next group of objects all implement RenderFrameObserver, so are deleted
810 // along with the RenderFrame automatically. This is why we just store weak
811 // references.
812
[email protected]4459599e2014-07-29 22:40:09813 // Dispatches permission requests for Web Notifications.
814 NotificationPermissionDispatcher* notification_permission_dispatcher_;
815
[email protected]977db4a42014-07-17 08:04:32816 // Destroyed via the RenderFrameObserver::OnDestruct() mechanism.
perkj1a2d0432014-09-03 13:52:33817 UserMediaClientImpl* web_user_media_client_;
[email protected]96307312014-05-04 01:00:19818
jrummell109c3a602014-12-18 01:08:50819 // EncryptedMediaClient attached to this frame; lazily initialized.
xhwang430baee2015-01-22 05:46:20820 scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_;
jrummell109c3a602014-12-18 01:08:50821
xhwang36b1f3b2015-01-27 17:54:01822 // The media permission dispatcher attached to this frame, lazily initialized.
823 MediaPermissionDispatcher* media_permission_dispatcher_;
824
[email protected]52d3e172014-06-16 16:57:02825 // MidiClient attached to this frame; lazily initialized.
826 MidiDispatcher* midi_dispatcher_;
827
[email protected]a017938b2014-05-27 21:17:17828#if defined(OS_ANDROID)
[email protected]4b556cf2014-06-10 23:21:53829 // Manages all media players in this render frame for communicating with the
830 // real media player in the browser process. It's okay to use a raw pointer
831 // since it's a RenderFrameObserver.
[email protected]a017938b2014-05-27 21:17:17832 RendererMediaPlayerManager* media_player_manager_;
[email protected]4b556cf2014-06-10 23:21:53833#endif
834
835#if defined(ENABLE_BROWSER_CDMS)
836 // Manage all CDMs in this render frame for communicating with the real CDM in
837 // the browser process. It's okay to use a raw pointer since it's a
838 // RenderFrameObserver.
[email protected]65f3d1aa2014-05-29 01:57:00839 RendererCdmManager* cdm_manager_;
[email protected]a017938b2014-05-27 21:17:17840#endif
841
[email protected]a6e21c372014-07-12 02:27:21842#if defined(VIDEO_HOLE)
843 // Whether or not this RenderFrameImpl contains a media player. Used to
844 // register as an observer for video-hole-specific events.
845 bool contains_media_player_;
846#endif
847
[email protected]45920862014-07-02 12:53:02848 // The geolocation dispatcher attached to this frame, lazily initialized.
[email protected]8eae0802014-06-02 21:35:55849 GeolocationDispatcher* geolocation_dispatcher_;
850
[email protected]45920862014-07-02 12:53:02851 // The push messaging dispatcher attached to this frame, lazily initialized.
852 PushMessagingDispatcher* push_messaging_dispatcher_;
853
avayvodbca35fad2015-01-29 20:20:57854 // The presentation dispatcher implementation attached to this frame, lazily
855 // initialized.
856 PresentationDispatcher* presentation_dispatcher_;
857
[email protected]c52a1412014-06-25 06:09:25858 ServiceRegistryImpl service_registry_;
859
[email protected]45920862014-07-02 12:53:02860 // The screen orientation dispatcher attached to the frame, lazily
861 // initialized.
[email protected]cf78eda2014-06-13 16:57:41862 ScreenOrientationDispatcher* screen_orientation_dispatcher_;
863
mlamouriefdca9d2014-09-16 16:55:40864 // The Manifest Manager handles the manifest requests from the browser
865 // process.
866 ManifestManager* manifest_manager_;
867
[email protected]95640212014-07-26 18:14:30868 // The current accessibility mode.
869 AccessibilityMode accessibility_mode_;
870
871 // Only valid if |accessibility_mode_| is anything other than
872 // AccessibilityModeOff.
873 RendererAccessibility* renderer_accessibility_;
874
avi485e5fd62014-08-25 23:26:14875#if defined(OS_MACOSX) || defined(OS_ANDROID)
876 // The external popup for the currently showing select popup.
877 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
878#endif
879
[email protected]96307312014-05-04 01:00:19880 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
881
[email protected]227692c52013-05-31 22:43:04882 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
883};
884
885} // namespace content
886
[email protected]85d85fd2013-06-19 00:57:41887#endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_