[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 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
| 10 | |
guidou | 3906a72 | 2015-11-12 22:14:42 | [diff] [blame] | 11 | #include <string> |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 12 | #include <vector> |
| 13 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 14 | #include "base/files/file_path.h" |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 15 | #include "base/gtest_prod_util.h" |
| 16 | #include "base/id_map.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 17 | #include "base/macros.h" |
hubbe | 5f0ad43b | 2015-12-14 20:57:26 | [diff] [blame] | 18 | #include "base/memory/linked_ptr.h" |
xhwang | 430baee | 2015-01-22 05:46:20 | [diff] [blame] | 19 | #include "base/memory/scoped_ptr.h" |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 20 | #include "base/memory/weak_ptr.h" |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 21 | #include "base/observer_list.h" |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 22 | #include "base/process/process_handle.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 23 | #include "build/build_config.h" |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 24 | #include "content/common/accessibility_mode_enums.h" |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 25 | #include "content/common/frame_message_enums.h" |
rockot | f8fdd9b | 2015-12-16 22:22:35 | [diff] [blame] | 26 | #include "content/common/mojo/service_registry_impl.h" |
peter | 4eb24200 | 2015-06-02 12:45:13 | [diff] [blame] | 27 | #include "content/public/common/console_message_level.h" |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 28 | #include "content/public/common/javascript_message_type.h" |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 29 | #include "content/public/common/referrer.h" |
paulmeyer | 5d0a5f0 | 2016-01-21 20:15:52 | [diff] [blame] | 30 | #include "content/public/common/stop_find_action.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 31 | #include "content/public/renderer/render_frame.h" |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 32 | #include "content/renderer/render_frame_proxy.h" |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 33 | #include "content/renderer/renderer_webcookiejar_impl.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 34 | #include "ipc/ipc_message.h" |
lukasza | 70b79c8 | 2015-12-14 20:24:13 | [diff] [blame] | 35 | #include "ipc/ipc_platform_file.h" |
acolwell | 9e0840d | 2014-09-06 19:01:32 | [diff] [blame] | 36 | #include "media/blink/webmediaplayer_delegate.h" |
dalecurtis | 49f36388 | 2015-08-25 21:05:38 | [diff] [blame] | 37 | #include "media/blink/webmediaplayer_params.h" |
ben | 9578795 | 2016-02-10 07:46:20 | [diff] [blame] | 38 | #include "mojo/shell/public/interfaces/interface_provider.mojom.h" |
ben | 273c1e3 | 2016-01-12 02:44:08 | [diff] [blame] | 39 | #include "mojo/shell/public/interfaces/shell.mojom.h" |
alexmos | 401f0aba | 2015-12-06 10:07:39 | [diff] [blame] | 40 | #include "third_party/WebKit/public/platform/WebFocusType.h" |
sandersd | f92f4e5c | 2016-01-22 20:57:22 | [diff] [blame] | 41 | #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
benwells | 04ab5b96 | 2015-05-06 08:29:40 | [diff] [blame] | 42 | #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClient.h" |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 43 | #include "third_party/WebKit/public/web/WebAXObject.h" |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 44 | #include "third_party/WebKit/public/web/WebDataSource.h" |
| 45 | #include "third_party/WebKit/public/web/WebFrameClient.h" |
boliu | 15890e4 | 2015-11-24 23:08:05 | [diff] [blame] | 46 | #include "third_party/WebKit/public/web/WebFrameLoadType.h" |
lazyboy | 70605c3 | 2015-11-03 01:27:31 | [diff] [blame] | 47 | #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
lukasza | 902fcc5 | 2015-12-31 04:45:29 | [diff] [blame] | 48 | #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 49 | #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
skyostil | c3ed565 | 2015-10-19 16:28:46 | [diff] [blame] | 50 | #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
twellington | 376424ad | 2015-05-04 18:57:25 | [diff] [blame] | 51 | #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 52 | #include "ui/gfx/range/range.h" |
lukasza | ede9cc0 | 2015-12-30 23:48:32 | [diff] [blame] | 53 | #include "url/gurl.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 54 | |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 55 | #if defined(ENABLE_PLUGINS) |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 56 | #include "content/renderer/pepper/plugin_power_saver_helper.h" |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 57 | #endif |
| 58 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 59 | #if defined(OS_ANDROID) |
| 60 | #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 61 | #endif |
| 62 | |
xhwang | c0299ae3 | 2015-07-21 23:39:50 | [diff] [blame] | 63 | #if defined(ENABLE_MOJO_MEDIA) |
jbroman | b73f258 | 2016-01-11 16:35:05 | [diff] [blame] | 64 | #include "media/mojo/interfaces/service_factory.mojom.h" // nogncheck |
xhwang | c0299ae3 | 2015-07-21 23:39:50 | [diff] [blame] | 65 | #endif |
| 66 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 67 | class TransportDIB; |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 68 | struct FrameMsg_NewFrame_WidgetParams; |
alexmos | e7da5a1 | 2015-04-09 02:22:16 | [diff] [blame] | 69 | struct FrameMsg_PostMessage_Params; |
lukasza | ede9cc0 | 2015-12-30 23:48:32 | [diff] [blame] | 70 | struct FrameMsg_SerializeAsMHTML_Params; |
dspell | e736c9db | 2015-04-03 04:53:16 | [diff] [blame] | 71 | struct FrameMsg_TextTrackSettings_Params; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 72 | |
| 73 | namespace blink { |
[email protected] | 5ee7f18 | 2014-04-25 19:45:26 | [diff] [blame] | 74 | class WebGeolocationClient; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 75 | class WebMouseEvent; |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 76 | class WebContentDecryptionModule; |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 77 | class WebPresentationClient; |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 78 | class WebPushClient; |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 79 | class WebSecurityOrigin; |
alogvinov | f50445a | 2015-10-30 13:00:12 | [diff] [blame] | 80 | class WebWakeLockClient; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 81 | struct WebCompositionUnderline; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 82 | struct WebContextMenuData; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 83 | struct WebCursorInfo; |
paulmeyer | 5d0a5f0 | 2016-01-21 20:15:52 | [diff] [blame] | 84 | struct WebFindOptions; |
dcheng | 3ce04b6 | 2015-10-26 23:30:55 | [diff] [blame] | 85 | struct WebScreenInfo; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | namespace gfx { |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 89 | class Point; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 90 | class Range; |
| 91 | class Rect; |
| 92 | } |
| 93 | |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 94 | namespace media { |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 95 | class CdmFactory; |
xhwang | 60b430a | 2015-02-01 05:20:46 | [diff] [blame] | 96 | class MediaPermission; |
hubbe | 5f0ad43b | 2015-12-14 20:57:26 | [diff] [blame] | 97 | class MediaServiceProvider; |
dalecurtis | a12e606 | 2015-11-10 23:13:14 | [diff] [blame] | 98 | class RendererWebMediaPlayerDelegate; |
hubbe | 5f0ad43b | 2015-12-14 20:57:26 | [diff] [blame] | 99 | class UrlIndex; |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 100 | class WebEncryptedMediaClientImpl; |
| 101 | } |
| 102 | |
xhwang | 33f939e | 2015-06-23 04:33:42 | [diff] [blame] | 103 | namespace mojo { |
| 104 | class ServiceProvider; |
| 105 | } |
| 106 | |
tommycli | 58e3172c | 2015-09-15 18:18:26 | [diff] [blame] | 107 | namespace url { |
| 108 | class Origin; |
| 109 | } |
| 110 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 111 | namespace content { |
| 112 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 113 | class ChildFrameCompositingHelper; |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 114 | class CompositorDependencies; |
dgozman | 358ba32 | 2015-03-26 15:05:30 | [diff] [blame] | 115 | class DevToolsAgent; |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 116 | class DocumentState; |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 117 | class ExternalPopupMenu; |
[email protected] | 8eae080 | 2014-06-02 21:35:55 | [diff] [blame] | 118 | class GeolocationDispatcher; |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame] | 119 | class ManifestManager; |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 120 | class MediaStreamDispatcher; |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 121 | class MediaStreamRendererFactory; |
xhwang | 5206d4e6 | 2016-02-05 02:09:55 | [diff] [blame] | 122 | class MediaPermissionDispatcher; |
[email protected] | 52d3e17 | 2014-06-16 16:57:02 | [diff] [blame] | 123 | class MidiDispatcher; |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 124 | class NavigationState; |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 125 | class NotificationPermissionDispatcher; |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 126 | class PageState; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 127 | class PepperPluginInstanceImpl; |
mlamouri | c6d31db | 2015-03-28 17:48:14 | [diff] [blame] | 128 | class PermissionDispatcher; |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 129 | class PresentationDispatcher; |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 130 | class PushMessagingDispatcher; |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 131 | class RendererAccessibility; |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 132 | class RendererCdmManager; |
| 133 | class RendererMediaPlayerManager; |
davve | 859f4f9 | 2015-11-27 10:16:19 | [diff] [blame] | 134 | class RendererMediaSessionManager; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 135 | class RendererPpapiHost; |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 136 | class RenderFrameObserver; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 137 | class RenderViewImpl; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 138 | class RenderWidget; |
| 139 | class RenderWidgetFullscreenPepper; |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 140 | class ScreenOrientationDispatcher; |
perkj | 1a2d043 | 2014-09-03 13:52:33 | [diff] [blame] | 141 | class UserMediaClientImpl; |
alogvinov | f50445a | 2015-10-30 13:00:12 | [diff] [blame] | 142 | class WakeLockDispatcher; |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 143 | struct CommonNavigationParams; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 144 | struct CustomContextMenuContext; |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 145 | struct FrameReplicationState; |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 146 | struct NavigationParams; |
clamy | 79b3da6 | 2014-10-14 08:50:37 | [diff] [blame] | 147 | struct RequestNavigationParams; |
davidben | a5496d6 | 2014-10-07 18:52:04 | [diff] [blame] | 148 | struct ResourceResponseHead; |
clamy | 34e1278 | 2015-03-12 11:26:13 | [diff] [blame] | 149 | struct StartNavigationParams; |
clamy | d698303 | 2015-04-29 14:48:12 | [diff] [blame] | 150 | struct StreamOverrideParameters; |
bajones | 0244353 | 2015-06-22 21:17:40 | [diff] [blame] | 151 | class VRDispatcher; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 152 | |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 153 | class CONTENT_EXPORT RenderFrameImpl |
| 154 | : public RenderFrame, |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 155 | NON_EXPORTED_BASE(public blink::WebFrameClient), |
lukasza | 902fcc5 | 2015-12-31 04:45:29 | [diff] [blame] | 156 | NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 157 | public: |
dcheng | c5ef1a5 | 2015-08-26 20:58:30 | [diff] [blame] | 158 | // Creates a new RenderFrame as the main frame of |render_view|. |
dcheng | 3ce04b6 | 2015-10-26 23:30:55 | [diff] [blame] | 159 | static RenderFrameImpl* CreateMainFrame( |
| 160 | RenderViewImpl* render_view, |
| 161 | int32_t routing_id, |
| 162 | int32_t widget_routing_id, |
| 163 | bool hidden, |
| 164 | const blink::WebScreenInfo& screen_info, |
| 165 | CompositorDependencies* compositor_deps); |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 166 | |
alexmos | a181efc | 2015-09-03 00:39:04 | [diff] [blame] | 167 | // Creates a new RenderFrame with |routing_id|. If |proxy_routing_id| is |
| 168 | // MSG_ROUTING_NONE, it creates the Blink WebLocalFrame and inserts it into |
| 169 | // the frame tree after the frame identified by |
| 170 | // |previous_sibling_routing_id|, or as the first child if |
alexmos | 9f8705a | 2015-05-06 19:58:59 | [diff] [blame] | 171 | // |previous_sibling_routing_id| is MSG_ROUTING_NONE. Otherwise, the frame is |
| 172 | // semi-orphaned until it commits, at which point it replaces the proxy |
alexmos | a181efc | 2015-09-03 00:39:04 | [diff] [blame] | 173 | // identified by |proxy_routing_id|. The frame's opener is set to the frame |
| 174 | // identified by |opener_routing_id|. The frame is created as a child of the |
| 175 | // RenderFrame identified by |parent_routing_id| or as the top-level frame if |
| 176 | // the latter is MSG_ROUTING_NONE. Note: This is called only when |
alexmos | 9f8705a | 2015-05-06 19:58:59 | [diff] [blame] | 177 | // RenderFrame is being created in response to IPC message from the browser |
| 178 | // process. All other frame creation is driven through Blink and Create. |
lazyboy | 70605c3 | 2015-11-03 01:27:31 | [diff] [blame] | 179 | static void CreateFrame( |
| 180 | int routing_id, |
| 181 | int proxy_routing_id, |
| 182 | int opener_routing_id, |
| 183 | int parent_routing_id, |
| 184 | int previous_sibling_routing_id, |
| 185 | const FrameReplicationState& replicated_state, |
| 186 | CompositorDependencies* compositor_deps, |
| 187 | const FrameMsg_NewFrame_WidgetParams& params, |
| 188 | const blink::WebFrameOwnerProperties& frameOwner_properties); |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 189 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 190 | // Returns the RenderFrameImpl for the given routing ID. |
| 191 | static RenderFrameImpl* FromRoutingID(int routing_id); |
| 192 | |
[email protected] | a5ac6dc | 2014-01-15 07:02:14 | [diff] [blame] | 193 | // Just like RenderFrame::FromWebFrame but returns the implementation. |
| 194 | static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 195 | |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 196 | // Used by content_layouttest_support to hook into the creation of |
| 197 | // RenderFrameImpls. |
jochen | 664198b | 2015-06-25 14:13:00 | [diff] [blame] | 198 | struct CreateParams { |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 199 | CreateParams(RenderViewImpl* render_view, int32_t routing_id) |
jochen | 664198b | 2015-06-25 14:13:00 | [diff] [blame] | 200 | : render_view(render_view), routing_id(routing_id) {} |
| 201 | ~CreateParams() {} |
| 202 | |
| 203 | RenderViewImpl* render_view; |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 204 | int32_t routing_id; |
jochen | 664198b | 2015-06-25 14:13:00 | [diff] [blame] | 205 | }; |
| 206 | |
| 207 | using CreateRenderFrameImplFunction = |
| 208 | RenderFrameImpl* (*)(const CreateParams&); |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 209 | static void InstallCreateHook( |
dongseong.hwang | b721ddf | 2014-12-10 21:22:50 | [diff] [blame] | 210 | CreateRenderFrameImplFunction create_render_frame_impl); |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 211 | |
alexmos | 9573300 | 2015-08-24 16:38:09 | [diff] [blame] | 212 | // Looks up and returns the WebFrame corresponding to a given opener frame |
| 213 | // routing ID. Also stores the opener's RenderView routing ID into |
| 214 | // |opener_view_routing_id|. |
| 215 | // |
| 216 | // TODO(alexmos): remove RenderViewImpl's dependency on |
| 217 | // opener_view_routing_id. |
| 218 | static blink::WebFrame* ResolveOpener(int opener_frame_routing_id, |
| 219 | int* opener_view_routing_id); |
| 220 | |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 221 | ~RenderFrameImpl() override; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 222 | |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 223 | bool is_swapped_out() const { |
| 224 | return is_swapped_out_; |
| 225 | } |
| 226 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 227 | // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 228 | // RenderFrames. See https://crbug.com/357747. |
| 229 | void set_render_frame_proxy(RenderFrameProxy* proxy) { |
| 230 | render_frame_proxy_ = proxy; |
| 231 | } |
| 232 | |
dglazkov | f0e1d6d | 2015-10-10 02:13:48 | [diff] [blame] | 233 | // Called by RenderWidget when meaningful layout has happened. |
| 234 | // See RenderFrameObserver::DidMeaningfulLayout declaration for details. |
| 235 | void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type); |
| 236 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 237 | // Out-of-process child frames receive a signal from RenderWidgetCompositor |
| 238 | // when a compositor frame has committed. |
| 239 | void DidCommitCompositorFrame(); |
| 240 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 241 | // TODO(jam): this is a temporary getter until all the code is transitioned |
| 242 | // to using RenderFrame instead of RenderView. |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 243 | RenderViewImpl* render_view() { return render_view_.get(); } |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 244 | |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 245 | RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; } |
| 246 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 247 | // Returns the RenderWidget associated with this frame. |
| 248 | RenderWidget* GetRenderWidget(); |
| 249 | |
dgozman | cf9039cd | 2015-04-06 12:01:31 | [diff] [blame] | 250 | DevToolsAgent* devtools_agent() { return devtools_agent_; } |
| 251 | |
[email protected] | 0287e76 | 2014-04-11 13:07:58 | [diff] [blame] | 252 | // This method must be called after the frame has been added to the frame |
| 253 | // tree. It creates all objects that depend on the frame being at its proper |
| 254 | // spot. |
| 255 | void Initialize(); |
| 256 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 257 | // Notifications from RenderWidget. |
| 258 | void WasHidden(); |
| 259 | void WasShown(); |
dgozman | cf9039cd | 2015-04-06 12:01:31 | [diff] [blame] | 260 | void WidgetWillClose(); |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 261 | |
[email protected] | 723971b | 2014-02-12 11:08:25 | [diff] [blame] | 262 | // Start/Stop loading notifications. |
| 263 | // TODO(nasko): Those are page-level methods at this time and come from |
| 264 | // WebViewClient. We should move them to be WebFrameClient calls and put |
| 265 | // logic in the browser side to balance starts/stops. |
[email protected] | e3b10d1 | 2014-03-28 16:06:09 | [diff] [blame] | 266 | // |to_different_document| will be true unless the load is a fragment |
| 267 | // navigation, or triggered by history.pushState/replaceState. |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 268 | void didStartLoading(bool to_different_document) override; |
| 269 | void didStopLoading() override; |
| 270 | void didChangeLoadProgress(double load_progress) override; |
[email protected] | 723971b | 2014-02-12 11:08:25 | [diff] [blame] | 271 | |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 272 | AccessibilityMode accessibility_mode() { |
| 273 | return accessibility_mode_; |
| 274 | } |
| 275 | |
| 276 | RendererAccessibility* renderer_accessibility() { |
| 277 | return renderer_accessibility_; |
| 278 | } |
| 279 | |
| 280 | void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 281 | blink::WebAXEvent event); |
| 282 | |
estade | 31c5434 | 2015-01-23 03:34:36 | [diff] [blame] | 283 | // The focused node changed to |node|. If focus was lost from this frame, |
| 284 | // |node| will be null. |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 285 | void FocusedNodeChanged(const blink::WebNode& node); |
| 286 | |
estade | 31c5434 | 2015-01-23 03:34:36 | [diff] [blame] | 287 | // TODO(dmazzoni): the only reason this is here is to plumb it through to |
| 288 | // RendererAccessibility. It should use the RenderFrameObserver method, once |
| 289 | // blink has a separate accessibility tree per frame. |
| 290 | void FocusedNodeChangedForAccessibility(const blink::WebNode& node); |
| 291 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 292 | #if defined(ENABLE_PLUGINS) |
paulmeyer | 5d0a5f0 | 2016-01-21 20:15:52 | [diff] [blame] | 293 | // Get/set the plugin which will be used to handle document find requests. |
| 294 | void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) { |
| 295 | plugin_find_handler_ = plugin; |
| 296 | } |
| 297 | PepperPluginInstanceImpl* plugin_find_handler() { |
| 298 | return plugin_find_handler_; |
| 299 | } |
| 300 | |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 301 | // Notification that a PPAPI plugin has been created. |
| 302 | void PepperPluginCreated(RendererPpapiHost* host); |
| 303 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 304 | // Notifies that |instance| has changed the cursor. |
| 305 | // This will update the cursor appearance if it is currently over the plugin |
| 306 | // instance. |
| 307 | void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
| 308 | const blink::WebCursorInfo& cursor); |
| 309 | |
| 310 | // Notifies that |instance| has received a mouse event. |
| 311 | void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance); |
| 312 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 313 | // Informs the render view that a PPAPI plugin has changed text input status. |
| 314 | void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance); |
| 315 | void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance); |
| 316 | |
| 317 | // Cancels current composition. |
| 318 | void PepperCancelComposition(PepperPluginInstanceImpl* instance); |
| 319 | |
| 320 | // Informs the render view that a PPAPI plugin has changed selection. |
| 321 | void PepperSelectionChanged(PepperPluginInstanceImpl* instance); |
| 322 | |
| 323 | // Creates a fullscreen container for a pepper plugin instance. |
| 324 | RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer( |
| 325 | PepperPluginInstanceImpl* plugin); |
| 326 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 327 | bool IsPepperAcceptingCompositionEvents() const; |
| 328 | |
| 329 | // Notification that the given plugin has crashed. |
| 330 | void PluginCrashed(const base::FilePath& plugin_path, |
| 331 | base::ProcessId plugin_pid); |
| 332 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 333 | // Simulates IME events for testing purpose. |
| 334 | void SimulateImeSetComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 335 | const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 336 | const std::vector<blink::WebCompositionUnderline>& underlines, |
| 337 | int selection_start, |
| 338 | int selection_end); |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 339 | void SimulateImeConfirmComposition(const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 340 | const gfx::Range& replacement_range); |
| 341 | |
| 342 | // TODO(jam): remove these once the IPC handler moves from RenderView to |
| 343 | // RenderFrame. |
| 344 | void OnImeSetComposition( |
tommycli | e6633ca7 | 2014-10-31 00:40:42 | [diff] [blame] | 345 | const base::string16& text, |
| 346 | const std::vector<blink::WebCompositionUnderline>& underlines, |
| 347 | int selection_start, |
| 348 | int selection_end); |
| 349 | void OnImeConfirmComposition(const base::string16& text, |
| 350 | const gfx::Range& replacement_range, |
| 351 | bool keep_selection); |
| 352 | #endif // defined(ENABLE_PLUGINS) |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 353 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 354 | // May return NULL in some cases, especially if userMediaClient() returns |
| 355 | // NULL. |
| 356 | MediaStreamDispatcher* GetMediaStreamDispatcher(); |
| 357 | |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 358 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 359 | void DidHideExternalPopupMenu(); |
| 360 | #endif |
| 361 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 362 | // IPC::Sender |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 363 | bool Send(IPC::Message* msg) override; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 364 | |
| 365 | // IPC::Listener |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 366 | bool OnMessageReceived(const IPC::Message& msg) override; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 367 | |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 368 | // RenderFrame implementation: |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 369 | RenderView* GetRenderView() override; |
| 370 | int GetRoutingID() override; |
| 371 | blink::WebLocalFrame* GetWebFrame() override; |
estade | 78d655f8 | 2015-01-30 01:55:08 | [diff] [blame] | 372 | blink::WebElement GetFocusedElement() const override; |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 373 | WebPreferences& GetWebkitPreferences() override; |
| 374 | int ShowContextMenu(ContextMenuClient* client, |
| 375 | const ContextMenuParams& params) override; |
| 376 | void CancelContextMenu(int request_id) override; |
| 377 | blink::WebNode GetContextMenuNode() const override; |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 378 | blink::WebPlugin* CreatePlugin( |
| 379 | blink::WebFrame* frame, |
| 380 | const WebPluginInfo& info, |
| 381 | const blink::WebPluginParams& params, |
tommycli | e872270 | 2015-01-16 11:40:41 | [diff] [blame] | 382 | scoped_ptr<PluginInstanceThrottler> throttler) override; |
japhet | b0bae9d8 | 2015-10-19 20:43:40 | [diff] [blame] | 383 | void LoadURLExternally(const blink::WebURLRequest& request, |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 384 | blink::WebNavigationPolicy policy) override; |
| 385 | void ExecuteJavaScript(const base::string16& javascript) override; |
dglazkov | 2e140f5 | 2015-09-28 16:10:07 | [diff] [blame] | 386 | bool IsMainFrame() override; |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 387 | bool IsHidden() override; |
| 388 | ServiceRegistry* GetServiceRegistry() override; |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 389 | #if defined(ENABLE_PLUGINS) |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 390 | void RegisterPeripheralPlugin( |
tommycli | 58e3172c | 2015-09-15 18:18:26 | [diff] [blame] | 391 | const url::Origin& content_origin, |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 392 | const base::Closure& unthrottle_callback) override; |
tommycli | 9c7cbd9 | 2015-12-18 23:34:34 | [diff] [blame] | 393 | RenderFrame::PeripheralContentStatus GetPeripheralContentStatus( |
| 394 | const url::Origin& main_frame_origin, |
| 395 | const url::Origin& content_origin, |
| 396 | const gfx::Size& unobscured_size) const override; |
tommycli | bae63b9 | 2015-10-23 02:56:20 | [diff] [blame] | 397 | void WhitelistContentOrigin(const url::Origin& content_origin) override; |
tommycli | d481c48 | 2014-12-03 01:50:41 | [diff] [blame] | 398 | #endif |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 399 | bool IsFTPDirectoryListing() override; |
| 400 | void AttachGuest(int element_instance_id) override; |
fsamuel | a95fef4 | 2014-12-03 20:16:52 | [diff] [blame] | 401 | void DetachGuest(int element_instance_id) override; |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 402 | void SetSelectedText(const base::string16& selection_text, |
| 403 | size_t offset, |
| 404 | const gfx::Range& range) override; |
| 405 | void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, |
dcarney | 4410a7c9 | 2015-04-20 11:28:19 | [diff] [blame] | 406 | v8::Local<v8::Context> context) override; |
rdevlin.cronin | b2cec91 | 2015-06-24 20:36:01 | [diff] [blame] | 407 | void AddMessageToConsole(ConsoleMessageLevel level, |
| 408 | const std::string& message) override; |
megjablon | d5ac7d5 | 2015-10-22 23:56:12 | [diff] [blame] | 409 | bool IsUsingLoFi() const override; |
ellyjones | db20fae1 | 2015-12-04 16:47:55 | [diff] [blame] | 410 | bool IsPasting() const override; |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 411 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 412 | // blink::WebFrameClient implementation: |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 413 | blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
| 414 | const blink::WebPluginParams& params) override; |
| 415 | blink::WebMediaPlayer* createMediaPlayer( |
sandersd | f92f4e5c | 2016-01-22 20:57:22 | [diff] [blame] | 416 | blink::WebMediaPlayer::LoadType load_type, |
srirama.m | 26f864d0 | 2015-07-14 05:21:46 | [diff] [blame] | 417 | const blink::WebURL& url, |
| 418 | blink::WebMediaPlayerClient* client, |
| 419 | blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
guidou | 9c3cc3e | 2015-10-27 13:38:15 | [diff] [blame] | 420 | blink::WebContentDecryptionModule* initial_cdm, |
davve | add785e7 | 2016-01-26 17:40:36 | [diff] [blame] | 421 | const blink::WebString& sink_id, |
| 422 | blink::WebMediaSession* media_session) override; |
davve | 50137b6 | 2015-10-23 12:15:21 | [diff] [blame] | 423 | blink::WebMediaSession* createMediaSession() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 424 | blink::WebApplicationCacheHost* createApplicationCacheHost( |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 425 | blink::WebApplicationCacheHostClient* client) override; |
| 426 | blink::WebWorkerContentSettingsClientProxy* |
avi | 01681ef | 2016-02-16 17:53:57 | [diff] [blame^] | 427 | createWorkerContentSettingsClientProxy() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 428 | blink::WebExternalPopupMenu* createExternalPopupMenu( |
[email protected] | b20c322 | 2014-08-22 00:50:22 | [diff] [blame] | 429 | const blink::WebPopupMenuInfo& popup_menu_info, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 430 | blink::WebExternalPopupMenuClient* popup_menu_client) override; |
| 431 | blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame) override; |
avi | 01681ef | 2016-02-16 17:53:57 | [diff] [blame^] | 432 | blink::WebServiceWorkerProvider* createServiceWorkerProvider() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 433 | void didAccessInitialDocument(blink::WebLocalFrame* frame) override; |
| 434 | blink::WebFrame* createChildFrame( |
alexmos | e48b1df93 | 2015-01-16 01:34:17 | [diff] [blame] | 435 | blink::WebLocalFrame* parent, |
dcheng | 860817a | 2015-05-22 03:16:56 | [diff] [blame] | 436 | blink::WebTreeScopeType scope, |
| 437 | const blink::WebString& name, |
lazyboy | 70605c3 | 2015-11-03 01:27:31 | [diff] [blame] | 438 | blink::WebSandboxFlags sandboxFlags, |
| 439 | const blink::WebFrameOwnerProperties& frameOwnerProperties) override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 440 | void didChangeOpener(blink::WebFrame* frame) override; |
| 441 | void frameDetached(blink::WebFrame* frame, DetachType type) override; |
| 442 | void frameFocused() override; |
| 443 | void willClose(blink::WebFrame* frame) override; |
| 444 | void didChangeName(blink::WebLocalFrame* frame, |
| 445 | const blink::WebString& name) override; |
estark | a886b8d | 2015-12-18 21:53:08 | [diff] [blame] | 446 | void didEnforceStrictMixedContentChecking() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 447 | void didChangeSandboxFlags(blink::WebFrame* child_frame, |
| 448 | blink::WebSandboxFlags flags) override; |
Avi Drissman | 09b359e5 | 2015-12-07 20:19:21 | [diff] [blame] | 449 | void didChangeFrameOwnerProperties( |
lazyboy | 70605c3 | 2015-11-03 01:27:31 | [diff] [blame] | 450 | blink::WebFrame* child_frame, |
| 451 | const blink::WebFrameOwnerProperties& frame_owner_properties) override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 452 | void didMatchCSS( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 453 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 454 | const blink::WebVector<blink::WebString>& newly_matching_selectors, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 455 | const blink::WebVector<blink::WebString>& stopped_matching_selectors) |
| 456 | override; |
| 457 | bool shouldReportDetailedMessageForSource( |
| 458 | const blink::WebString& source) override; |
| 459 | void didAddMessageToConsole(const blink::WebConsoleMessage& message, |
| 460 | const blink::WebString& source_name, |
| 461 | unsigned source_line, |
| 462 | const blink::WebString& stack_trace) override; |
japhet | b0bae9d8 | 2015-10-19 20:43:40 | [diff] [blame] | 463 | void loadURLExternally(const blink::WebURLRequest& request, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 464 | blink::WebNavigationPolicy policy, |
japhet | b0bae9d8 | 2015-10-19 20:43:40 | [diff] [blame] | 465 | const blink::WebString& suggested_name, |
| 466 | bool should_replace_current_entry) override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 467 | blink::WebNavigationPolicy decidePolicyForNavigation( |
| 468 | const NavigationPolicyInfo& info) override; |
creis | e18ce07 | 2015-12-02 02:00:02 | [diff] [blame] | 469 | blink::WebHistoryItem historyItemForNewChildFrame() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 470 | void willSendSubmitEvent(blink::WebLocalFrame* frame, |
| 471 | const blink::WebFormElement& form) override; |
| 472 | void willSubmitForm(blink::WebLocalFrame* frame, |
| 473 | const blink::WebFormElement& form) override; |
| 474 | void didCreateDataSource(blink::WebLocalFrame* frame, |
| 475 | blink::WebDataSource* datasource) override; |
| 476 | void didStartProvisionalLoad(blink::WebLocalFrame* frame, |
| 477 | double triggering_event_time) override; |
| 478 | void didReceiveServerRedirectForProvisionalLoad( |
| 479 | blink::WebLocalFrame* frame) override; |
| 480 | void didFailProvisionalLoad(blink::WebLocalFrame* frame, |
| 481 | const blink::WebURLError& error, |
| 482 | blink::WebHistoryCommitType commit_type) override; |
| 483 | void didCommitProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 484 | blink::WebLocalFrame* frame, |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 485 | const blink::WebHistoryItem& item, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 486 | blink::WebHistoryCommitType commit_type) override; |
| 487 | void didCreateNewDocument(blink::WebLocalFrame* frame) override; |
| 488 | void didClearWindowObject(blink::WebLocalFrame* frame) override; |
| 489 | void didCreateDocumentElement(blink::WebLocalFrame* frame) override; |
| 490 | void didReceiveTitle(blink::WebLocalFrame* frame, |
| 491 | const blink::WebString& title, |
| 492 | blink::WebTextDirection direction) override; |
| 493 | void didChangeIcon(blink::WebLocalFrame* frame, |
| 494 | blink::WebIconURL::Type icon_type) override; |
| 495 | void didFinishDocumentLoad(blink::WebLocalFrame* frame, |
| 496 | bool document_is_empty) override; |
| 497 | void didHandleOnloadEvents(blink::WebLocalFrame* frame) override; |
| 498 | void didFailLoad(blink::WebLocalFrame* frame, |
| 499 | const blink::WebURLError& error, |
| 500 | blink::WebHistoryCommitType commit_type) override; |
| 501 | void didFinishLoad(blink::WebLocalFrame* frame) override; |
| 502 | void didNavigateWithinPage(blink::WebLocalFrame* frame, |
| 503 | const blink::WebHistoryItem& item, |
| 504 | blink::WebHistoryCommitType commit_type) override; |
| 505 | void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame) override; |
| 506 | void didChangeThemeColor() override; |
| 507 | void dispatchLoad() override; |
| 508 | void requestNotificationPermission( |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 509 | const blink::WebSecurityOrigin& origin, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 510 | blink::WebNotificationPermissionCallback* callback) override; |
| 511 | void didChangeSelection(bool is_empty_selection) override; |
| 512 | blink::WebColorChooser* createColorChooser( |
[email protected] | eb8c216a | 2014-04-09 19:19:19 | [diff] [blame] | 513 | blink::WebColorChooserClient* client, |
[email protected] | f3c59d6 | 2014-04-09 16:33:55 | [diff] [blame] | 514 | const blink::WebColor& initial_color, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 515 | const blink::WebVector<blink::WebColorSuggestion>& suggestions) override; |
| 516 | void runModalAlertDialog(const blink::WebString& message) override; |
| 517 | bool runModalConfirmDialog(const blink::WebString& message) override; |
| 518 | bool runModalPromptDialog(const blink::WebString& message, |
| 519 | const blink::WebString& default_value, |
| 520 | blink::WebString* actual_value) override; |
| 521 | bool runModalBeforeUnloadDialog(bool is_reload, |
| 522 | const blink::WebString& message) override; |
| 523 | void showContextMenu(const blink::WebContextMenuData& data) override; |
| 524 | void clearContextMenu() override; |
| 525 | void willSendRequest(blink::WebLocalFrame* frame, |
| 526 | unsigned identifier, |
| 527 | blink::WebURLRequest& request, |
| 528 | const blink::WebURLResponse& redirect_response) override; |
| 529 | void didReceiveResponse(blink::WebLocalFrame* frame, |
| 530 | unsigned identifier, |
| 531 | const blink::WebURLResponse& response) override; |
| 532 | void didLoadResourceFromMemoryCache( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 533 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 534 | const blink::WebURLRequest& request, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 535 | const blink::WebURLResponse& response) override; |
| 536 | void didDisplayInsecureContent() override; |
| 537 | void didRunInsecureContent(const blink::WebSecurityOrigin& origin, |
| 538 | const blink::WebURL& target) override; |
estark | 910b457 | 2015-12-09 20:55:41 | [diff] [blame] | 539 | void didDisplayContentWithCertificateErrors( |
| 540 | const blink::WebURL& url, |
| 541 | const blink::WebCString& security_info, |
| 542 | const blink::WebURL& main_resource_url, |
| 543 | const blink::WebCString& main_resource_security_info) override; |
| 544 | void didRunContentWithCertificateErrors( |
| 545 | const blink::WebURL& url, |
| 546 | const blink::WebCString& security_info, |
| 547 | const blink::WebURL& main_resource_url, |
| 548 | const blink::WebCString& main_resource_security_info) override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 549 | void didChangePerformanceTiming() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 550 | void didCreateScriptContext(blink::WebLocalFrame* frame, |
| 551 | v8::Local<v8::Context> context, |
| 552 | int extension_group, |
| 553 | int world_id) override; |
| 554 | void willReleaseScriptContext(blink::WebLocalFrame* frame, |
| 555 | v8::Local<v8::Context> context, |
| 556 | int world_id) override; |
| 557 | void didChangeScrollOffset(blink::WebLocalFrame* frame) override; |
| 558 | void willInsertBody(blink::WebLocalFrame* frame) override; |
| 559 | void reportFindInPageMatchCount(int request_id, |
| 560 | int count, |
| 561 | bool final_update) override; |
| 562 | void reportFindInPageSelection(int request_id, |
| 563 | int active_match_ordinal, |
| 564 | const blink::WebRect& sel) override; |
| 565 | void requestStorageQuota(blink::WebLocalFrame* frame, |
| 566 | blink::WebStorageQuotaType type, |
| 567 | unsigned long long requested_size, |
| 568 | blink::WebStorageQuotaCallbacks callbacks) override; |
| 569 | void willOpenWebSocket(blink::WebSocketHandle* handle) override; |
alogvinov | f50445a | 2015-10-30 13:00:12 | [diff] [blame] | 570 | blink::WebWakeLockClient* wakeLockClient() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 571 | blink::WebGeolocationClient* geolocationClient() override; |
| 572 | blink::WebPushClient* pushClient() override; |
| 573 | blink::WebPresentationClient* presentationClient() override; |
| 574 | void willStartUsingPeerConnectionHandler( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 575 | blink::WebLocalFrame* frame, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 576 | blink::WebRTCPeerConnectionHandler* handler) override; |
| 577 | blink::WebUserMediaClient* userMediaClient() override; |
| 578 | blink::WebEncryptedMediaClient* encryptedMediaClient() override; |
| 579 | blink::WebMIDIClient* webMIDIClient() override; |
| 580 | bool willCheckAndDispatchMessageEvent( |
[email protected] | ce5064f | 2014-05-07 22:49:20 | [diff] [blame] | 581 | blink::WebLocalFrame* source_frame, |
| 582 | blink::WebFrame* target_frame, |
| 583 | blink::WebSecurityOrigin target_origin, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 584 | blink::WebDOMMessageEvent event) override; |
tzik | 34958ad6 | 2015-10-08 14:07:45 | [diff] [blame] | 585 | blink::WebString userAgentOverride(blink::WebLocalFrame* frame) override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 586 | blink::WebString doNotTrackValue(blink::WebLocalFrame* frame) override; |
| 587 | bool allowWebGL(blink::WebLocalFrame* frame, bool default_value) override; |
| 588 | void didLoseWebGLContext(blink::WebLocalFrame* frame, |
| 589 | int arb_robustness_status_code) override; |
| 590 | blink::WebScreenOrientationClient* webScreenOrientationClient() override; |
| 591 | bool isControlledByServiceWorker(blink::WebDataSource& data_source) override; |
| 592 | int64_t serviceWorkerID(blink::WebDataSource& data_source) override; |
| 593 | void postAccessibilityEvent(const blink::WebAXObject& obj, |
| 594 | blink::WebAXEvent event) override; |
| 595 | void handleAccessibilityFindInPageResult( |
| 596 | int identifier, |
| 597 | int match_index, |
| 598 | const blink::WebAXObject& start_object, |
| 599 | int start_offset, |
| 600 | const blink::WebAXObject& end_object, |
| 601 | int end_offset) override; |
| 602 | void didChangeManifest(blink::WebLocalFrame*) override; |
| 603 | bool enterFullscreen() override; |
| 604 | bool exitFullscreen() override; |
| 605 | blink::WebPermissionClient* permissionClient() override; |
| 606 | blink::WebAppBannerClient* appBannerClient() override; |
| 607 | void registerProtocolHandler(const blink::WebString& scheme, |
| 608 | const blink::WebURL& url, |
| 609 | const blink::WebString& title) override; |
| 610 | void unregisterProtocolHandler(const blink::WebString& scheme, |
| 611 | const blink::WebURL& url) override; |
| 612 | blink::WebBluetooth* bluetooth() override; |
| 613 | blink::WebUSBClient* usbClient() override; |
guidou | 3906a72 | 2015-11-12 22:14:42 | [diff] [blame] | 614 | void checkIfAudioSinkExistsAndIsAuthorized( |
| 615 | const blink::WebString& sink_id, |
| 616 | const blink::WebSecurityOrigin& security_origin, |
| 617 | blink::WebSetSinkIdCallbacks* web_callbacks) override; |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 618 | |
bajones | 0244353 | 2015-06-22 21:17:40 | [diff] [blame] | 619 | #if defined(ENABLE_WEBVR) |
| 620 | blink::WebVRClient* webVRClient() override; |
| 621 | #endif |
| 622 | |
lukasza | 902fcc5 | 2015-12-31 04:45:29 | [diff] [blame] | 623 | // WebFrameSerializerClient implementation: |
lukasza | 2e296c3 | 2015-09-28 23:29:48 | [diff] [blame] | 624 | void didSerializeDataForFrame( |
lukasza | 2e296c3 | 2015-09-28 23:29:48 | [diff] [blame] | 625 | const blink::WebCString& data, |
lukasza | 902fcc5 | 2015-12-31 04:45:29 | [diff] [blame] | 626 | blink::WebFrameSerializerClient::FrameSerializationStatus status) |
| 627 | override; |
lukasza | 2e296c3 | 2015-09-28 23:29:48 | [diff] [blame] | 628 | |
nasko | 78f06bc | 2014-11-18 18:18:57 | [diff] [blame] | 629 | // Make this frame show an empty, unscriptable page. |
| 630 | // TODO(nasko): Remove this method once swapped out state is no longer used. |
| 631 | void NavigateToSwappedOutURL(); |
| 632 | |
rockot | f8fdd9b | 2015-12-16 22:22:35 | [diff] [blame] | 633 | // Binds this render frame's service registry. |
| 634 | void BindServiceRegistry( |
ben | 80ab8905 | 2016-02-11 20:19:27 | [diff] [blame] | 635 | mojo::shell::mojom::InterfaceProviderRequest services, |
| 636 | mojo::shell::mojom::InterfaceProviderPtr exposed_services); |
rockot | f8fdd9b | 2015-12-16 22:22:35 | [diff] [blame] | 637 | |
mlamouri | 4fff199 | 2014-09-30 11:22:46 | [diff] [blame] | 638 | ManifestManager* manifest_manager(); |
| 639 | |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 640 | // TODO(creis): Remove when the only caller, the HistoryController, is no |
| 641 | // more. |
| 642 | void SetPendingNavigationParams( |
| 643 | scoped_ptr<NavigationParams> navigation_params); |
| 644 | |
xhwang | 5206d4e6 | 2016-02-05 02:09:55 | [diff] [blame] | 645 | media::MediaPermission* GetMediaPermission(); |
guoweis | f4282b0 | 2015-09-24 23:05:22 | [diff] [blame] | 646 | |
creis | 69b184a47 | 2015-11-26 05:29:51 | [diff] [blame] | 647 | // Sends the current frame's navigation state to the browser. |
| 648 | void SendUpdateState(); |
| 649 | |
nasko | 1fa0fb6 | 2015-12-09 01:49:57 | [diff] [blame] | 650 | // Creates a MojoBindingsController to allow WebUI documents to communicate |
rockot | 8df5c72 | 2016-01-26 07:15:14 | [diff] [blame] | 651 | // with the browser process. If |for_layout_tests| is true, the module system |
| 652 | // is exposed on a global "mojo" object rather than "define". |
| 653 | void EnableMojoBindings(bool for_layout_tests); |
nasko | 1fa0fb6 | 2015-12-09 01:49:57 | [diff] [blame] | 654 | |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 655 | protected: |
jochen | 664198b | 2015-06-25 14:13:00 | [diff] [blame] | 656 | explicit RenderFrameImpl(const CreateParams& params); |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 657 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 658 | private: |
kenrb | f98a4d2 | 2015-04-01 21:59:35 | [diff] [blame] | 659 | friend class RenderFrameImplTest; |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 660 | friend class RenderFrameObserver; |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 661 | friend class RendererAccessibilityTest; |
clamy | 98a9dee0 | 2015-06-24 16:09:10 | [diff] [blame] | 662 | friend class TestRenderFrame; |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 663 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
| 664 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
| 665 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
| 666 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
[email protected] | 66bbadaf | 2014-03-28 16:25:54 | [diff] [blame] | 667 | FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
| 668 | AccessibilityMessagesQueueWhileSwappedOut); |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 669 | |
twellington | 376424ad | 2015-05-04 18:57:25 | [diff] [blame] | 670 | // A wrapper class used as the callback for JavaScript executed |
| 671 | // in an isolated world. |
| 672 | class JavaScriptIsolatedWorldRequest |
| 673 | : public blink::WebScriptExecutionCallback { |
| 674 | public: |
| 675 | JavaScriptIsolatedWorldRequest( |
| 676 | int id, |
| 677 | bool notify_result, |
| 678 | int routing_id, |
| 679 | base::WeakPtr<RenderFrameImpl> render_frame_impl); |
| 680 | void completed( |
| 681 | const blink::WebVector<v8::Local<v8::Value>>& result) override; |
| 682 | |
| 683 | private: |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 684 | ~JavaScriptIsolatedWorldRequest() override; |
twellington | 376424ad | 2015-05-04 18:57:25 | [diff] [blame] | 685 | |
| 686 | int id_; |
| 687 | bool notify_result_; |
| 688 | int routing_id_; |
| 689 | base::WeakPtr<RenderFrameImpl> render_frame_impl_; |
| 690 | |
| 691 | DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest); |
| 692 | }; |
| 693 | |
[email protected] | 37567b43 | 2014-02-12 01:12:22 | [diff] [blame] | 694 | typedef std::map<GURL, double> HostZoomLevels; |
| 695 | |
dcheng | c5ef1a5 | 2015-08-26 20:58:30 | [diff] [blame] | 696 | // Creates a new RenderFrame. |render_view| is the RenderView object that this |
| 697 | // frame belongs to. |
ddorwin | f63505e | 2016-01-08 00:54:50 | [diff] [blame] | 698 | // Callers *must* call |BindToWebFrame| immediately after creation. |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 699 | static RenderFrameImpl* Create(RenderViewImpl* render_view, |
| 700 | int32_t routing_id); |
dcheng | c5ef1a5 | 2015-08-26 20:58:30 | [diff] [blame] | 701 | |
ddorwin | f63505e | 2016-01-08 00:54:50 | [diff] [blame] | 702 | // This is called right after creation with the WebLocalFrame for this |
| 703 | // RenderFrame. It must be called before Initialize. |
| 704 | void BindToWebFrame(blink::WebLocalFrame* web_frame); |
| 705 | |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 706 | // Functions to add and remove observers for this object. |
| 707 | void AddObserver(RenderFrameObserver* observer); |
| 708 | void RemoveObserver(RenderFrameObserver* observer); |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 709 | |
dcheng | 3d886b73 | 2015-11-05 19:16:01 | [diff] [blame] | 710 | bool IsLocalRoot() const; |
| 711 | |
[email protected] | f0906a0 | 2014-08-07 07:18:55 | [diff] [blame] | 712 | // Builds and sends DidCommitProvisionalLoad to the host. |
avi | 8c46f7e | 2015-02-03 18:27:35 | [diff] [blame] | 713 | void SendDidCommitProvisionalLoad(blink::WebFrame* frame, |
creis | 8b5cd4c | 2015-06-19 00:11:08 | [diff] [blame] | 714 | blink::WebHistoryCommitType commit_type, |
| 715 | const blink::WebHistoryItem& item); |
[email protected] | 37567b43 | 2014-02-12 01:12:22 | [diff] [blame] | 716 | |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 717 | // IPC message handlers ------------------------------------------------------ |
| 718 | // |
| 719 | // The documentation for these functions should be in |
| 720 | // content/common/*_messages.h for the message that the function is handling. |
clamy | 98a9dee0 | 2015-06-24 16:09:10 | [diff] [blame] | 721 | void OnNavigate(const CommonNavigationParams& common_params, |
| 722 | const StartNavigationParams& start_params, |
| 723 | const RequestNavigationParams& request_params); |
[email protected] | f76f3223 | 2014-03-11 17:36:17 | [diff] [blame] | 724 | void OnBeforeUnload(); |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 725 | void OnSwapOut(int proxy_routing_id, |
nasko | 3e8c20e | 2014-12-18 06:54:56 | [diff] [blame] | 726 | bool is_loading, |
alexmos | bc7eafa | 2014-12-06 01:38:09 | [diff] [blame] | 727 | const FrameReplicationState& replicated_frame_state); |
nasko | eab5c558 | 2015-12-15 05:20:00 | [diff] [blame] | 728 | void OnDeleteFrame(); |
Nasko Oskov | 85f6022 | 2014-08-28 22:53:30 | [diff] [blame] | 729 | void OnStop(); |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 730 | void OnShowContextMenu(const gfx::Point& location); |
| 731 | void OnContextMenuClosed(const CustomContextMenuContext& custom_context); |
| 732 | void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context, |
| 733 | unsigned action); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 734 | void OnUndo(); |
| 735 | void OnRedo(); |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 736 | void OnCut(); |
| 737 | void OnCopy(); |
| 738 | void OnPaste(); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 739 | void OnPasteAndMatchStyle(); |
| 740 | void OnDelete(); |
| 741 | void OnSelectAll(); |
christiank | aeed986 | 2014-11-05 10:49:14 | [diff] [blame] | 742 | void OnSelectRange(const gfx::Point& base, const gfx::Point& extent); |
aurimas | ab031902 | 2015-07-10 21:57:38 | [diff] [blame] | 743 | void OnAdjustSelectionByCharacterOffset(int start_adjust, int end_adjust); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 744 | void OnUnselect(); |
christiank | aeed986 | 2014-11-05 10:49:14 | [diff] [blame] | 745 | void OnMoveRangeSelectionExtent(const gfx::Point& point); |
[email protected] | 1f3fc1d | 2014-04-03 14:50:17 | [diff] [blame] | 746 | void OnReplace(const base::string16& text); |
| 747 | void OnReplaceMisspelling(const base::string16& text); |
[email protected] | e31b8ebb | 2014-03-07 17:59:34 | [diff] [blame] | 748 | void OnCSSInsertRequest(const std::string& css); |
peter | 4eb24200 | 2015-06-02 12:45:13 | [diff] [blame] | 749 | void OnAddMessageToConsole(ConsoleMessageLevel level, |
| 750 | const std::string& message); |
[email protected] | f13ab89 | 2014-03-12 06:48:52 | [diff] [blame] | 751 | void OnJavaScriptExecuteRequest(const base::string16& javascript, |
| 752 | int id, |
| 753 | bool notify_result); |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 754 | void OnJavaScriptExecuteRequestForTests(const base::string16& javascript, |
| 755 | int id, |
jochen | 2e7d95b | 2015-05-04 15:28:50 | [diff] [blame] | 756 | bool notify_result, |
| 757 | bool has_user_gesture); |
twellington | 376424ad | 2015-05-04 18:57:25 | [diff] [blame] | 758 | void OnJavaScriptExecuteRequestInIsolatedWorld(const base::string16& jscript, |
| 759 | int id, |
| 760 | bool notify_result, |
| 761 | int world_id); |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 762 | void OnVisualStateRequest(uint64_t key); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 763 | void OnSetEditableSelectionOffsets(int start, int end); |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 764 | void OnSetCompositionFromExistingText( |
| 765 | int start, int end, |
| 766 | const std::vector<blink::WebCompositionUnderline>& underlines); |
sammc | bc9e9933 | 2014-12-18 00:55:24 | [diff] [blame] | 767 | void OnExecuteNoValueEditCommand(const std::string& name); |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 768 | void OnExtendSelectionAndDelete(int before, int after); |
[email protected] | 4fed370 | 2014-04-01 09:08:00 | [diff] [blame] | 769 | void OnReload(bool ignore_cache); |
megjablon | 3f594107 | 2016-02-04 23:27:52 | [diff] [blame] | 770 | void OnReloadLoFiImages(); |
jam | 97323610 | 2016-02-09 00:47:05 | [diff] [blame] | 771 | void OnTextSurroundingSelectionRequest(uint32_t max_length); |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 772 | void OnSetAccessibilityMode(AccessibilityMode new_mode); |
dmazzoni | 83ba5c8 | 2015-04-14 07:11:51 | [diff] [blame] | 773 | void OnSnapshotAccessibilityTree(int callback_id); |
alexmos | 9573300 | 2015-08-24 16:38:09 | [diff] [blame] | 774 | void OnUpdateOpener(int opener_routing_id); |
dcheng | 5f60abb | 2015-05-28 01:39:36 | [diff] [blame] | 775 | void OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags); |
lazyboy | 70605c3 | 2015-11-03 01:27:31 | [diff] [blame] | 776 | void OnSetFrameOwnerProperties( |
| 777 | const blink::WebFrameOwnerProperties& frame_owner_properties); |
alexmos | 401f0aba | 2015-12-06 10:07:39 | [diff] [blame] | 778 | void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); |
alexmos | 5357efb | 2015-12-16 21:44:00 | [diff] [blame] | 779 | void OnSetFocusedFrame(); |
dspell | e736c9db | 2015-04-03 04:53:16 | [diff] [blame] | 780 | void OnTextTrackSettingsChanged( |
| 781 | const FrameMsg_TextTrackSettings_Params& params); |
alexmos | e7da5a1 | 2015-04-09 02:22:16 | [diff] [blame] | 782 | void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params); |
davidben | a5496d6 | 2014-10-07 18:52:04 | [diff] [blame] | 783 | void OnCommitNavigation(const ResourceResponseHead& response, |
| 784 | const GURL& stream_url, |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 785 | const CommonNavigationParams& common_params, |
clamy | 57b4b8e | 2015-03-24 13:32:11 | [diff] [blame] | 786 | const RequestNavigationParams& request_params); |
clamy | 62b271d | 2015-04-16 11:54:57 | [diff] [blame] | 787 | void OnFailedNavigation(const CommonNavigationParams& common_params, |
| 788 | const RequestNavigationParams& request_params, |
| 789 | bool has_stale_copy_in_cache, |
| 790 | int error_code); |
lukasza | 6af746b7 | 2015-09-18 23:37:22 | [diff] [blame] | 791 | void OnGetSavableResourceLinks(); |
lukasza | 2e296c3 | 2015-09-28 23:29:48 | [diff] [blame] | 792 | void OnGetSerializedHtmlWithLocalLinks( |
lukasza | 777a7dd | 2016-01-25 23:55:47 | [diff] [blame] | 793 | const std::map<GURL, base::FilePath>& url_to_local_path, |
| 794 | const std::map<int, base::FilePath>& frame_routing_id_to_local_path); |
lukasza | ede9cc0 | 2015-12-30 23:48:32 | [diff] [blame] | 795 | void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); |
paulmeyer | 5d0a5f0 | 2016-01-21 20:15:52 | [diff] [blame] | 796 | void OnFind(int request_id, |
| 797 | const base::string16& search_text, |
| 798 | const blink::WebFindOptions& options); |
| 799 | void OnStopFinding(StopFindAction action); |
| 800 | #if defined(OS_ANDROID) |
| 801 | void OnActivateNearestFindResult(int request_id, float x, float y); |
| 802 | void OnFindMatchRects(int current_version); |
| 803 | void OnSelectPopupMenuItems(bool canceled, |
| 804 | const std::vector<int>& selected_indices); |
| 805 | #elif defined(OS_MACOSX) |
| 806 | void OnSelectPopupMenuItem(int selected_index); |
| 807 | void OnCopyToFindPboard(); |
| 808 | #endif |
clamy | 9bfeef4 | 2014-09-30 20:50:42 | [diff] [blame] | 809 | |
creis | e18ce07 | 2015-12-02 02:00:02 | [diff] [blame] | 810 | // Requests that the browser process navigates to |url|. If |
| 811 | // |is_history_navigation_in_new_child| is true, the browser process should |
| 812 | // look for a matching FrameNavigationEntry in the last committed entry to use |
| 813 | // instead of |url|. |
japhet | b0bae9d8 | 2015-10-19 20:43:40 | [diff] [blame] | 814 | void OpenURL(const GURL& url, |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 815 | const Referrer& referrer, |
japhet | b0bae9d8 | 2015-10-19 20:43:40 | [diff] [blame] | 816 | blink::WebNavigationPolicy policy, |
creis | e18ce07 | 2015-12-02 02:00:02 | [diff] [blame] | 817 | bool should_replace_current_entry, |
| 818 | bool is_history_navigation_in_new_child); |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 819 | |
clamy | d698303 | 2015-04-29 14:48:12 | [diff] [blame] | 820 | // Performs a navigation in the frame. This provides a unified function for |
| 821 | // the current code path and the browser-side navigation path (in |
| 822 | // development). Currently used by OnNavigate, with all *NavigationParams |
| 823 | // provided by the browser. |stream_params| should be null. |
| 824 | // PlzNavigate: used by OnCommitNavigation, with |common_params| and |
| 825 | // |request_params| received by the browser. |stream_params| should be non |
| 826 | // null and created from the information provided by the browser. |
| 827 | // |start_params| is not used. |
| 828 | void NavigateInternal(const CommonNavigationParams& common_params, |
| 829 | const StartNavigationParams& start_params, |
| 830 | const RequestNavigationParams& request_params, |
| 831 | scoped_ptr<StreamOverrideParameters> stream_params); |
| 832 | |
[email protected] | ef3adfc | 2014-05-11 00:04:54 | [diff] [blame] | 833 | // Update current main frame's encoding and send it to browser window. |
| 834 | // Since we want to let users see the right encoding info from menu |
| 835 | // before finishing loading, we call the UpdateEncoding in |
| 836 | // a) function:DidCommitLoadForFrame. When this function is called, |
| 837 | // that means we have got first data. In here we try to get encoding |
| 838 | // of page if it has been specified in http header. |
| 839 | // b) function:DidReceiveTitle. When this function is called, |
| 840 | // that means we have got specified title. Because in most of webpages, |
| 841 | // title tags will follow meta tags. In here we try to get encoding of |
| 842 | // page if it has been specified in meta tag. |
| 843 | // c) function:DidFinishDocumentLoadForFrame. When this function is |
| 844 | // called, that means we have got whole html page. In here we should |
| 845 | // finally get right encoding of page. |
| 846 | void UpdateEncoding(blink::WebFrame* frame, |
| 847 | const std::string& encoding_name); |
| 848 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 849 | // Dispatches the current state of selection on the webpage to the browser if |
| 850 | // it has changed. |
| 851 | // TODO(varunjain): delete this method once we figure out how to keep |
| 852 | // selection handles in sync with the webpage. |
| 853 | void SyncSelectionIfRequired(); |
| 854 | |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 855 | bool RunJavaScriptMessage(JavaScriptMessageType type, |
| 856 | const base::string16& message, |
| 857 | const base::string16& default_value, |
| 858 | const GURL& frame_url, |
| 859 | base::string16* result); |
| 860 | |
[email protected] | 457736d | 2014-04-30 15:54:27 | [diff] [blame] | 861 | // Loads the appropriate error page for the specified failure into the frame. |
| 862 | void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request, |
| 863 | const blink::WebURLError& error, |
| 864 | bool replace); |
| 865 | |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 866 | void HandleJavascriptExecutionResult(const base::string16& javascript, |
| 867 | int id, |
| 868 | bool notify_result, |
deepak.s | 750d68f | 2015-04-30 07:32:41 | [diff] [blame] | 869 | v8::Local<v8::Value> result); |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 870 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 871 | // Initializes |web_user_media_client_|. If this fails, because it wasn't |
| 872 | // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then |
| 873 | // |web_user_media_client_| will remain NULL. |
| 874 | void InitializeUserMediaClient(); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 875 | |
| 876 | blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream( |
guidou | 9c3cc3e | 2015-10-27 13:38:15 | [diff] [blame] | 877 | blink::WebMediaPlayerClient* client, |
| 878 | const blink::WebString& sink_id, |
| 879 | const blink::WebSecurityOrigin& security_origin); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 880 | |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 881 | // Creates a factory object used for creating audio and video renderers. |
jochen | 5126513 | 2015-05-28 07:33:45 | [diff] [blame] | 882 | scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory(); |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 883 | |
avi | 5cad491 | 2015-06-19 05:25:44 | [diff] [blame] | 884 | // Does preparation for the navigation to |url|. |
| 885 | void PrepareRenderViewForNavigation( |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 886 | const GURL& url, |
clamy | 57b4b8e | 2015-03-24 13:32:11 | [diff] [blame] | 887 | const RequestNavigationParams& request_params, |
clamy | da97e832 | 2014-10-07 21:57:25 | [diff] [blame] | 888 | bool* is_reload, |
| 889 | blink::WebURLRequest::CachePolicy* cache_policy); |
| 890 | |
clamy | ece3888 | 2014-11-19 15:00:20 | [diff] [blame] | 891 | // PlzNavigate |
| 892 | // Sends a FrameHostMsg_BeginNavigation to the browser based on the contents |
| 893 | // of the WebURLRequest. |
clamy | d3edf86 | 2016-02-01 12:39:28 | [diff] [blame] | 894 | // |should_replace_current_entry| indicates that the current history entry |
| 895 | // will be replaced when the navigation commits. |is_client_redirect| |
| 896 | // indicates that the navigation originated as a client redirect. |
| 897 | // Note: those two concepts are separate. For example, a location.assign is a |
| 898 | // client redirect but it only replaces the current entry if called before |
| 899 | // load stop. location.replace on the other hand is a client redirect and |
| 900 | // always replaces the current entry. |
| 901 | void BeginNavigation(blink::WebURLRequest* request, |
| 902 | bool should_replace_current_entry, |
| 903 | bool is_client_redirect); |
clamy | ece3888 | 2014-11-19 15:00:20 | [diff] [blame] | 904 | |
clamy | 4cc9b820 | 2015-03-02 13:51:36 | [diff] [blame] | 905 | // Loads a data url. |
| 906 | void LoadDataURL(const CommonNavigationParams& params, |
mnaganov | bf08742 | 2015-12-16 05:10:03 | [diff] [blame] | 907 | const RequestNavigationParams& request_params, |
boliu | 15890e4 | 2015-11-24 23:08:05 | [diff] [blame] | 908 | blink::WebFrame* frame, |
| 909 | blink::WebFrameLoadType load_type); |
clamy | 4cc9b820 | 2015-03-02 13:51:36 | [diff] [blame] | 910 | |
clamy | 62b271d | 2015-04-16 11:54:57 | [diff] [blame] | 911 | // Sends a proper FrameHostMsg_DidFailProvisionalLoadWithError_Params IPC for |
| 912 | // the failed request |request|. |
| 913 | void SendFailedProvisionalLoad(const blink::WebURLRequest& request, |
| 914 | const blink::WebURLError& error, |
| 915 | blink::WebLocalFrame* frame); |
| 916 | |
| 917 | bool ShouldDisplayErrorPageForFailedLoad(int error_code, |
| 918 | const GURL& unreachable_url); |
| 919 | |
[email protected] | f3a9531 | 2014-06-12 16:46:58 | [diff] [blame] | 920 | // Returns the URL being loaded by the |frame_|'s request. |
| 921 | GURL GetLoadingUrl() const; |
| 922 | |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 923 | // If we initiated a navigation, this function will populate |document_state| |
| 924 | // with the navigation information saved in OnNavigate(). |
| 925 | void PopulateDocumentStateFromPending(DocumentState* document_state); |
| 926 | |
| 927 | // Returns a new NavigationState populated with the navigation information |
| 928 | // saved in OnNavigate(). |
| 929 | NavigationState* CreateNavigationStateFromPending(); |
| 930 | |
csharrison | 1ce0e85 | 2015-11-07 16:45:13 | [diff] [blame] | 931 | // Sets the NavigationState on the DocumentState based on |
| 932 | // the value of |pending_navigation_params_|. |
| 933 | void UpdateNavigationState(DocumentState* document_state); |
| 934 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 935 | #if defined(OS_ANDROID) |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 936 | blink::WebMediaPlayer* CreateAndroidWebMediaPlayer( |
jrummell | 65b7d27 | 2014-09-24 20:49:27 | [diff] [blame] | 937 | blink::WebMediaPlayerClient* client, |
srirama.m | 26f864d0 | 2015-07-14 05:21:46 | [diff] [blame] | 938 | blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
dalecurtis | 49f36388 | 2015-08-25 21:05:38 | [diff] [blame] | 939 | const media::WebMediaPlayerParams& params); |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 940 | |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 941 | RendererMediaPlayerManager* GetMediaPlayerManager(); |
davve | 859f4f9 | 2015-11-27 10:16:19 | [diff] [blame] | 942 | |
| 943 | RendererMediaSessionManager* GetMediaSessionManager(); |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 944 | #endif |
| 945 | |
sandersd | 02d9aea | 2015-05-12 02:29:26 | [diff] [blame] | 946 | bool AreSecureCodecsSupported(); |
xhwang | 33f939e | 2015-06-23 04:33:42 | [diff] [blame] | 947 | |
xhwang | e70b7ee1 | 2015-06-25 09:17:17 | [diff] [blame] | 948 | #if defined(ENABLE_MOJO_MEDIA) |
xhwang | c0299ae3 | 2015-07-21 23:39:50 | [diff] [blame] | 949 | media::interfaces::ServiceFactory* GetMediaServiceFactory(); |
xhwang | 33f939e | 2015-06-23 04:33:42 | [diff] [blame] | 950 | |
xhwang | c0299ae3 | 2015-07-21 23:39:50 | [diff] [blame] | 951 | // Called when a connection error happened on |media_service_factory_|. |
| 952 | void OnMediaServiceFactoryConnectionError(); |
xhwang | 33f939e | 2015-06-23 04:33:42 | [diff] [blame] | 953 | #endif |
| 954 | |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 955 | media::CdmFactory* GetCdmFactory(); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 956 | |
halton.huo | ca2eabd | 2015-07-06 08:17:40 | [diff] [blame] | 957 | void RegisterMojoServices(); |
| 958 | |
xhwang | 6bca21e | 2016-02-06 00:21:45 | [diff] [blame] | 959 | // Connect to an interface provided by the service registry. |
| 960 | template <typename Interface> |
ben | e3bc902 | 2016-02-10 17:38:24 | [diff] [blame] | 961 | void GetInterface(mojo::InterfaceRequest<Interface> request); |
xhwang | 6bca21e | 2016-02-06 00:21:45 | [diff] [blame] | 962 | |
rockot | d926098 | 2015-08-21 22:26:30 | [diff] [blame] | 963 | // Connects to a Mojo application and returns a proxy to its exposed |
| 964 | // ServiceProvider. |
ben | 80ab8905 | 2016-02-11 20:19:27 | [diff] [blame] | 965 | mojo::shell::mojom::InterfaceProviderPtr ConnectToApplication( |
| 966 | const GURL& url); |
rockot | d926098 | 2015-08-21 22:26:30 | [diff] [blame] | 967 | |
dalecurtis | a12e606 | 2015-11-10 23:13:14 | [diff] [blame] | 968 | // Returns the media delegate for WebMediaPlayer usage. If |
| 969 | // |media_player_delegate_| is NULL, one is created. |
| 970 | media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate(); |
| 971 | |
paulmeyer | 5d0a5f0 | 2016-01-21 20:15:52 | [diff] [blame] | 972 | // Called to get the WebPlugin to handle find requests in the document. |
| 973 | // Returns nullptr if there is no such WebPlugin. |
| 974 | blink::WebPlugin* GetWebPluginForFind(); |
| 975 | |
| 976 | // Sends a reply to the current find operation handling if it was a |
| 977 | // synchronous find request. |
| 978 | void SendFindReply(int request_id, |
| 979 | int match_count, |
| 980 | int ordinal, |
| 981 | const blink::WebRect& selection_rect, |
| 982 | bool final_status_update); |
| 983 | |
creis | cfaa446 | 2015-03-16 19:27:18 | [diff] [blame] | 984 | // Stores the WebLocalFrame we are associated with. This is null from the |
ddorwin | f63505e | 2016-01-08 00:54:50 | [diff] [blame] | 985 | // constructor until BindToWebFrame is called, and it is null after |
creis | cfaa446 | 2015-03-16 19:27:18 | [diff] [blame] | 986 | // frameDetached is called until destruction (which is asynchronous in the |
| 987 | // case of the main frame, but not subframes). |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 988 | blink::WebLocalFrame* frame_; |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 989 | |
dglazkov | 2e140f5 | 2015-09-28 16:10:07 | [diff] [blame] | 990 | // Boolean value indicating whether this RenderFrameImpl object is for the |
| 991 | // main frame or not. It remains accurate during destruction, even when |
| 992 | // |frame_| has been invalidated. |
| 993 | bool is_main_frame_; |
nasko | 8b9d9bd | 2015-05-06 19:23:19 | [diff] [blame] | 994 | |
nasko | eab5c558 | 2015-12-15 05:20:00 | [diff] [blame] | 995 | // When a frame is detached in response to a message from the browser process, |
| 996 | // this RenderFrame should not be sending notifications back to it. This |
| 997 | // boolean is used to indicate this case. |
| 998 | bool in_browser_initiated_detach_; |
| 999 | |
| 1000 | // Indicates whether the frame has been inserted into the frame tree yet or |
| 1001 | // not. |
| 1002 | // |
| 1003 | // When a frame is created by the browser process, it is for a pending |
| 1004 | // navigation. In this case, it is not immediately attached to the frame tree |
| 1005 | // if there is a RenderFrameProxy for the same frame. It is inserted into the |
| 1006 | // frame tree at the time the pending navigation commits. |
| 1007 | // Frames added by the parent document are created from the renderer process |
| 1008 | // and are immediately inserted in the frame tree. |
| 1009 | // TODO(dcheng): Remove this once we have FrameTreeHandle and can use the |
| 1010 | // Blink Web* layer to check for provisional frames. |
| 1011 | bool in_frame_tree_; |
| 1012 | |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 1013 | base::WeakPtr<RenderViewImpl> render_view_; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 1014 | int routing_id_; |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 1015 | bool is_swapped_out_; |
nasko | 8b9d9bd | 2015-05-06 19:23:19 | [diff] [blame] | 1016 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 1017 | // RenderFrameProxy exists only when is_swapped_out_ is true. |
| 1018 | // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 1019 | // RenderFrame. See https://crbug.com/357747. |
| 1020 | RenderFrameProxy* render_frame_proxy_; |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 1021 | bool is_detaching_; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 1022 | |
japhet | e6adf14 | 2014-10-31 00:01:49 | [diff] [blame] | 1023 | // If this frame was created to replace a proxy, this will store the routing |
| 1024 | // id of the proxy to replace at commit-time, at which time it will be |
| 1025 | // cleared. |
| 1026 | // TODO(creis): Remove this after switching to PlzNavigate. |
| 1027 | int proxy_routing_id_; |
| 1028 | |
dcheng | 3d886b73 | 2015-11-05 19:16:01 | [diff] [blame] | 1029 | // Non-null when the RenderFrame is a local root for compositing, input, |
| 1030 | // layout, etc. A local frame is also a local root iff it does not have a |
| 1031 | // parent that is a local frame. |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 1032 | scoped_refptr<RenderWidget> render_widget_; |
| 1033 | |
avi | 0392dbf5 | 2015-03-25 16:55:45 | [diff] [blame] | 1034 | // Temporarily holds state pertaining to a navigation that has been initiated |
| 1035 | // until the NavigationState corresponding to the new navigation is created in |
| 1036 | // didCreateDataSource(). |
| 1037 | scoped_ptr<NavigationParams> pending_navigation_params_; |
| 1038 | |
creis | 8eb8ef2 | 2015-11-04 22:51:38 | [diff] [blame] | 1039 | // Stores the current history item for this frame, so that updates to it can |
| 1040 | // be reported to the browser process via SendUpdateState. |
| 1041 | blink::WebHistoryItem current_history_item_; |
| 1042 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 1043 | #if defined(ENABLE_PLUGINS) |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 1044 | // Current text input composition text. Empty if no composition is in |
| 1045 | // progress. |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 1046 | base::string16 pepper_composition_text_; |
tommycli | eb25b2a | 2014-11-03 19:45:09 | [diff] [blame] | 1047 | |
tommycli | 59bd86c | 2014-12-10 02:09:38 | [diff] [blame] | 1048 | PluginPowerSaverHelper* plugin_power_saver_helper_; |
paulmeyer | 5d0a5f0 | 2016-01-21 20:15:52 | [diff] [blame] | 1049 | |
| 1050 | PepperPluginInstanceImpl* plugin_find_handler_; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 1051 | #endif |
| 1052 | |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 1053 | RendererWebCookieJarImpl cookie_jar_; |
| 1054 | |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 1055 | // All the registered observers. |
brettw | 236d317 | 2015-06-03 16:31:43 | [diff] [blame] | 1056 | base::ObserverList<RenderFrameObserver> observers_; |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 1057 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 1058 | scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
| 1059 | |
[email protected] | 4ecee35 | 2014-03-11 21:12:19 | [diff] [blame] | 1060 | // The node that the context menu was pressed over. |
| 1061 | blink::WebNode context_menu_node_; |
| 1062 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 1063 | // External context menu requests we're waiting for. "Internal" |
| 1064 | // (WebKit-originated) context menu events will have an ID of 0 and will not |
| 1065 | // be in this map. |
| 1066 | // |
| 1067 | // We don't want to add internal ones since some of the "special" page |
| 1068 | // handlers in the browser process just ignore the context menu requests so |
| 1069 | // avoid showing context menus, and so this will cause right clicks to leak |
| 1070 | // entries in this map. Most users of the custom context menu (e.g. Pepper |
| 1071 | // plugins) are normally only on "regular" pages and the regular pages will |
| 1072 | // always respond properly to the request, so we don't have to worry so |
| 1073 | // much about leaks. |
| 1074 | IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; |
| 1075 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 1076 | // The text selection the last time DidChangeSelection got called. May contain |
| 1077 | // additional characters before and after the selected text, for IMEs. The |
| 1078 | // portion of this string that is the actual selected text starts at index |
| 1079 | // |selection_range_.GetMin() - selection_text_offset_| and has length |
| 1080 | // |selection_range_.length()|. |
| 1081 | base::string16 selection_text_; |
| 1082 | // The offset corresponding to the start of |selection_text_| in the document. |
| 1083 | size_t selection_text_offset_; |
| 1084 | // Range over the document corresponding to the actual selected text (which |
| 1085 | // could correspond to a substring of |selection_text_|; see above). |
| 1086 | gfx::Range selection_range_; |
| 1087 | // Used to inform didChangeSelection() when it is called in the context |
| 1088 | // of handling a InputMsg_SelectRange IPC. |
| 1089 | bool handling_select_range_; |
| 1090 | |
[email protected] | 2626d14 | 2014-04-22 17:24:02 | [diff] [blame] | 1091 | // The next group of objects all implement RenderFrameObserver, so are deleted |
| 1092 | // along with the RenderFrame automatically. This is why we just store weak |
| 1093 | // references. |
| 1094 | |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 1095 | // Dispatches permission requests for Web Notifications. |
| 1096 | NotificationPermissionDispatcher* notification_permission_dispatcher_; |
| 1097 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 1098 | // Destroyed via the RenderFrameObserver::OnDestruct() mechanism. |
perkj | 1a2d043 | 2014-09-03 13:52:33 | [diff] [blame] | 1099 | UserMediaClientImpl* web_user_media_client_; |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 1100 | |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 1101 | // EncryptedMediaClient attached to this frame; lazily initialized. |
xhwang | 430baee | 2015-01-22 05:46:20 | [diff] [blame] | 1102 | scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_; |
jrummell | 109c3a60 | 2014-12-18 01:08:50 | [diff] [blame] | 1103 | |
xhwang | 6bca21e | 2016-02-06 00:21:45 | [diff] [blame] | 1104 | // The media permission dispatcher attached to this frame. |
| 1105 | scoped_ptr<MediaPermissionDispatcher> media_permission_dispatcher_; |
xhwang | 36b1f3b | 2015-01-27 17:54:01 | [diff] [blame] | 1106 | |
xhwang | e70b7ee1 | 2015-06-25 09:17:17 | [diff] [blame] | 1107 | #if defined(ENABLE_MOJO_MEDIA) |
xhwang | c0299ae3 | 2015-07-21 23:39:50 | [diff] [blame] | 1108 | // The media factory attached to this frame, lazily initialized. |
| 1109 | media::interfaces::ServiceFactoryPtr media_service_factory_; |
xhwang | 065b54b | 2015-06-03 22:25:55 | [diff] [blame] | 1110 | #endif |
| 1111 | |
[email protected] | 52d3e17 | 2014-06-16 16:57:02 | [diff] [blame] | 1112 | // MidiClient attached to this frame; lazily initialized. |
| 1113 | MidiDispatcher* midi_dispatcher_; |
| 1114 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 1115 | #if defined(OS_ANDROID) |
davve | 859f4f9 | 2015-11-27 10:16:19 | [diff] [blame] | 1116 | // Manages all media players and sessions in this render frame for |
| 1117 | // communicating with the real media player and sessions in the |
| 1118 | // browser process. It's okay to use raw pointers since they're both |
| 1119 | // RenderFrameObservers. |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 1120 | RendererMediaPlayerManager* media_player_manager_; |
davve | 859f4f9 | 2015-11-27 10:16:19 | [diff] [blame] | 1121 | RendererMediaSessionManager* media_session_manager_; |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 1122 | #endif |
| 1123 | |
| 1124 | #if defined(ENABLE_BROWSER_CDMS) |
| 1125 | // Manage all CDMs in this render frame for communicating with the real CDM in |
| 1126 | // the browser process. It's okay to use a raw pointer since it's a |
| 1127 | // RenderFrameObserver. |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 1128 | RendererCdmManager* cdm_manager_; |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 1129 | #endif |
| 1130 | |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 1131 | // The CDM factory attached to this frame, lazily initialized. |
xhwang | f2eb532f | 2015-06-25 01:51:19 | [diff] [blame] | 1132 | scoped_ptr<media::CdmFactory> cdm_factory_; |
xhwang | d718083 | 2015-04-03 05:38:15 | [diff] [blame] | 1133 | |
hubbe | 5f0ad43b | 2015-12-14 20:57:26 | [diff] [blame] | 1134 | // Media resource cache, lazily initialized. |
| 1135 | linked_ptr<media::UrlIndex> url_index_; |
| 1136 | |
[email protected] | a6e21c37 | 2014-07-12 02:27:21 | [diff] [blame] | 1137 | #if defined(VIDEO_HOLE) |
| 1138 | // Whether or not this RenderFrameImpl contains a media player. Used to |
| 1139 | // register as an observer for video-hole-specific events. |
| 1140 | bool contains_media_player_; |
| 1141 | #endif |
| 1142 | |
dgozman | 358ba32 | 2015-03-26 15:05:30 | [diff] [blame] | 1143 | // The devtools agent for this frame; only created for main frame and |
| 1144 | // local roots. |
| 1145 | DevToolsAgent* devtools_agent_; |
| 1146 | |
alogvinov | f50445a | 2015-10-30 13:00:12 | [diff] [blame] | 1147 | WakeLockDispatcher* wakelock_dispatcher_; |
| 1148 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 1149 | // The geolocation dispatcher attached to this frame, lazily initialized. |
[email protected] | 8eae080 | 2014-06-02 21:35:55 | [diff] [blame] | 1150 | GeolocationDispatcher* geolocation_dispatcher_; |
| 1151 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 1152 | // The push messaging dispatcher attached to this frame, lazily initialized. |
| 1153 | PushMessagingDispatcher* push_messaging_dispatcher_; |
| 1154 | |
avayvod | bca35fad | 2015-01-29 20:20:57 | [diff] [blame] | 1155 | // The presentation dispatcher implementation attached to this frame, lazily |
| 1156 | // initialized. |
| 1157 | PresentationDispatcher* presentation_dispatcher_; |
| 1158 | |
rockot | f8fdd9b | 2015-12-16 22:22:35 | [diff] [blame] | 1159 | ServiceRegistryImpl service_registry_; |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 1160 | |
rockot | d926098 | 2015-08-21 22:26:30 | [diff] [blame] | 1161 | // The shell proxy used to connect to Mojo applications. |
ben | 9aaf303 | 2016-02-06 08:56:49 | [diff] [blame] | 1162 | mojo::shell::mojom::ShellPtr mojo_shell_; |
rockot | d926098 | 2015-08-21 22:26:30 | [diff] [blame] | 1163 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 1164 | // The screen orientation dispatcher attached to the frame, lazily |
| 1165 | // initialized. |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 1166 | ScreenOrientationDispatcher* screen_orientation_dispatcher_; |
| 1167 | |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame] | 1168 | // The Manifest Manager handles the manifest requests from the browser |
| 1169 | // process. |
| 1170 | ManifestManager* manifest_manager_; |
| 1171 | |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 1172 | // The current accessibility mode. |
| 1173 | AccessibilityMode accessibility_mode_; |
| 1174 | |
| 1175 | // Only valid if |accessibility_mode_| is anything other than |
| 1176 | // AccessibilityModeOff. |
| 1177 | RendererAccessibility* renderer_accessibility_; |
| 1178 | |
mlamouri | c6d31db | 2015-03-28 17:48:14 | [diff] [blame] | 1179 | scoped_ptr<PermissionDispatcher> permission_client_; |
mlamouri | 670a86d | 2015-03-17 16:06:25 | [diff] [blame] | 1180 | |
benwells | 04ab5b96 | 2015-05-06 08:29:40 | [diff] [blame] | 1181 | scoped_ptr<blink::WebAppBannerClient> app_banner_client_; |
| 1182 | |
jyasskin | f89a11b | 2015-07-21 00:27:48 | [diff] [blame] | 1183 | scoped_ptr<blink::WebBluetooth> bluetooth_; |
| 1184 | |
rockot | d926098 | 2015-08-21 22:26:30 | [diff] [blame] | 1185 | scoped_ptr<blink::WebUSBClient> usb_client_; |
| 1186 | |
dalecurtis | a12e606 | 2015-11-10 23:13:14 | [diff] [blame] | 1187 | // Manages play, pause notifications for WebMediaPlayer implementations; its |
| 1188 | // lifetime is tied to the RenderFrame via the RenderFrameObserver interface. |
| 1189 | media::RendererWebMediaPlayerDelegate* media_player_delegate_; |
| 1190 | |
megjablon | d5ac7d5 | 2015-10-22 23:56:12 | [diff] [blame] | 1191 | // Whether or not this RenderFrame is using Lo-Fi mode. |
| 1192 | bool is_using_lofi_; |
| 1193 | |
ellyjones | db20fae1 | 2015-12-04 16:47:55 | [diff] [blame] | 1194 | // Whether or not this RenderFrame is currently pasting. |
| 1195 | bool is_pasting_; |
| 1196 | |
bajones | 0244353 | 2015-06-22 21:17:40 | [diff] [blame] | 1197 | #if defined(ENABLE_WEBVR) |
| 1198 | // The VR dispatcher attached to the frame, lazily initialized. |
| 1199 | scoped_ptr<VRDispatcher> vr_dispatcher_; |
| 1200 | #endif |
| 1201 | |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 1202 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 1203 | // The external popup for the currently showing select popup. |
| 1204 | scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
| 1205 | #endif |
| 1206 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 1207 | base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 1208 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 1209 | DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 1210 | }; |
| 1211 | |
| 1212 | } // namespace content |
| 1213 | |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 1214 | #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |