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