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