[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 1 | // 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] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 10 | #include "base/basictypes.h" |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 11 | #include "base/files/file_path.h" |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 12 | #include "base/gtest_prod_util.h" |
| 13 | #include "base/id_map.h" |
xhwang | 430baee | 2015-01-22 05:46:20 | [diff] [blame] | 14 | #include "base/memory/scoped_ptr.h" |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 15 | #include "base/memory/weak_ptr.h" |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 16 | #include "base/observer_list.h" |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 17 | #include "base/process/process_handle.h" |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 18 | #include "content/common/accessibility_mode_enums.h" |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 19 | #include "content/common/frame_message_enums.h" |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 20 | #include "content/common/mojo/service_registry_impl.h" |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 21 | #include "content/public/common/javascript_message_type.h" |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 22 | #include "content/public/common/referrer.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 23 | #include "content/public/renderer/render_frame.h" |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 24 | #include "content/renderer/render_frame_proxy.h" |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 25 | #include "content/renderer/renderer_webcookiejar_impl.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 26 | #include "ipc/ipc_message.h" |
acolwell | 9e0840d | 2014-09-06 19:01:32 | [diff] [blame] | 27 | #include "media/blink/webmediaplayer_delegate.h" |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 28 | #include "third_party/WebKit/public/web/WebAXObject.h" |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 29 | #include "third_party/WebKit/public/web/WebDataSource.h" |
| 30 | #include "third_party/WebKit/public/web/WebFrameClient.h" |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 31 | #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
zhenw | d47fd72 | 2014-11-13 00:43:47 | [diff] [blame] | 32 | #include "third_party/WebKit/public/web/WebTransitionElementData.h" |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 33 | #include "ui/gfx/range/range.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 34 | |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 35 | #if defined(ENABLE_PLUGINS) |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 36 | #include "content/renderer/pepper/plugin_power_saver_helper.h" |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 37 | #endif |
| 38 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 39 | #if defined(OS_ANDROID) |
| 40 | #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 41 | #endif |
| 42 | |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 43 | class GURL; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 44 | class TransportDIB; |
zhenw | 70986bd | 2014-10-20 18:50:26 | [diff] [blame] | 45 | struct FrameHostMsg_AddNavigationTransitionData_Params; |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 46 | struct FrameMsg_NewFrame_WidgetParams; |
alexmos | e7da5a1 | 2015-04-09 02:22:16 | [diff] [blame] | 47 | struct FrameMsg_PostMessage_Params; |
dspell | e736c9db | 2015-04-03 04:53:16 | [diff] [blame] | 48 | struct FrameMsg_TextTrackSettings_Params; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 49 | |
| 50 | namespace blink { |
[email protected] | 5ee7f18 | 2014-04-25 19:45:26 | [diff] [blame] | 51 | class WebGeolocationClient; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 52 | class WebMouseEvent; |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 53 | class WebContentDecryptionModule; |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 54 | class WebMediaPlayer; |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 55 | class WebPresentationClient; |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 56 | class WebPushClient; |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 57 | class WebSecurityOrigin; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 58 | struct WebCompositionUnderline; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 59 | struct WebContextMenuData; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 60 | struct WebCursorInfo; |
zhenw | d47fd72 | 2014-11-13 00:43:47 | [diff] [blame] | 61 | struct WebTransitionElementData; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | namespace gfx { |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 65 | class Point; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 66 | class Range; |
| 67 | class Rect; |
| 68 | } |
| 69 | |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 70 | namespace media { |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 71 | class CdmFactory; |
xhwang | 60b430a | 2015-02-01 05:20:46 | [diff] [blame] | 72 | class MediaPermission; |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 73 | class WebEncryptedMediaClientImpl; |
| 74 | } |
| 75 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 76 | namespace content { |
| 77 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 78 | class ChildFrameCompositingHelper; |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 79 | class CompositorDependencies; |
dgozman | 358ba32 | 2015-03-26 15:05:30 | [diff] [blame] | 80 | class DevToolsAgent; |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 81 | class DocumentState; |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 82 | class ExternalPopupMenu; |
[email protected] | 8eae080 | 2014-06-02 21:35:55 | [diff] [blame] | 83 | class GeolocationDispatcher; |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame] | 84 | class ManifestManager; |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 85 | class MediaStreamDispatcher; |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 86 | class MediaStreamRendererFactory; |
xhwang | 36b1f3b | 2015-01-27 17:54:01 | [diff] [blame] | 87 | class MediaPermissionDispatcher; |
[email protected] | 52d3e17 | 2014-06-16 16:57:02 | [diff] [blame] | 88 | class MidiDispatcher; |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 89 | class NavigationState; |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 90 | class NotificationPermissionDispatcher; |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 91 | class PageState; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 92 | class PepperPluginInstanceImpl; |
mlamouri | c6d31db | 2015-03-28 17:48:14 | [diff] [blame] | 93 | class PermissionDispatcher; |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 94 | class PresentationDispatcher; |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 95 | class PushMessagingDispatcher; |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 96 | class RenderCdmFactory; |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 97 | class RendererAccessibility; |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 98 | class RendererCdmManager; |
| 99 | class RendererMediaPlayerManager; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 100 | class RendererPpapiHost; |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 101 | class RenderFrameObserver; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 102 | class RenderViewImpl; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 103 | class RenderWidget; |
| 104 | class RenderWidgetFullscreenPepper; |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 105 | class ScreenOrientationDispatcher; |
perkj | 1a2d043 | 2014-09-03 13:52:33 | [diff] [blame] | 106 | class UserMediaClientImpl; |
alexmos | e48b1df93 | 2015-01-16 01:34:17 | [diff] [blame] | 107 | enum class SandboxFlags; |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 108 | struct CommonNavigationParams; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 109 | struct CustomContextMenuContext; |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 110 | struct FrameReplicationState; |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 111 | struct NavigationParams; |
clamy | 79b3da6 | 2014-10-14 08:50:37 | [diff] [blame] | 112 | struct RequestNavigationParams; |
davidben | a5496d6 | 2014-10-07 18:52:04 | [diff] [blame] | 113 | struct ResourceResponseHead; |
clamy | 34e1278 | 2015-03-12 11:26:13 | [diff] [blame] | 114 | struct StartNavigationParams; |
clamy | d698303 | 2015-04-29 14:48:12 | [diff] [blame] | 115 | struct StreamOverrideParameters; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 116 | |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 117 | class CONTENT_EXPORT RenderFrameImpl |
| 118 | : public RenderFrame, |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 119 | NON_EXPORTED_BASE(public blink::WebFrameClient), |
acolwell | 9e0840d | 2014-09-06 19:01:32 | [diff] [blame] | 120 | NON_EXPORTED_BASE(public media::WebMediaPlayerDelegate) { |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 121 | public: |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 122 | // Creates a new RenderFrame. |render_view| is the RenderView object that this |
| 123 | // frame belongs to. |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 124 | // Callers *must* call |SetWebFrame| immediately after creation. |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 125 | // Note: This is called only when RenderFrame is created by Blink through |
| 126 | // createChildFrame. |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 127 | // TODO(creis): We should structure this so that |SetWebFrame| isn't needed. |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 128 | static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id); |
| 129 | |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 130 | // Creates a new RenderFrame with |routing_id| as a child of the RenderFrame |
| 131 | // identified by |parent_routing_id| or as the top-level frame if the latter |
japhet | e6adf14 | 2014-10-31 00:01:49 | [diff] [blame] | 132 | // is MSG_ROUTING_NONE. If |proxy_routing_id| is MSG_ROUTING_NONE, it creates |
| 133 | // the Blink WebLocalFrame and inserts it in the proper place in the frame |
| 134 | // tree. Otherwise, the frame is semi-orphaned until it commits, at which |
| 135 | // point it replaces the proxy identified by |proxy_routing_id|. |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 136 | // Note: This is called only when RenderFrame is being created in response to |
| 137 | // IPC message from the browser process. All other frame creation is driven |
| 138 | // through Blink and Create. |
japhet | e6adf14 | 2014-10-31 00:01:49 | [diff] [blame] | 139 | static void CreateFrame(int routing_id, |
| 140 | int parent_routing_id, |
alexmos | e48b1df93 | 2015-01-16 01:34:17 | [diff] [blame] | 141 | int proxy_routing_id, |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 142 | const FrameReplicationState& replicated_state, |
| 143 | CompositorDependencies* compositor_deps, |
| 144 | const FrameMsg_NewFrame_WidgetParams& params); |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 145 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 146 | // Returns the RenderFrameImpl for the given routing ID. |
| 147 | static RenderFrameImpl* FromRoutingID(int routing_id); |
| 148 | |
[email protected] | a5ac6dc | 2014-01-15 07:02:14 | [diff] [blame] | 149 | // Just like RenderFrame::FromWebFrame but returns the implementation. |
| 150 | static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 151 | |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 152 | // Used by content_layouttest_support to hook into the creation of |
| 153 | // RenderFrameImpls. |
dongseong.hwang | b721ddf | 2014-12-10 21:22:50 | [diff] [blame] | 154 | using CreateRenderFrameImplFunction = RenderFrameImpl* (*)(RenderViewImpl*, |
| 155 | int32); |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 156 | static void InstallCreateHook( |
dongseong.hwang | b721ddf | 2014-12-10 21:22:50 | [diff] [blame] | 157 | CreateRenderFrameImplFunction create_render_frame_impl); |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 158 | |
alexmos | e48b1df93 | 2015-01-16 01:34:17 | [diff] [blame] | 159 | static content::SandboxFlags WebToContentSandboxFlags( |
| 160 | blink::WebSandboxFlags flags); |
| 161 | |
| 162 | static blink::WebSandboxFlags ContentToWebSandboxFlags( |
| 163 | content::SandboxFlags flags); |
| 164 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 165 | virtual ~RenderFrameImpl(); |
| 166 | |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 167 | bool is_swapped_out() const { |
| 168 | return is_swapped_out_; |
| 169 | } |
| 170 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 171 | // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 172 | // RenderFrames. See https://crbug.com/357747. |
| 173 | void set_render_frame_proxy(RenderFrameProxy* proxy) { |
| 174 | render_frame_proxy_ = proxy; |
| 175 | } |
| 176 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 177 | // Out-of-process child frames receive a signal from RenderWidgetCompositor |
| 178 | // when a compositor frame has committed. |
| 179 | void DidCommitCompositorFrame(); |
| 180 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 181 | // TODO(jam): this is a temporary getter until all the code is transitioned |
| 182 | // to using RenderFrame instead of RenderView. |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 183 | RenderViewImpl* render_view() { return render_view_.get(); } |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 184 | |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 185 | RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; } |
| 186 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 187 | // Returns the RenderWidget associated with this frame. |
| 188 | RenderWidget* GetRenderWidget(); |
| 189 | |
dgozman | cf9039cd | 2015-04-06 12:01:31 | [diff] [blame] | 190 | DevToolsAgent* devtools_agent() { return devtools_agent_; } |
| 191 | |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 192 | // This is called right after creation with the WebLocalFrame for this |
[email protected] | 0287e76 | 2014-04-11 13:07:58 | [diff] [blame] | 193 | // RenderFrame. It must be called before Initialize. |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 194 | void SetWebFrame(blink::WebLocalFrame* web_frame); |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 195 | |
[email protected] | 0287e76 | 2014-04-11 13:07:58 | [diff] [blame] | 196 | // This method must be called after the frame has been added to the frame |
| 197 | // tree. It creates all objects that depend on the frame being at its proper |
| 198 | // spot. |
| 199 | void Initialize(); |
| 200 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 201 | // Notifications from RenderWidget. |
| 202 | void WasHidden(); |
| 203 | void WasShown(); |
dgozman | cf9039cd | 2015-04-06 12:01:31 | [diff] [blame] | 204 | void WidgetWillClose(); |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 205 | |
[email protected] | 723971b | 2014-02-12 11:08:25 | [diff] [blame] | 206 | // Start/Stop loading notifications. |
| 207 | // TODO(nasko): Those are page-level methods at this time and come from |
| 208 | // WebViewClient. We should move them to be WebFrameClient calls and put |
| 209 | // logic in the browser side to balance starts/stops. |
[email protected] | e3b10d1 | 2014-03-28 16:06:09 | [diff] [blame] | 210 | // |to_different_document| will be true unless the load is a fragment |
| 211 | // navigation, or triggered by history.pushState/replaceState. |
[email protected] | 6dd5c32 | 2014-03-12 07:58:46 | [diff] [blame] | 212 | virtual void didStartLoading(bool to_different_document); |
| 213 | virtual void didStopLoading(); |
| 214 | virtual void didChangeLoadProgress(double load_progress); |
[email protected] | 723971b | 2014-02-12 11:08:25 | [diff] [blame] | 215 | |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 216 | AccessibilityMode accessibility_mode() { |
| 217 | return accessibility_mode_; |
| 218 | } |
| 219 | |
| 220 | RendererAccessibility* renderer_accessibility() { |
| 221 | return renderer_accessibility_; |
| 222 | } |
| 223 | |
| 224 | void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 225 | blink::WebAXEvent event); |
| 226 | |
estade | 31c5434 | 2015-01-23 03:34:36 | [diff] [blame] | 227 | // The focused node changed to |node|. If focus was lost from this frame, |
| 228 | // |node| will be null. |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 229 | void FocusedNodeChanged(const blink::WebNode& node); |
| 230 | |
estade | 31c5434 | 2015-01-23 03:34:36 | [diff] [blame] | 231 | // TODO(dmazzoni): the only reason this is here is to plumb it through to |
| 232 | // RendererAccessibility. It should use the RenderFrameObserver method, once |
| 233 | // blink has a separate accessibility tree per frame. |
| 234 | void FocusedNodeChangedForAccessibility(const blink::WebNode& node); |
| 235 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 236 | #if defined(ENABLE_PLUGINS) |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 237 | // Notification that a PPAPI plugin has been created. |
| 238 | void PepperPluginCreated(RendererPpapiHost* host); |
| 239 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 240 | // Notifies that |instance| has changed the cursor. |
| 241 | // This will update the cursor appearance if it is currently over the plugin |
| 242 | // instance. |
| 243 | void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
| 244 | const blink::WebCursorInfo& cursor); |
| 245 | |
| 246 | // Notifies that |instance| has received a mouse event. |
| 247 | void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance); |
| 248 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 249 | // Informs the render view that a PPAPI plugin has changed text input status. |
| 250 | void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance); |
| 251 | void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance); |
| 252 | |
| 253 | // Cancels current composition. |
| 254 | void PepperCancelComposition(PepperPluginInstanceImpl* instance); |
| 255 | |
| 256 | // Informs the render view that a PPAPI plugin has changed selection. |
| 257 | void PepperSelectionChanged(PepperPluginInstanceImpl* instance); |
| 258 | |
| 259 | // Creates a fullscreen container for a pepper plugin instance. |
| 260 | RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer( |
| 261 | PepperPluginInstanceImpl* plugin); |
| 262 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 263 | bool IsPepperAcceptingCompositionEvents() const; |
| 264 | |
| 265 | // Notification that the given plugin has crashed. |
| 266 | void PluginCrashed(const base::FilePath& plugin_path, |
| 267 | base::ProcessId plugin_pid); |
| 268 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 269 | // Simulates IME events for testing purpose. |
| 270 | void SimulateImeSetComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 271 | const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 272 | const std::vector<blink::WebCompositionUnderline>& underlines, |
| 273 | int selection_start, |
| 274 | int selection_end); |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 275 | void SimulateImeConfirmComposition(const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 276 | const gfx::Range& replacement_range); |
| 277 | |
| 278 | // TODO(jam): remove these once the IPC handler moves from RenderView to |
| 279 | // RenderFrame. |
| 280 | void OnImeSetComposition( |
tommycli | e6633ca7 | 2014-10-31 00:40:42 | [diff] [blame] | 281 | const base::string16& text, |
| 282 | const std::vector<blink::WebCompositionUnderline>& underlines, |
| 283 | int selection_start, |
| 284 | int selection_end); |
| 285 | void OnImeConfirmComposition(const base::string16& text, |
| 286 | const gfx::Range& replacement_range, |
| 287 | bool keep_selection); |
| 288 | #endif // defined(ENABLE_PLUGINS) |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 289 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 290 | // May return NULL in some cases, especially if userMediaClient() returns |
| 291 | // NULL. |
| 292 | MediaStreamDispatcher* GetMediaStreamDispatcher(); |
| 293 | |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 294 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 295 | void DidHideExternalPopupMenu(); |
| 296 | #endif |
| 297 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 298 | // IPC::Sender |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 299 | bool Send(IPC::Message* msg) override; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 300 | |
| 301 | // IPC::Listener |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 302 | bool OnMessageReceived(const IPC::Message& msg) override; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 303 | |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 304 | // RenderFrame implementation: |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 305 | RenderView* GetRenderView() override; |
| 306 | int GetRoutingID() override; |
| 307 | blink::WebLocalFrame* GetWebFrame() override; |
estade | 78d655f8 | 2015-01-30 01:55:08 | [diff] [blame] | 308 | blink::WebElement GetFocusedElement() const override; |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 309 | WebPreferences& GetWebkitPreferences() override; |
| 310 | int ShowContextMenu(ContextMenuClient* client, |
| 311 | const ContextMenuParams& params) override; |
| 312 | void CancelContextMenu(int request_id) override; |
| 313 | blink::WebNode GetContextMenuNode() const override; |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 314 | blink::WebPlugin* CreatePlugin( |
| 315 | blink::WebFrame* frame, |
| 316 | const WebPluginInfo& info, |
| 317 | const blink::WebPluginParams& params, |
tommycli | e872270 | 2015-01-16 11:40:41 | [diff] [blame] | 318 | scoped_ptr<PluginInstanceThrottler> throttler) override; |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 319 | void LoadURLExternally(blink::WebLocalFrame* frame, |
| 320 | const blink::WebURLRequest& request, |
| 321 | blink::WebNavigationPolicy policy) override; |
| 322 | void ExecuteJavaScript(const base::string16& javascript) override; |
| 323 | bool IsHidden() override; |
| 324 | ServiceRegistry* GetServiceRegistry() override; |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 325 | #if defined(ENABLE_PLUGINS) |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 326 | void RegisterPeripheralPlugin( |
| 327 | const GURL& content_origin, |
| 328 | const base::Closure& unthrottle_callback) override; |
tommycli | d7798e1 | 2015-02-09 21:08:56 | [diff] [blame] | 329 | PluginPowerSaverHelper* plugin_power_saver_helper() { |
| 330 | return plugin_power_saver_helper_; |
| 331 | } |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 332 | #endif |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 333 | bool IsFTPDirectoryListing() override; |
| 334 | void AttachGuest(int element_instance_id) override; |
fsamuel | a95fef4 | 2014-12-03 20:16:52 | [diff] [blame] | 335 | void DetachGuest(int element_instance_id) override; |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 336 | void SetSelectedText(const base::string16& selection_text, |
| 337 | size_t offset, |
| 338 | const gfx::Range& range) override; |
| 339 | void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, |
dcarney | 4410a7c9 | 2015-04-20 11:28:19 | [diff] [blame] | 340 | v8::Local<v8::Context> context) override; |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 341 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 342 | // blink::WebFrameClient implementation: |
jbroman | 73e9f796 | 2014-10-30 00:43:45 | [diff] [blame] | 343 | blink::WebPluginPlaceholder* createPluginPlaceholder( |
| 344 | blink::WebLocalFrame*, |
| 345 | const blink::WebPluginParams&) override; |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 346 | virtual blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
| 347 | const blink::WebPluginParams& params); |
jrummell | 65b7d27 | 2014-09-24 20:49:27 | [diff] [blame] | 348 | // TODO(jrummell): Remove this method once blink updated. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 349 | virtual blink::WebMediaPlayer* createMediaPlayer( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 350 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 351 | const blink::WebURL& url, |
| 352 | blink::WebMediaPlayerClient* client); |
jrummell | 65b7d27 | 2014-09-24 20:49:27 | [diff] [blame] | 353 | virtual blink::WebMediaPlayer* createMediaPlayer( |
| 354 | blink::WebLocalFrame* frame, |
| 355 | const blink::WebURL& url, |
| 356 | blink::WebMediaPlayerClient* client, |
| 357 | blink::WebContentDecryptionModule* initial_cdm); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 358 | virtual blink::WebApplicationCacheHost* createApplicationCacheHost( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 359 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 360 | blink::WebApplicationCacheHostClient* client); |
mlamouri | a5b29455 | 2015-03-09 16:16:36 | [diff] [blame] | 361 | virtual blink::WebWorkerContentSettingsClientProxy* |
| 362 | createWorkerContentSettingsClientProxy(blink::WebLocalFrame* frame); |
[email protected] | b20c322 | 2014-08-22 00:50:22 | [diff] [blame] | 363 | virtual blink::WebExternalPopupMenu* createExternalPopupMenu( |
| 364 | const blink::WebPopupMenuInfo& popup_menu_info, |
| 365 | blink::WebExternalPopupMenuClient* popup_menu_client); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 366 | virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 367 | virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 368 | blink::WebLocalFrame* frame); |
| 369 | virtual void didAccessInitialDocument(blink::WebLocalFrame* frame); |
alexmos | e48b1df93 | 2015-01-16 01:34:17 | [diff] [blame] | 370 | virtual blink::WebFrame* createChildFrame( |
| 371 | blink::WebLocalFrame* parent, |
| 372 | const blink::WebString& name, |
| 373 | blink::WebSandboxFlags sandboxFlags); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 374 | virtual void didDisownOpener(blink::WebLocalFrame* frame); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 375 | virtual void frameDetached(blink::WebFrame* frame); |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 376 | virtual void frameFocused(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 377 | virtual void willClose(blink::WebFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 378 | virtual void didChangeName(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 379 | const blink::WebString& name); |
alexmos | 6b29456 | 2015-03-05 19:24:10 | [diff] [blame] | 380 | virtual void didChangeSandboxFlags(blink::WebFrame* child_frame, |
| 381 | blink::WebSandboxFlags flags); |
[email protected] | f5b6dd112 | 2013-10-04 02:42:50 | [diff] [blame] | 382 | virtual void didMatchCSS( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 383 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 384 | const blink::WebVector<blink::WebString>& newly_matching_selectors, |
| 385 | const blink::WebVector<blink::WebString>& stopped_matching_selectors); |
[email protected] | c31a8480 | 2014-04-03 15:55:49 | [diff] [blame] | 386 | virtual bool shouldReportDetailedMessageForSource( |
| 387 | const blink::WebString& source); |
| 388 | virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, |
| 389 | const blink::WebString& source_name, |
| 390 | unsigned source_line, |
| 391 | const blink::WebString& stack_trace); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 392 | virtual void loadURLExternally(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 393 | const blink::WebURLRequest& request, |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 394 | blink::WebNavigationPolicy policy, |
| 395 | const blink::WebString& suggested_name); |
[email protected] | 1a4e975 | 2013-12-31 20:10:58 | [diff] [blame] | 396 | // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 397 | virtual blink::WebNavigationPolicy decidePolicyForNavigation( |
[email protected] | 0c3c54f | 2014-07-31 01:29:00 | [diff] [blame] | 398 | const NavigationPolicyInfo& info); |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 399 | virtual blink::WebHistoryItem historyItemForNewChildFrame( |
| 400 | blink::WebFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 401 | virtual void willSendSubmitEvent(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 402 | const blink::WebFormElement& form); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 403 | virtual void willSubmitForm(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 404 | const blink::WebFormElement& form); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 405 | virtual void didCreateDataSource(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 406 | blink::WebDataSource* datasource); |
[email protected] | 0c3c54f | 2014-07-31 01:29:00 | [diff] [blame] | 407 | virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame, |
japhet | 69a0630 | 2014-12-12 19:37:14 | [diff] [blame] | 408 | bool is_transition_navigation, |
| 409 | double triggering_event_time); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 410 | virtual void didReceiveServerRedirectForProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 411 | blink::WebLocalFrame* frame); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 412 | virtual void didFailProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 413 | blink::WebLocalFrame* frame, |
avi | be2d51d | 2015-03-31 00:21:17 | [diff] [blame] | 414 | const blink::WebURLError& error, |
| 415 | blink::WebHistoryCommitType commit_type); |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 416 | virtual void didCommitProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 417 | blink::WebLocalFrame* frame, |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 418 | const blink::WebHistoryItem& item, |
| 419 | blink::WebHistoryCommitType commit_type); |
rob | 5ef11ff | 2014-11-17 23:56:20 | [diff] [blame] | 420 | virtual void didCreateNewDocument(blink::WebLocalFrame* frame); |
[email protected] | 06181e5 | 2014-05-10 11:59:09 | [diff] [blame] | 421 | virtual void didClearWindowObject(blink::WebLocalFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 422 | virtual void didCreateDocumentElement(blink::WebLocalFrame* frame); |
| 423 | virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 424 | const blink::WebString& title, |
| 425 | blink::WebTextDirection direction); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 426 | virtual void didChangeIcon(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 427 | blink::WebIconURL::Type icon_type); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 428 | virtual void didFinishDocumentLoad(blink::WebLocalFrame* frame); |
| 429 | virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame); |
| 430 | virtual void didFailLoad(blink::WebLocalFrame* frame, |
avi | be2d51d | 2015-03-31 00:21:17 | [diff] [blame] | 431 | const blink::WebURLError& error, |
| 432 | blink::WebHistoryCommitType commit_type); |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 433 | virtual void didFinishLoad(blink::WebLocalFrame* frame); |
| 434 | virtual void didNavigateWithinPage(blink::WebLocalFrame* frame, |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 435 | const blink::WebHistoryItem& item, |
| 436 | blink::WebHistoryCommitType commit_type); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 437 | virtual void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame); |
[email protected] | 9e6bea41 | 2014-08-08 06:35:25 | [diff] [blame] | 438 | virtual void addNavigationTransitionData( |
zhenw | d47fd72 | 2014-11-13 00:43:47 | [diff] [blame] | 439 | const blink::WebTransitionElementData& data); |
[email protected] | 37b64c5 | 2014-07-11 21:14:05 | [diff] [blame] | 440 | virtual void didChangeThemeColor(); |
alexmos | f40ce5b0 | 2015-02-25 20:19:56 | [diff] [blame] | 441 | virtual void dispatchLoad(); |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 442 | virtual void requestNotificationPermission( |
| 443 | const blink::WebSecurityOrigin& origin, |
| 444 | blink::WebNotificationPermissionCallback* callback); |
[email protected] | c3f2c70 | 2014-03-19 23:39:48 | [diff] [blame] | 445 | virtual void didChangeSelection(bool is_empty_selection); |
[email protected] | f3c59d6 | 2014-04-09 16:33:55 | [diff] [blame] | 446 | virtual blink::WebColorChooser* createColorChooser( |
[email protected] | eb8c216a | 2014-04-09 19:19:19 | [diff] [blame] | 447 | blink::WebColorChooserClient* client, |
[email protected] | f3c59d6 | 2014-04-09 16:33:55 | [diff] [blame] | 448 | const blink::WebColor& initial_color, |
| 449 | const blink::WebVector<blink::WebColorSuggestion>& suggestions); |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 450 | virtual void runModalAlertDialog(const blink::WebString& message); |
| 451 | virtual bool runModalConfirmDialog(const blink::WebString& message); |
| 452 | virtual bool runModalPromptDialog(const blink::WebString& message, |
| 453 | const blink::WebString& default_value, |
| 454 | blink::WebString* actual_value); |
| 455 | virtual bool runModalBeforeUnloadDialog(bool is_reload, |
| 456 | const blink::WebString& message); |
[email protected] | 12cc511 | 2014-03-03 17:01:10 | [diff] [blame] | 457 | virtual void showContextMenu(const blink::WebContextMenuData& data); |
[email protected] | 9107034 | 2014-03-07 00:29:02 | [diff] [blame] | 458 | virtual void clearContextMenu(); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 459 | virtual void willSendRequest(blink::WebLocalFrame* frame, |
| 460 | unsigned identifier, |
| 461 | blink::WebURLRequest& request, |
| 462 | const blink::WebURLResponse& redirect_response); |
| 463 | virtual void didReceiveResponse(blink::WebLocalFrame* frame, |
| 464 | unsigned identifier, |
| 465 | const blink::WebURLResponse& response); |
| 466 | virtual void didFinishResourceLoad(blink::WebLocalFrame* frame, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 467 | unsigned identifier); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 468 | virtual void didLoadResourceFromMemoryCache( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 469 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 470 | const blink::WebURLRequest& request, |
| 471 | const blink::WebURLResponse& response); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 472 | virtual void didDisplayInsecureContent(blink::WebLocalFrame* frame); |
| 473 | virtual void didRunInsecureContent(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 474 | const blink::WebSecurityOrigin& origin, |
| 475 | const blink::WebURL& target); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 476 | virtual void didAbortLoading(blink::WebLocalFrame* frame); |
| 477 | virtual void didCreateScriptContext(blink::WebLocalFrame* frame, |
deepak.s | 750d68f | 2015-04-30 07:32:41 | [diff] [blame] | 478 | v8::Local<v8::Context> context, |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 479 | int extension_group, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 480 | int world_id); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 481 | virtual void willReleaseScriptContext(blink::WebLocalFrame* frame, |
deepak.s | 750d68f | 2015-04-30 07:32:41 | [diff] [blame] | 482 | v8::Local<v8::Context> context, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 483 | int world_id); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 484 | virtual void didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 485 | virtual void didChangeScrollOffset(blink::WebLocalFrame* frame); |
| 486 | virtual void willInsertBody(blink::WebLocalFrame* frame); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 487 | virtual void reportFindInPageMatchCount(int request_id, |
| 488 | int count, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 489 | bool final_update); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 490 | virtual void reportFindInPageSelection(int request_id, |
| 491 | int active_match_ordinal, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 492 | const blink::WebRect& sel); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 493 | virtual void requestStorageQuota(blink::WebLocalFrame* frame, |
| 494 | blink::WebStorageQuotaType type, |
| 495 | unsigned long long requested_size, |
| 496 | blink::WebStorageQuotaCallbacks callbacks); |
[email protected] | a14903e0 | 2014-06-02 07:35:12 | [diff] [blame] | 497 | virtual void willOpenWebSocket(blink::WebSocketHandle* handle); |
[email protected] | 5ee7f18 | 2014-04-25 19:45:26 | [diff] [blame] | 498 | virtual blink::WebGeolocationClient* geolocationClient(); |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 499 | virtual blink::WebPushClient* pushClient(); |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 500 | virtual blink::WebPresentationClient* presentationClient(); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 501 | virtual void willStartUsingPeerConnectionHandler( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 502 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 503 | blink::WebRTCPeerConnectionHandler* handler); |
[email protected] | bfe45e2 | 2014-04-25 16:47:53 | [diff] [blame] | 504 | virtual blink::WebUserMediaClient* userMediaClient(); |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 505 | virtual blink::WebEncryptedMediaClient* encryptedMediaClient(); |
[email protected] | 8538385f | 2014-04-25 19:45:04 | [diff] [blame] | 506 | virtual blink::WebMIDIClient* webMIDIClient(); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 507 | virtual bool willCheckAndDispatchMessageEvent( |
[email protected] | ce5064f | 2014-05-07 22:49:20 | [diff] [blame] | 508 | blink::WebLocalFrame* source_frame, |
| 509 | blink::WebFrame* target_frame, |
| 510 | blink::WebSecurityOrigin target_origin, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 511 | blink::WebDOMMessageEvent event); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 512 | virtual blink::WebString userAgentOverride(blink::WebLocalFrame* frame, |
| 513 | const blink::WebURL& url); |
| 514 | virtual blink::WebString doNotTrackValue(blink::WebLocalFrame* frame); |
| 515 | virtual bool allowWebGL(blink::WebLocalFrame* frame, bool default_value); |
| 516 | virtual void didLoseWebGLContext(blink::WebLocalFrame* frame, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 517 | int arb_robustness_status_code); |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 518 | virtual blink::WebScreenOrientationClient* webScreenOrientationClient(); |
nhiroki | febadeed | 2014-10-29 04:02:47 | [diff] [blame] | 519 | virtual bool isControlledByServiceWorker(blink::WebDataSource& data_source); |
| 520 | virtual int64_t serviceWorkerID(blink::WebDataSource& data_source); |
dmazzoni | 0b5d248 | 2014-09-10 19:45:57 | [diff] [blame] | 521 | virtual void postAccessibilityEvent(const blink::WebAXObject& obj, |
| 522 | blink::WebAXEvent event); |
dmazzoni | 1a69e2b3 | 2014-11-06 20:34:28 | [diff] [blame] | 523 | virtual void handleAccessibilityFindInPageResult( |
| 524 | int identifier, |
| 525 | int match_index, |
| 526 | const blink::WebAXObject& start_object, |
| 527 | int start_offset, |
| 528 | const blink::WebAXObject& end_object, |
| 529 | int end_offset); |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame] | 530 | virtual void didChangeManifest(blink::WebLocalFrame*); |
avayvod | 5efd9a92 | 2015-03-13 15:41:02 | [diff] [blame] | 531 | virtual void didChangeDefaultPresentation(blink::WebLocalFrame*); |
mlamouri | 7a78d6fd | 2015-01-17 13:23:53 | [diff] [blame] | 532 | virtual bool enterFullscreen(); |
| 533 | virtual bool exitFullscreen(); |
mlamouri | 670a86d | 2015-03-17 16:06:25 | [diff] [blame] | 534 | virtual blink::WebPermissionClient* permissionClient(); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 535 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 536 | // WebMediaPlayerDelegate implementation: |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 537 | void DidPlay(blink::WebMediaPlayer* player) override; |
| 538 | void DidPause(blink::WebMediaPlayer* player) override; |
| 539 | void PlayerGone(blink::WebMediaPlayer* player) override; |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 540 | |
[email protected] | c6bc2033 | 2014-02-28 18:30:39 | [diff] [blame] | 541 | // TODO(nasko): Make all tests in RenderViewImplTest friends and then move |
| 542 | // this back to private member. |
clamy | 34e1278 | 2015-03-12 11:26:13 | [diff] [blame] | 543 | void OnNavigate(const CommonNavigationParams& common_params, |
| 544 | const StartNavigationParams& start_params, |
clamy | 57b4b8e | 2015-03-24 13:32:11 | [diff] [blame] | 545 | const RequestNavigationParams& request_params); |
[email protected] | c6bc2033 | 2014-02-28 18:30:39 | [diff] [blame] | 546 | |
nasko | 78f06bc | 2014-11-18 18:18:57 | [diff] [blame] | 547 | // Make this frame show an empty, unscriptable page. |
| 548 | // TODO(nasko): Remove this method once swapped out state is no longer used. |
| 549 | void NavigateToSwappedOutURL(); |
| 550 | |
rockot | 775ce0d | 2015-01-27 18:35:01 | [diff] [blame] | 551 | // Binds this render frame's service registry. |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 552 | void BindServiceRegistry( |
rockot | 775ce0d | 2015-01-27 18:35:01 | [diff] [blame] | 553 | mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 554 | mojo::ServiceProviderPtr exposed_services); |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 555 | |
mlamouri | 4fff199 | 2014-09-30 11:22:46 | [diff] [blame] | 556 | ManifestManager* manifest_manager(); |
| 557 | |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 558 | // TODO(creis): Remove when the only caller, the HistoryController, is no |
| 559 | // more. |
| 560 | void SetPendingNavigationParams( |
| 561 | scoped_ptr<NavigationParams> navigation_params); |
| 562 | |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 563 | protected: |
| 564 | RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
| 565 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 566 | private: |
kenrb | f98a4d2 | 2015-04-01 21:59:35 | [diff] [blame] | 567 | friend class RenderFrameImplTest; |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 568 | friend class RenderFrameObserver; |
clamy | 5c7ede5 | 2015-04-09 11:32:24 | [diff] [blame] | 569 | friend class RenderViewImplTest; |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 570 | friend class RendererAccessibilityTest; |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 571 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
| 572 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
| 573 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
| 574 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
[email protected] | 66bbadaf | 2014-03-28 16:25:54 | [diff] [blame] | 575 | FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
| 576 | AccessibilityMessagesQueueWhileSwappedOut); |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 577 | |
[email protected] | 37567b43 | 2014-02-12 01:12:22 | [diff] [blame] | 578 | typedef std::map<GURL, double> HostZoomLevels; |
| 579 | |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 580 | // Functions to add and remove observers for this object. |
| 581 | void AddObserver(RenderFrameObserver* observer); |
| 582 | void RemoveObserver(RenderFrameObserver* observer); |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 583 | |
[email protected] | f0906a0 | 2014-08-07 07:18:55 | [diff] [blame] | 584 | // Builds and sends DidCommitProvisionalLoad to the host. |
avi | 8c46f7e | 2015-02-03 18:27:35 | [diff] [blame] | 585 | void SendDidCommitProvisionalLoad(blink::WebFrame* frame, |
| 586 | blink::WebHistoryCommitType commit_type); |
[email protected] | 37567b43 | 2014-02-12 01:12:22 | [diff] [blame] | 587 | |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 588 | // IPC message handlers ------------------------------------------------------ |
| 589 | // |
| 590 | // The documentation for these functions should be in |
| 591 | // content/common/*_messages.h for the message that the function is handling. |
[email protected] | f76f3223 | 2014-03-11 17:36:17 | [diff] [blame] | 592 | void OnBeforeUnload(); |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 593 | void OnSwapOut(int proxy_routing_id, |
nasko | 3e8c20e | 2014-12-18 06:54:56 | [diff] [blame] | 594 | bool is_loading, |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 595 | const FrameReplicationState& replicated_frame_state); |
Nasko Oskov | 85f6022 | 2014-08-28 22:53:30 | [diff] [blame] | 596 | void OnStop(); |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 597 | void OnShowContextMenu(const gfx::Point& location); |
| 598 | void OnContextMenuClosed(const CustomContextMenuContext& custom_context); |
| 599 | void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context, |
| 600 | unsigned action); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 601 | void OnUndo(); |
| 602 | void OnRedo(); |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 603 | void OnCut(); |
| 604 | void OnCopy(); |
| 605 | void OnPaste(); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 606 | void OnPasteAndMatchStyle(); |
| 607 | void OnDelete(); |
| 608 | void OnSelectAll(); |
christiank | aeed986 | 2014-11-05 10:49:14 | [diff] [blame] | 609 | void OnSelectRange(const gfx::Point& base, const gfx::Point& extent); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 610 | void OnUnselect(); |
christiank | aeed986 | 2014-11-05 10:49:14 | [diff] [blame] | 611 | void OnMoveRangeSelectionExtent(const gfx::Point& point); |
[email protected] | 1f3fc1d | 2014-04-03 14:50:17 | [diff] [blame] | 612 | void OnReplace(const base::string16& text); |
| 613 | void OnReplaceMisspelling(const base::string16& text); |
[email protected] | e31b8ebb | 2014-03-07 17:59:34 | [diff] [blame] | 614 | void OnCSSInsertRequest(const std::string& css); |
[email protected] | f13ab89 | 2014-03-12 06:48:52 | [diff] [blame] | 615 | void OnJavaScriptExecuteRequest(const base::string16& javascript, |
| 616 | int id, |
| 617 | bool notify_result); |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 618 | void OnJavaScriptExecuteRequestForTests(const base::string16& javascript, |
| 619 | int id, |
jochen | 2e7d95b | 2015-05-04 15:28:50 | [diff] [blame^] | 620 | bool notify_result, |
| 621 | bool has_user_gesture); |
igsolla | 1cea67b7 | 2015-02-11 16:25:04 | [diff] [blame] | 622 | void OnVisualStateRequest(uint64 key); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 623 | void OnSetEditableSelectionOffsets(int start, int end); |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 624 | void OnSetCompositionFromExistingText( |
| 625 | int start, int end, |
| 626 | const std::vector<blink::WebCompositionUnderline>& underlines); |
sammc | bc9e9933 | 2014-12-18 00:55:24 | [diff] [blame] | 627 | void OnExecuteNoValueEditCommand(const std::string& name); |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 628 | void OnExtendSelectionAndDelete(int before, int after); |
[email protected] | 4fed370 | 2014-04-01 09:08:00 | [diff] [blame] | 629 | void OnReload(bool ignore_cache); |
[email protected] | 96bb613 | 2014-06-16 17:22:19 | [diff] [blame] | 630 | void OnTextSurroundingSelectionRequest(size_t max_length); |
[email protected] | 2e531f7 | 2014-06-20 23:23:39 | [diff] [blame] | 631 | void OnAddStyleSheetByURL(const std::string& url); |
[email protected] | 9e6bea41 | 2014-08-08 06:35:25 | [diff] [blame] | 632 | void OnSetupTransitionView(const std::string& markup); |
zhenw | e8f14fc | 2014-11-25 01:00:54 | [diff] [blame] | 633 | void OnBeginExitTransition(const std::string& css_selector, |
| 634 | bool exit_to_native_app); |
zhenw | 5a70789 | 2014-12-10 02:31:03 | [diff] [blame] | 635 | void OnRevertExitTransition(); |
zhenw | abf9b9d | 2014-11-15 04:04:18 | [diff] [blame] | 636 | void OnHideTransitionElements(const std::string& css_selector); |
| 637 | void OnShowTransitionElements(const std::string& css_selector); |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 638 | void OnSetAccessibilityMode(AccessibilityMode new_mode); |
dmazzoni | 83ba5c8 | 2015-04-14 07:11:51 | [diff] [blame] | 639 | void OnSnapshotAccessibilityTree(int callback_id); |
creis | bbbeb06 | 2014-08-25 18:20:31 | [diff] [blame] | 640 | void OnDisownOpener(); |
alexmos | 6b29456 | 2015-03-05 19:24:10 | [diff] [blame] | 641 | void OnDidUpdateSandboxFlags(SandboxFlags flags); |
dspell | e736c9db | 2015-04-03 04:53:16 | [diff] [blame] | 642 | void OnTextTrackSettingsChanged( |
| 643 | const FrameMsg_TextTrackSettings_Params& params); |
alexmos | e7da5a1 | 2015-04-09 02:22:16 | [diff] [blame] | 644 | void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params); |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 645 | #if defined(OS_ANDROID) |
| 646 | void OnSelectPopupMenuItems(bool canceled, |
| 647 | const std::vector<int>& selected_indices); |
| 648 | #elif defined(OS_MACOSX) |
| 649 | void OnSelectPopupMenuItem(int selected_index); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 650 | void OnCopyToFindPboard(); |
| 651 | #endif |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 652 | |
davidben | a5496d6 | 2014-10-07 18:52:04 | [diff] [blame] | 653 | void OnCommitNavigation(const ResourceResponseHead& response, |
| 654 | const GURL& stream_url, |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 655 | const CommonNavigationParams& common_params, |
clamy | 57b4b8e | 2015-03-24 13:32:11 | [diff] [blame] | 656 | const RequestNavigationParams& request_params); |
clamy | 62b271d | 2015-04-16 11:54:57 | [diff] [blame] | 657 | void OnFailedNavigation(const CommonNavigationParams& common_params, |
| 658 | const RequestNavigationParams& request_params, |
| 659 | bool has_stale_copy_in_cache, |
| 660 | int error_code); |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 661 | |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 662 | // Virtual since overridden by WebTestProxy for layout tests. |
| 663 | virtual blink::WebNavigationPolicy DecidePolicyForNavigation( |
| 664 | RenderFrame* render_frame, |
[email protected] | 0c3c54f | 2014-07-31 01:29:00 | [diff] [blame] | 665 | const NavigationPolicyInfo& info); |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 666 | void OpenURL(blink::WebFrame* frame, |
| 667 | const GURL& url, |
| 668 | const Referrer& referrer, |
| 669 | blink::WebNavigationPolicy policy); |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 670 | |
clamy | d698303 | 2015-04-29 14:48:12 | [diff] [blame] | 671 | // Performs a navigation in the frame. This provides a unified function for |
| 672 | // the current code path and the browser-side navigation path (in |
| 673 | // development). Currently used by OnNavigate, with all *NavigationParams |
| 674 | // provided by the browser. |stream_params| should be null. |
| 675 | // PlzNavigate: used by OnCommitNavigation, with |common_params| and |
| 676 | // |request_params| received by the browser. |stream_params| should be non |
| 677 | // null and created from the information provided by the browser. |
| 678 | // |start_params| is not used. |
| 679 | void NavigateInternal(const CommonNavigationParams& common_params, |
| 680 | const StartNavigationParams& start_params, |
| 681 | const RequestNavigationParams& request_params, |
| 682 | scoped_ptr<StreamOverrideParameters> stream_params); |
| 683 | |
[email protected] | ef3adfc | 2014-05-11 00:04:54 | [diff] [blame] | 684 | // Update current main frame's encoding and send it to browser window. |
| 685 | // Since we want to let users see the right encoding info from menu |
| 686 | // before finishing loading, we call the UpdateEncoding in |
| 687 | // a) function:DidCommitLoadForFrame. When this function is called, |
| 688 | // that means we have got first data. In here we try to get encoding |
| 689 | // of page if it has been specified in http header. |
| 690 | // b) function:DidReceiveTitle. When this function is called, |
| 691 | // that means we have got specified title. Because in most of webpages, |
| 692 | // title tags will follow meta tags. In here we try to get encoding of |
| 693 | // page if it has been specified in meta tag. |
| 694 | // c) function:DidFinishDocumentLoadForFrame. When this function is |
| 695 | // called, that means we have got whole html page. In here we should |
| 696 | // finally get right encoding of page. |
| 697 | void UpdateEncoding(blink::WebFrame* frame, |
| 698 | const std::string& encoding_name); |
| 699 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 700 | // Dispatches the current state of selection on the webpage to the browser if |
| 701 | // it has changed. |
| 702 | // TODO(varunjain): delete this method once we figure out how to keep |
| 703 | // selection handles in sync with the webpage. |
| 704 | void SyncSelectionIfRequired(); |
| 705 | |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 706 | bool RunJavaScriptMessage(JavaScriptMessageType type, |
| 707 | const base::string16& message, |
| 708 | const base::string16& default_value, |
| 709 | const GURL& frame_url, |
| 710 | base::string16* result); |
| 711 | |
[email protected] | 457736d | 2014-04-30 15:54:27 | [diff] [blame] | 712 | // Loads the appropriate error page for the specified failure into the frame. |
| 713 | void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request, |
| 714 | const blink::WebURLError& error, |
| 715 | bool replace); |
| 716 | |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 717 | void HandleJavascriptExecutionResult(const base::string16& javascript, |
| 718 | int id, |
| 719 | bool notify_result, |
deepak.s | 750d68f | 2015-04-30 07:32:41 | [diff] [blame] | 720 | v8::Local<v8::Value> result); |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 721 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 722 | // Initializes |web_user_media_client_|. If this fails, because it wasn't |
| 723 | // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then |
| 724 | // |web_user_media_client_| will remain NULL. |
| 725 | void InitializeUserMediaClient(); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 726 | |
| 727 | blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream( |
| 728 | const blink::WebURL& url, |
| 729 | blink::WebMediaPlayerClient* client); |
| 730 | |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 731 | // Creates a factory object used for creating audio and video renderers. |
| 732 | // The method is virtual so that layouttests can override it. |
| 733 | virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory(); |
| 734 | |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 735 | // Checks that the RenderView is ready to display the navigation to |url|. If |
sungmann.cho | 12349f0e | 2014-12-05 23:42:19 | [diff] [blame] | 736 | // the return value is false, the navigation should be abandoned. |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 737 | bool PrepareRenderViewForNavigation( |
| 738 | const GURL& url, |
avi | 2b17759 | 2014-12-10 02:08:02 | [diff] [blame] | 739 | bool is_history_navigation, |
clamy | 57b4b8e | 2015-03-24 13:32:11 | [diff] [blame] | 740 | const RequestNavigationParams& request_params, |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 741 | bool* is_reload, |
| 742 | blink::WebURLRequest::CachePolicy* cache_policy); |
| 743 | |
clamy | ece3888 | 2014-11-19 15:00:20 | [diff] [blame] | 744 | // PlzNavigate |
| 745 | // Sends a FrameHostMsg_BeginNavigation to the browser based on the contents |
| 746 | // of the WebURLRequest. |
| 747 | void BeginNavigation(blink::WebURLRequest* request); |
| 748 | |
clamy | 4cc9b820 | 2015-03-02 13:51:36 | [diff] [blame] | 749 | // Loads a data url. |
| 750 | void LoadDataURL(const CommonNavigationParams& params, |
| 751 | blink::WebFrame* frame); |
| 752 | |
clamy | 62b271d | 2015-04-16 11:54:57 | [diff] [blame] | 753 | // Sends a proper FrameHostMsg_DidFailProvisionalLoadWithError_Params IPC for |
| 754 | // the failed request |request|. |
| 755 | void SendFailedProvisionalLoad(const blink::WebURLRequest& request, |
| 756 | const blink::WebURLError& error, |
| 757 | blink::WebLocalFrame* frame); |
| 758 | |
| 759 | bool ShouldDisplayErrorPageForFailedLoad(int error_code, |
| 760 | const GURL& unreachable_url); |
| 761 | |
[email protected] | f3a9531 | 2014-06-12 16:46:58 | [diff] [blame] | 762 | // Returns the URL being loaded by the |frame_|'s request. |
| 763 | GURL GetLoadingUrl() const; |
| 764 | |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 765 | // If we initiated a navigation, this function will populate |document_state| |
| 766 | // with the navigation information saved in OnNavigate(). |
| 767 | void PopulateDocumentStateFromPending(DocumentState* document_state); |
| 768 | |
| 769 | // Returns a new NavigationState populated with the navigation information |
| 770 | // saved in OnNavigate(). |
| 771 | NavigationState* CreateNavigationStateFromPending(); |
| 772 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 773 | #if defined(OS_ANDROID) |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 774 | blink::WebMediaPlayer* CreateAndroidWebMediaPlayer( |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 775 | const blink::WebURL& url, |
jrummell | 65b7d27 | 2014-09-24 20:49:27 | [diff] [blame] | 776 | blink::WebMediaPlayerClient* client, |
xhwang | 60b430a | 2015-02-01 05:20:46 | [diff] [blame] | 777 | media::MediaPermission* media_permission, |
jrummell | 65b7d27 | 2014-09-24 20:49:27 | [diff] [blame] | 778 | blink::WebContentDecryptionModule* initial_cdm); |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 779 | |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 780 | RendererMediaPlayerManager* GetMediaPlayerManager(); |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 781 | #endif |
| 782 | |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 783 | media::MediaPermission* GetMediaPermission(); |
| 784 | media::CdmFactory* GetCdmFactory(); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 785 | |
creis | cfaa446 | 2015-03-16 19:27:18 | [diff] [blame] | 786 | // Stores the WebLocalFrame we are associated with. This is null from the |
| 787 | // constructor until SetWebFrame is called, and it is null after |
| 788 | // frameDetached is called until destruction (which is asynchronous in the |
| 789 | // case of the main frame, but not subframes). |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 790 | blink::WebLocalFrame* frame_; |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 791 | |
dgozman | 358ba32 | 2015-03-26 15:05:30 | [diff] [blame] | 792 | // Frame is a local root if it is rendered in a process different than parent |
| 793 | // or it is a main frame. |
| 794 | bool is_local_root_; |
| 795 | |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 796 | base::WeakPtr<RenderViewImpl> render_view_; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 797 | int routing_id_; |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 798 | bool is_swapped_out_; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 799 | // RenderFrameProxy exists only when is_swapped_out_ is true. |
| 800 | // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 801 | // RenderFrame. See https://crbug.com/357747. |
| 802 | RenderFrameProxy* render_frame_proxy_; |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 803 | bool is_detaching_; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 804 | |
japhet | e6adf14 | 2014-10-31 00:01:49 | [diff] [blame] | 805 | // If this frame was created to replace a proxy, this will store the routing |
| 806 | // id of the proxy to replace at commit-time, at which time it will be |
| 807 | // cleared. |
| 808 | // TODO(creis): Remove this after switching to PlzNavigate. |
| 809 | int proxy_routing_id_; |
| 810 | |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 811 | // Used when the RenderFrame is a local root. For now, RenderWidgets are |
| 812 | // added only when a child frame is in a different process from its parent |
| 813 | // frame, but eventually this will also apply to top-level frames. |
| 814 | // TODO(kenrb): Correct the above statement when top-level frames have their |
| 815 | // own RenderWidgets. |
| 816 | scoped_refptr<RenderWidget> render_widget_; |
| 817 | |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 818 | // Temporarily holds state pertaining to a navigation that has been initiated |
| 819 | // until the NavigationState corresponding to the new navigation is created in |
| 820 | // didCreateDataSource(). |
| 821 | scoped_ptr<NavigationParams> pending_navigation_params_; |
| 822 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 823 | #if defined(ENABLE_PLUGINS) |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 824 | // Current text input composition text. Empty if no composition is in |
| 825 | // progress. |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 826 | base::string16 pepper_composition_text_; |
tommycli | eb25b2a | 2014-11-03 19:45:09 | [diff] [blame] | 827 | |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 828 | PluginPowerSaverHelper* plugin_power_saver_helper_; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 829 | #endif |
| 830 | |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 831 | RendererWebCookieJarImpl cookie_jar_; |
| 832 | |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 833 | // All the registered observers. |
| 834 | ObserverList<RenderFrameObserver> observers_; |
| 835 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 836 | scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
| 837 | |
[email protected] | 4ecee35 | 2014-03-11 21:12:19 | [diff] [blame] | 838 | // The node that the context menu was pressed over. |
| 839 | blink::WebNode context_menu_node_; |
| 840 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 841 | // External context menu requests we're waiting for. "Internal" |
| 842 | // (WebKit-originated) context menu events will have an ID of 0 and will not |
| 843 | // be in this map. |
| 844 | // |
| 845 | // We don't want to add internal ones since some of the "special" page |
| 846 | // handlers in the browser process just ignore the context menu requests so |
| 847 | // avoid showing context menus, and so this will cause right clicks to leak |
| 848 | // entries in this map. Most users of the custom context menu (e.g. Pepper |
| 849 | // plugins) are normally only on "regular" pages and the regular pages will |
| 850 | // always respond properly to the request, so we don't have to worry so |
| 851 | // much about leaks. |
| 852 | IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; |
| 853 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 854 | // The text selection the last time DidChangeSelection got called. May contain |
| 855 | // additional characters before and after the selected text, for IMEs. The |
| 856 | // portion of this string that is the actual selected text starts at index |
| 857 | // |selection_range_.GetMin() - selection_text_offset_| and has length |
| 858 | // |selection_range_.length()|. |
| 859 | base::string16 selection_text_; |
| 860 | // The offset corresponding to the start of |selection_text_| in the document. |
| 861 | size_t selection_text_offset_; |
| 862 | // Range over the document corresponding to the actual selected text (which |
| 863 | // could correspond to a substring of |selection_text_|; see above). |
| 864 | gfx::Range selection_range_; |
| 865 | // Used to inform didChangeSelection() when it is called in the context |
| 866 | // of handling a InputMsg_SelectRange IPC. |
| 867 | bool handling_select_range_; |
| 868 | |
[email protected] | 2626d14 | 2014-04-22 17:24:02 | [diff] [blame] | 869 | // The next group of objects all implement RenderFrameObserver, so are deleted |
| 870 | // along with the RenderFrame automatically. This is why we just store weak |
| 871 | // references. |
| 872 | |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 873 | // Dispatches permission requests for Web Notifications. |
| 874 | NotificationPermissionDispatcher* notification_permission_dispatcher_; |
| 875 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 876 | // Destroyed via the RenderFrameObserver::OnDestruct() mechanism. |
perkj | 1a2d043 | 2014-09-03 13:52:33 | [diff] [blame] | 877 | UserMediaClientImpl* web_user_media_client_; |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 878 | |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 879 | // EncryptedMediaClient attached to this frame; lazily initialized. |
xhwang | 430baee | 2015-01-22 05:46:20 | [diff] [blame] | 880 | scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_; |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 881 | |
xhwang | 36b1f3b | 2015-01-27 17:54:01 | [diff] [blame] | 882 | // The media permission dispatcher attached to this frame, lazily initialized. |
| 883 | MediaPermissionDispatcher* media_permission_dispatcher_; |
| 884 | |
[email protected] | 52d3e17 | 2014-06-16 16:57:02 | [diff] [blame] | 885 | // MidiClient attached to this frame; lazily initialized. |
| 886 | MidiDispatcher* midi_dispatcher_; |
| 887 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 888 | #if defined(OS_ANDROID) |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 889 | // Manages all media players in this render frame for communicating with the |
| 890 | // real media player in the browser process. It's okay to use a raw pointer |
| 891 | // since it's a RenderFrameObserver. |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 892 | RendererMediaPlayerManager* media_player_manager_; |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 893 | #endif |
| 894 | |
| 895 | #if defined(ENABLE_BROWSER_CDMS) |
| 896 | // Manage all CDMs in this render frame for communicating with the real CDM in |
| 897 | // the browser process. It's okay to use a raw pointer since it's a |
| 898 | // RenderFrameObserver. |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 899 | RendererCdmManager* cdm_manager_; |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 900 | #endif |
| 901 | |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 902 | // The CDM factory attached to this frame, lazily initialized. |
| 903 | RenderCdmFactory* cdm_factory_; |
| 904 | |
[email protected] | a6e21c37 | 2014-07-12 02:27:21 | [diff] [blame] | 905 | #if defined(VIDEO_HOLE) |
| 906 | // Whether or not this RenderFrameImpl contains a media player. Used to |
| 907 | // register as an observer for video-hole-specific events. |
| 908 | bool contains_media_player_; |
| 909 | #endif |
| 910 | |
dgozman | 358ba32 | 2015-03-26 15:05:30 | [diff] [blame] | 911 | // The devtools agent for this frame; only created for main frame and |
| 912 | // local roots. |
| 913 | DevToolsAgent* devtools_agent_; |
| 914 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 915 | // The geolocation dispatcher attached to this frame, lazily initialized. |
[email protected] | 8eae080 | 2014-06-02 21:35:55 | [diff] [blame] | 916 | GeolocationDispatcher* geolocation_dispatcher_; |
| 917 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 918 | // The push messaging dispatcher attached to this frame, lazily initialized. |
| 919 | PushMessagingDispatcher* push_messaging_dispatcher_; |
| 920 | |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 921 | // The presentation dispatcher implementation attached to this frame, lazily |
| 922 | // initialized. |
| 923 | PresentationDispatcher* presentation_dispatcher_; |
| 924 | |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 925 | ServiceRegistryImpl service_registry_; |
| 926 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 927 | // The screen orientation dispatcher attached to the frame, lazily |
| 928 | // initialized. |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 929 | ScreenOrientationDispatcher* screen_orientation_dispatcher_; |
| 930 | |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame] | 931 | // The Manifest Manager handles the manifest requests from the browser |
| 932 | // process. |
| 933 | ManifestManager* manifest_manager_; |
| 934 | |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 935 | // The current accessibility mode. |
| 936 | AccessibilityMode accessibility_mode_; |
| 937 | |
| 938 | // Only valid if |accessibility_mode_| is anything other than |
| 939 | // AccessibilityModeOff. |
| 940 | RendererAccessibility* renderer_accessibility_; |
| 941 | |
mlamouri | c6d31db | 2015-03-28 17:48:14 | [diff] [blame] | 942 | scoped_ptr<PermissionDispatcher> permission_client_; |
mlamouri | 670a86d | 2015-03-17 16:06:25 | [diff] [blame] | 943 | |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 944 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 945 | // The external popup for the currently showing select popup. |
| 946 | scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
| 947 | #endif |
| 948 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 949 | base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 950 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 951 | DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 952 | }; |
| 953 | |
| 954 | } // namespace content |
| 955 | |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 956 | #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |