blob: 08f0e968c4759c2c45ae1ff0eb084d4a85e91784 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2012 The Chromium Authors
[email protected]0dd3a0ab2011-02-18 08:17:442// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]93ddb3c2012-04-11 21:44:295#ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6#define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
[email protected]0dd3a0ab2011-02-18 08:17:447
avib7348942015-12-25 20:57:108#include <stdint.h>
9
lfgdb5c4ed2016-03-04 23:09:0710#include <functional>
[email protected]0dd3a0ab2011-02-18 08:17:4411#include <map>
dcheng59716272016-04-09 05:19:0812#include <memory>
Arthur Sonzognic686e8f2024-01-11 08:36:3713#include <optional>
[email protected]b24b68a2012-09-24 21:57:2614#include <set>
[email protected]0dd3a0ab2011-02-18 08:17:4415#include <string>
Lukasz Anforowicze9ae3722017-09-29 17:37:3816#include <utility>
17#include <vector>
[email protected]0dd3a0ab2011-02-18 08:17:4418
David Sanders6f0eeb02025-01-30 06:48:5019#include "base/auto_reset.h"
Elly Fong-Jones564de6262022-07-28 21:11:1620#include "base/callback_list.h"
Lei Zhang6410ec1a2019-01-31 21:38:5821#include "base/containers/flat_map.h"
Avi Drissmanadac21992023-01-11 23:46:3922#include "base/functional/callback_helpers.h"
Daniel Cheng982f2b22022-08-25 23:46:1623#include "base/functional/function_ref.h"
[email protected]0dd3a0ab2011-02-18 08:17:4424#include "base/gtest_prod_util.h"
Keishi Hattori0e45c022021-11-27 09:25:5225#include "base/memory/raw_ptr.h"
Dave Tapuskad8b0530f2021-10-19 15:12:3126#include "base/memory/safe_ref.h"
[email protected]6eac57a2011-07-12 21:15:0927#include "base/observer_list.h"
Lei Zhang2764bca2021-07-15 02:00:0728#include "base/process/kill.h"
Sigurdur Asgeirsson103e2fb2020-11-10 00:50:1629#include "base/scoped_observation.h"
Daniel Cheng90196c82018-04-25 21:49:1430#include "base/time/time.h"
Ari Chivukula2d8d5e02024-11-04 20:09:5731#include "base/types/pass_key.h"
avib7348942015-12-25 20:57:1032#include "build/build_config.h"
Min Qina904f3302018-02-13 23:33:3433#include "components/download/public/common/download_url_parameters.h"
Aman Vermaea1fcd02024-11-07 20:04:2834#include "components/input/render_input_router.mojom.h"
Kartar Singhb1bfa1a2024-06-24 13:14:5735#include "components/input/render_widget_host_input_event_router.h"
avayvodcc85bbd2015-08-28 19:11:1536#include "content/browser/media/audio_stream_monitor.h"
Max Morin5bc74f52018-05-09 07:00:2137#include "content/browser/media/forwarding_audio_stream_factory.h"
Taiyo Mizuhashi15ba3bc2025-01-28 04:20:3138#include "content/browser/preloading/prefetch/prefetch_handle_impl.h"
Yoshiki Tanioka49b4cfb2022-10-20 09:25:3139#include "content/browser/preloading/prerender/prerender_final_status.h"
Sreeja Kamishettyc227f7a2022-07-08 22:33:1540#include "content/browser/preloading/prerender/prerender_handle_impl.h"
danakj2adf8322020-09-15 22:06:4941#include "content/browser/renderer_host/frame_tree.h"
42#include "content/browser/renderer_host/frame_tree_node.h"
43#include "content/browser/renderer_host/navigation_controller_delegate.h"
44#include "content/browser/renderer_host/navigation_controller_impl.h"
45#include "content/browser/renderer_host/navigator_delegate.h"
Jeremy Roman2d8dfe132021-07-06 20:51:2646#include "content/browser/renderer_host/page_delegate.h"
Sreeja Kamishetty3dde6312021-06-22 14:05:2947#include "content/browser/renderer_host/page_impl.h"
danakj2adf8322020-09-15 22:06:4948#include "content/browser/renderer_host/render_frame_host_delegate.h"
49#include "content/browser/renderer_host/render_frame_host_manager.h"
[email protected]2e3bf992012-05-24 17:36:2450#include "content/browser/renderer_host/render_view_host_delegate.h"
creisc014b402015-04-23 16:41:4551#include "content/browser/renderer_host/render_view_host_impl.h"
[email protected]4ca76c02012-05-16 16:19:0552#include "content/browser/renderer_host/render_widget_host_delegate.h"
Joe Mason1fc3e2e2021-11-02 05:25:0753#include "content/browser/renderer_host/visible_time_request_trigger.h"
Avi Drissmanbd3e986442020-05-20 21:09:2054#include "content/browser/web_contents/file_chooser_impl.h"
Shintaro Kawamura1042d572024-09-30 13:52:2255#include "content/browser/web_contents/slow_web_preference_cache.h"
[email protected]8d128d62011-09-13 22:11:5756#include "content/common/content_export.h"
Mike Wassermand3609c1f2023-02-28 20:03:1357#include "content/public/browser/fullscreen_types.h"
Lukasz Anforowicz09060bdf72018-08-23 15:53:1758#include "content/public/browser/global_routing_id.h"
Guido Urdaneta73fa6632019-01-14 18:46:2659#include "content/public/browser/media_stream_request.h"
Angel Alvarez902496682019-08-27 22:58:4260#include "content/public/browser/mhtml_generation_result.h"
Liviu Tintacf066d52024-07-24 16:00:5561#include "content/public/browser/preloading.h"
[email protected]58f5d562011-12-20 17:13:0362#include "content/public/browser/web_contents.h"
Patrick Monette15442a12025-01-22 20:09:3163#include "content/public/browser/web_contents_capability_type.h"
dalecurtis88c240072015-12-09 02:11:1864#include "content/public/browser/web_contents_observer.h"
Benjamin Keen919ed0f2025-02-25 15:47:2065#include "media/base/picture_in_picture_events_info.h"
Miyoung Shin040d8342021-02-23 15:12:3166#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
Miyoung Shin59f39ff2019-09-17 07:23:2067#include "mojo/public/cpp/bindings/pending_receiver.h"
Julie Jeongeun Kimcaacf9102019-09-12 02:13:0568#include "mojo/public/cpp/bindings/pending_remote.h"
Miyoung Shin298d5ad2019-09-05 01:52:3769#include "mojo/public/cpp/bindings/remote.h"
[email protected]0dd3a0ab2011-02-18 08:17:4470#include "net/base/load_states.h"
Xiao Ma29b2d1e62024-06-13 06:17:0971#include "net/base/network_handle.h"
miktdc1d5a62024-07-29 20:43:0272#include "partition_alloc/buildflags.h"
Scott Violet02e38b92018-03-27 23:42:1473#include "ppapi/buildflags/buildflags.h"
Ke He31d0bb02018-02-24 07:16:2474#include "services/device/public/mojom/geolocation_context.mojom.h"
Sandor Major878f8352025-02-18 20:16:0275#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
Kinuko Yasuda433f710a2020-02-14 02:11:5876#include "services/network/public/mojom/fetch_api.mojom-forward.h"
Mario Sanchez Prada0bd8b8c2020-10-21 17:49:2377#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
Gyuyoung Kim1ac4ca782020-09-11 03:32:5178#include "third_party/blink/public/common/web_preferences/web_preferences.h"
Abhijeet Kandalkar849ceff2019-02-28 17:37:2979#include "third_party/blink/public/mojom/choosers/color_chooser.mojom.h"
Lei Zhang2764bca2021-07-15 02:00:0780#include "third_party/blink/public/mojom/choosers/popup_menu.mojom-forward.h"
81#include "third_party/blink/public/mojom/frame/blocked_navigation_types.mojom-shared.h"
Henrique Ferreiroba535472020-04-21 11:38:3682#include "third_party/blink/public/mojom/frame/frame.mojom-forward.h"
Hans Wennborg78b52182021-06-15 13:42:1583#include "third_party/blink/public/mojom/frame/text_autosizer_page_info.mojom.h"
Michellebb18e2d2023-02-22 04:52:2284#include "third_party/blink/public/mojom/input/input_handler.mojom-shared.h"
Lei Zhang2764bca2021-07-15 02:00:0785#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-forward.h"
Lei Zhang3ee2b78a2021-05-18 20:58:4486#include "third_party/blink/public/mojom/media/capture_handle_config.mojom.h"
Lei Zhang2764bca2021-07-15 02:00:0787#include "third_party/blink/public/mojom/page/display_cutout.mojom-shared.h"
Amanda Bakerf48f04b2024-03-26 18:12:3388#include "third_party/blink/public/mojom/page/draggable_region.mojom-forward.h"
Lei Zhang2764bca2021-07-15 02:00:0789#include "third_party/blink/public/mojom/page/page_visibility_state.mojom-shared.h"
Ahmed Elwasefi79a665e2024-10-01 18:24:4790#include "ui/accessibility/ax_location_and_scroll_updates.h"
Dominic Mazzoni90501482018-09-05 22:43:3191#include "ui/accessibility/ax_mode.h"
Nektarios Paisios8e9da982024-02-20 23:14:2292#include "ui/accessibility/ax_node.h"
Alexander Surkov862feee2021-01-29 21:27:4893#include "ui/accessibility/platform/inspect/ax_event_recorder.h"
Henrique Ferreiro299008ec2020-12-29 14:36:2894#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h"
David Bokand6e44055b2022-09-21 03:58:0895#include "ui/base/ime/mojom/virtual_keyboard_types.mojom.h"
Md Hasibul Hasan2fe709feb2024-09-12 15:39:5696#include "ui/base/mojom/window_show_state.mojom-forward.h"
Sonja7b2b7762023-09-06 08:33:0897#include "ui/base/ui_base_types.h"
Sean Kaud730f5b2023-06-22 16:21:3398#include "ui/color/color_provider_key.h"
tom855c4bf32021-09-30 00:27:2699#include "ui/color/color_provider_source_observer.h"
tfarinaebe974f02015-01-03 04:25:32100#include "ui/gfx/geometry/size.h"
Rune Lillesveen5d8c49982019-04-24 19:07:30101#include "ui/native_theme/native_theme.h"
Alison Maher7f366dc62020-03-03 19:46:00102#include "ui/native_theme/native_theme_observer.h"
[email protected]0dd3a0ab2011-02-18 08:17:44103
Xiaohan Wang24ec9342022-01-15 17:34:22104#if BUILDFLAG(IS_ANDROID)
Bo Liu168c8642017-08-28 18:26:02105#include "content/public/browser/android/child_process_importance.h"
blundellf5316fc2017-05-15 11:49:03106#endif
107
Marijn Kruisselbrink46fa4bd2019-07-11 18:15:47108namespace base {
109class FilePath;
evliu7f736f02019-11-07 17:43:50110} // namespace base
Marijn Kruisselbrink46fa4bd2019-07-11 18:15:47111
Dale Curtisc496a7762021-02-24 01:15:44112namespace device {
113namespace mojom {
114class WakeLock;
115}
116} // namespace device
117
Kartar Singhb1bfa1a2024-06-24 13:14:57118namespace input {
119class RenderWidgetHostInputEventRouter;
120} // namespace input
121
Tsuyoshi Horobcd0b9f62023-06-28 11:35:32122namespace network::mojom {
123class SharedDictionaryAccessDetails;
124} // namespace network::mojom
125
rockot400ea35b2016-10-15 19:15:32126namespace service_manager {
sammcf5f1b0f2016-09-20 23:05:11127class InterfaceProvider;
evliu7f736f02019-11-07 17:43:50128} // namespace service_manager
sammcf5f1b0f2016-09-20 23:05:11129
Jacques Newman517ba1842024-04-16 00:51:07130namespace ui {
Jacques Newmanedb30062024-04-16 22:37:02131struct AXUpdatesAndEvents;
Jacques Newman517ba1842024-04-16 00:51:07132}
133
[email protected]e582fdd2011-12-20 16:48:17134namespace content {
Greg Thompson92d069b2025-01-30 20:26:27135class AccessibilityModePolicy;
David Bokan1bdb3701f2021-04-30 22:02:35136class JavaScriptDialogDismissNotifier;
Becca Hughes112832e2019-06-11 17:19:02137enum class PictureInPictureResult;
Lei Zhang2764bca2021-07-15 02:00:07138class BeforeUnloadBlockingDelegate; // content_browser_test_utils_internal.h
[email protected]7a846df2012-09-20 19:17:39139class BrowserPluginEmbedder;
140class BrowserPluginGuest;
paulmeyerc0b762b2016-04-13 11:55:17141class FindRequestManager;
Tommy Steimele95348e2024-01-09 21:15:33142class MediaSession;
qinmin58567c82015-01-07 21:00:20143class MediaWebContentsObserver;
Reilly Grantafbe2242020-02-20 21:14:55144class NFCHost;
Ari Chivukula2d8d5e02024-11-04 20:09:57145class PartitionedPopinsController;
Jinsuk Kim895b2c52018-07-03 06:49:16146class RenderFrameHost;
Ian Barkley-Yeungbda77fb2020-12-08 04:26:46147class RenderFrameHostImpl;
[email protected]eaabba22012-03-07 15:02:11148class RenderViewHost;
[email protected]5a3bdf52012-05-24 15:12:57149class RenderViewHostDelegateView;
[email protected]b24b68a2012-09-24 21:57:26150class RenderWidgetHostImpl;
Donn Denmana6d91832023-11-28 21:25:46151class SafeAreaInsetsHost;
[email protected]35869622012-10-26 23:23:55152class SavePackage;
Greg Thompsonf855bf882024-01-30 10:39:45153class ScopedAccessibilityMode;
Mike Wassermanb213b9352020-04-16 00:32:34154class ScreenChangeMonitor;
lunalud4a2cc82016-11-22 00:27:23155class ScreenOrientationProvider;
Sharon Yangefe52632022-03-08 23:06:06156class SiteInstanceGroup;
Lei Zhang2764bca2021-07-15 02:00:07157// For web_contents_impl_browsertest.cc
158class TestWCDelegateForDialogsAndFullscreen;
[email protected]80e776ae2012-03-23 16:17:20159class TestWebContents;
ekaramadadd882292016-06-08 15:22:56160class TextInputManager;
Aman Verma3047aa412024-05-28 09:09:24161class TouchEmulatorImpl;
Lei Zhang2764bca2021-07-15 02:00:07162class WakeLockContextHost;
[email protected]674bc592011-12-20 23:00:42163class WebContentsDelegate;
[email protected]8ff00d72012-10-23 19:12:21164class WebContentsImpl;
[email protected]fc2b46b2014-05-03 16:33:45165class WebContentsView;
dewittj6dc5747a2016-05-17 01:48:47166struct MHTMLGenerationParams;
Sreeja Kamishettyac12140e2022-07-14 22:16:51167class PreloadingAttempt;
[email protected]f66df822012-05-18 16:52:17168
rockot5c478a72016-09-28 23:14:18169namespace mojom {
170class CreateNewWindowParams;
evliu7f736f02019-11-07 17:43:50171} // namespace mojom
rockot5c478a72016-09-28 23:14:18172
Xiaohan Wang24ec9342022-01-15 17:34:22173#if BUILDFLAG(IS_ANDROID)
[email protected]0e813a52014-08-13 10:34:56174class WebContentsAndroid;
danakj30f733132019-09-20 16:14:14175#endif
[email protected]0e813a52014-08-13 10:34:56176
K. Moon9ae6ef2c2022-08-18 01:30:06177#if BUILDFLAG(ENABLE_PPAPI)
zqzhang181047e62016-07-01 13:37:17178class PepperPlaybackObserver;
179#endif
180
Joel Hockey8c2011b22020-04-30 05:07:19181// CreatedWindow holds the WebContentsImpl and target url between IPC calls to
182// CreateNewWindow and ShowCreatedWindow.
183struct CONTENT_EXPORT CreatedWindow {
184 CreatedWindow();
185 CreatedWindow(std::unique_ptr<WebContentsImpl> contents, GURL target_url);
186 CreatedWindow(CreatedWindow&&);
187 CreatedWindow(const CreatedWindow&) = delete;
188 CreatedWindow& operator=(CreatedWindow&&);
189 CreatedWindow& operator=(const CreatedWindow&) = delete;
190 ~CreatedWindow();
191
192 std::unique_ptr<WebContentsImpl> contents;
193 GURL target_url;
194};
195
Yuzu Saijobe024af02020-05-11 07:35:56196using PageVisibilityState = blink::mojom::PageVisibilityState;
197
Nancy Xiao4f3eae5d62023-04-25 19:38:59198using ClipboardPasteData = content::ClipboardPasteData;
199
Aman Verma3047aa412024-05-28 09:09:24200class CONTENT_EXPORT WebContentsImpl
201 : public WebContents,
202 public FrameTree::Delegate,
203 public RenderFrameHostDelegate,
204 public RenderViewHostDelegate,
205 public RenderWidgetHostDelegate,
206 public RenderFrameHostManager::Delegate,
207 public PageDelegate,
208 public blink::mojom::ColorChooserFactory,
209 public NavigationControllerDelegate,
210 public NavigatorDelegate,
211 public ui::NativeThemeObserver,
212 public ui::ColorProviderSourceObserver,
Shintaro Kawamura1042d572024-09-30 13:52:22213 public SlowWebPreferenceCacheObserver,
Aman Vermaea1fcd02024-11-07 20:04:28214 public input::RenderWidgetHostInputEventRouter::Delegate,
215 public input::mojom::RenderInputRouterDelegateClient {
[email protected]0dd3a0ab2011-02-18 08:17:44216 public:
benwells5e7260d2017-03-20 23:36:33217 class FriendWrapper;
nickf9acfbe2014-12-23 19:12:37218
Peter Boström828b9022021-09-21 02:28:43219 WebContentsImpl(const WebContentsImpl&) = delete;
220 WebContentsImpl& operator=(const WebContentsImpl&) = delete;
221
dchengc2282aa2014-10-21 12:07:58222 ~WebContentsImpl() override;
[email protected]0dd3a0ab2011-02-18 08:17:44223
erikchen50735fd2018-05-05 15:08:33224 static std::unique_ptr<WebContentsImpl> CreateWithOpener(
[email protected]54944cde2012-12-09 09:24:59225 const WebContents::CreateParams& params,
Ian Clelland5cbaaf82017-11-27 22:00:03226 RenderFrameHostImpl* opener_rfh);
[email protected]d1198fd2012-08-13 22:50:19227
[email protected]95640212014-07-26 18:14:30228 static std::vector<WebContentsImpl*> GetAllWebContents();
229
paulmeyerfeafc2d2017-04-25 21:46:40230 static WebContentsImpl* FromFrameTreeNode(
231 const FrameTreeNode* frame_tree_node);
Patrick Monette275a6f92b2020-01-09 21:05:04232 static WebContents* FromRenderFrameHostID(
Alexander Timin8690530c2021-06-19 00:34:32233 GlobalRenderFrameHostId render_frame_host_id);
clamy0d32d6d2015-11-24 11:16:26234 static WebContents* FromRenderFrameHostID(int render_process_host_id,
235 int render_frame_host_id);
Avi Drissmane4de1252024-09-05 00:15:45236 static WebContents* FromFrameTreeNodeId(FrameTreeNodeId frame_tree_node_id);
paulmeyerfeafc2d2017-04-25 21:46:40237 static WebContentsImpl* FromOuterFrameTreeNode(
238 const FrameTreeNode* frame_tree_node);
Matt Falkenhagen888db592021-09-07 20:20:25239 static WebContentsImpl* FromRenderWidgetHostImpl(RenderWidgetHostImpl* rwh);
Fergal Daly5b64d472021-10-14 04:31:29240 static WebContentsImpl* FromRenderFrameHostImpl(RenderFrameHostImpl* rfh);
clamya16aa8172015-05-26 13:07:25241
[email protected]d1198fd2012-08-13 22:50:19242 // Complex initialization here. Specifically needed to avoid having
243 // members call back into our virtual functions in the constructor.
Harkiran Bolaria5ce27632022-01-20 15:05:05244 // The primary main frame policy might be passed down as it is inherited from
245 // the opener when WebContents is created with an opener.
246 virtual void Init(const WebContents::CreateParams& params,
247 blink::FramePolicy primary_main_frame_policy);
[email protected]d1198fd2012-08-13 22:50:19248
[email protected]c7dd2f62011-07-18 15:57:59249 // Returns the SavePackage which manages the page saving job. May be NULL.
250 SavePackage* save_package() const { return save_package_.get(); }
251
[email protected]738f57a2013-06-29 21:06:54252 // Sets a BrowserPluginGuest object for this WebContents. If this WebContents
253 // has a BrowserPluginGuest then that implies that it is being hosted by
254 // a BrowserPlugin object in an embedder renderer process.
Albert J. Wongc55cc64d2018-10-12 02:50:04255 void SetBrowserPluginGuest(std::unique_ptr<BrowserPluginGuest> guest);
[email protected]738f57a2013-06-29 21:06:54256
[email protected]7a846df2012-09-20 19:17:39257 // Returns embedder browser plugin object, or NULL if this WebContents is not
258 // an embedder.
[email protected]f8497342013-02-05 22:15:02259 BrowserPluginEmbedder* GetBrowserPluginEmbedder() const;
[email protected]738f57a2013-06-29 21:06:54260
Ehsan Karamadfa983e82018-11-13 01:26:42261 // Returns guest browser plugin object, or nullptr if this WebContents is not
262 // for guest.
263 BrowserPluginGuest* GetBrowserPluginGuest() const;
264
fsamuel60b42282015-03-10 03:29:14265 // Creates a BrowserPluginEmbedder object for this WebContents if one doesn't
266 // already exist.
267 void CreateBrowserPluginEmbedderIfNecessary();
268
creis89a0f782015-05-27 16:13:17269 // Cancels modal dialogs in this WebContents, as well as in any browser
270 // plugins it is hosting.
271 void CancelActiveAndPendingDialogs();
272
[email protected]cf200a562013-05-03 16:24:29273 // Informs the render view host and the BrowserPluginEmbedder, if present, of
274 // a Drag Source End.
Ella Ge80a52dce2017-11-15 18:01:52275 void DragSourceEndedAt(float client_x,
276 float client_y,
277 float screen_x,
278 float screen_y,
Henrique Ferreiro299008ec2020-12-29 14:36:28279 ui::mojom::DragOperation operation,
Paul Meyer0c58c3712016-11-17 22:59:51280 RenderWidgetHost* source_rwh);
[email protected]cf200a562013-05-03 16:24:29281
jam73f892642016-09-11 06:04:06282 // Notification that the RenderViewHost's load state changed.
Dave Tapuskae1a08aaf2021-03-05 18:31:59283 void LoadStateChanged(network::mojom::LoadInfoPtr load_info);
jam73f892642016-09-11 06:04:06284
Collin Baker989e0882019-11-01 01:27:17285 // Updates the visibility and notifies observers. Note that this is
286 // distinct from UpdateWebContentsVisibility which may also update the
287 // visibility of renderer-side objects.
288 void SetVisibilityAndNotifyObservers(Visibility visibility);
Francois Dorayfe4a1772018-02-17 04:17:09289
calamity7fe55ce2015-04-10 03:59:37290 // Notify observers that the web contents has been focused.
Michael Thiessen896405db2017-07-20 17:52:32291 void NotifyWebContentsFocused(RenderWidgetHost* render_widget_host);
calamity7fe55ce2015-04-10 03:59:37292
zijiehe3bee08e22017-05-17 04:14:46293 // Notify observers that the web contents has lost focus.
Michael Thiessen896405db2017-07-20 17:52:32294 void NotifyWebContentsLostFocus(RenderWidgetHost* render_widget_host);
zijiehe3bee08e22017-05-17 04:14:46295
[email protected]fc2b46b2014-05-03 16:33:45296 WebContentsView* GetView() const;
297
Mike Wasserman5a3cc61d2020-08-27 21:12:03298 // Called on screen information changes; |is_multi_screen_changed| is true iff
299 // the plurality of connected screens changed (e.g. 1 screen <-> 2 screens).
300 void OnScreensChange(bool is_multi_screen_changed);
301
leon.han552e9de2017-02-09 14:37:30302 void OnScreenOrientationChange();
303
304 ScreenOrientationProvider* GetScreenOrientationProviderForTesting() const {
305 return screen_orientation_provider_.get();
306 }
leon.hane4db177a2017-02-07 14:19:16307
Aman Vermab3ed74e2024-04-29 13:58:13308 // Return RenderWidgetHostView from RWHIER.
309 std::vector<RenderWidgetHostView*> GetRenderWidgetHostViewsForTests();
310
Aman Vermabb589a32024-05-07 16:38:17311 bool IsDelegatedInkRendererBoundForTest() {
312 return delegated_ink_point_renderer_.is_bound();
313 }
314
[email protected]95640212014-07-26 18:14:30315 // Adds the given accessibility mode to the current accessibility mode
316 // bitmap.
Greg Thompsonf855bf882024-01-30 10:39:45317 void AddAccessibilityModeForTesting(ui::AXMode mode);
[email protected]95640212014-07-26 18:14:30318
wjmaclean64951902016-04-29 20:59:12319 // Sets the zoom level for frames associated with this WebContents.
akabac6bd1212018-06-25 20:10:48320 void UpdateZoom();
wjmaclean64951902016-04-29 20:59:12321
W. James MacLean37af605e2025-01-20 16:59:38322 // Sets the zoom level for frames associated with the subtree for which
323 // `rfh_id` is a local root. Used by guest views and oopif-pdfs.
324 void UpdateZoom(const GlobalRenderFrameHostId& rfh_id);
325
wjmaclean64951902016-04-29 20:59:12326 // Sets the zoom level for frames associated with this WebContents if it
327 // matches |host| and (if non-empty) |scheme|. Matching is done on the
W. James MacLean37af605e2025-01-20 16:59:38328 // last committed entry of the main frame.
wjmaclean64951902016-04-29 20:59:12329 void UpdateZoomIfNecessary(const std::string& scheme,
akabac6bd1212018-06-25 20:10:48330 const std::string& host);
W. James MacLean37af605e2025-01-20 16:59:38331 // Same as above, except uses the last committed entry on `rfh`.
332 void UpdateZoomIfNecessary(const std::string& scheme,
333 const std::string& host,
334 RenderFrameHostImpl* rfh);
akabac6bd1212018-06-25 20:10:48335
paulmeyerfeafc2d2017-04-25 21:46:40336 // Returns the focused WebContents.
337 // If there are multiple inner/outer WebContents (when embedding <webview>,
338 // <guestview>, ...) returns the single one containing the currently focused
339 // frame. Otherwise, returns this WebContents.
340 WebContentsImpl* GetFocusedWebContents();
341
Dave Tapuskad8b0530f2021-10-19 15:12:31342 // Returns the focused FrameTree. For MPArch we may return a different
343 // focused frame tree even though the focused WebContents is the same.
344 FrameTree* GetFocusedFrameTree();
345
Lukasz Anforowicz2cd231bf2020-10-02 19:13:20346 // TODO(lukasza): Maybe this method can be removed altogether (so that the
347 // focus of the location bar is only set in the //chrome layer).
348 void SetFocusToLocationBar();
349
paulmeyerfeafc2d2017-04-25 21:46:40350 // Returns a vector containing this WebContents and all inner WebContents
351 // within it (recursively).
352 std::vector<WebContentsImpl*> GetWebContentsAndAllInner();
353
Carlos Caballero40b0efd2021-01-26 11:55:00354 // Returns the primary FrameTree for this WebContents (as opposed to the
Carlos Caballerob65b6e3a2021-11-15 10:09:00355 // ones held by MPArch features like Prerender or Fenced Frame).
Kevin McNee88bf2242022-11-23 00:27:34356 // See docs/frame_trees.md for more details.
Carlos Caballerob65b6e3a2021-11-15 10:09:00357 FrameTree& GetPrimaryFrameTree() { return primary_frame_tree_; }
Carlos Caballero40b0efd2021-01-26 11:55:00358
Carlos Caballeroede6f8c2021-01-28 11:01:50359 // Whether the initial empty page of this view has been accessed by another
360 // page, making it unsafe to show the pending URL. Always false after the
361 // first commit.
Alison Gale770f3fc2024-04-27 00:39:58362 // TODO(crbug.com/40165695): Rename to HasAccessedInitialMainDocument
Carlos Caballeroede6f8c2021-01-28 11:01:50363 bool HasAccessedInitialDocument();
364
Xiaohan Wang24ec9342022-01-15 17:34:22365#if BUILDFLAG(IS_ANDROID)
Khushalb8aabcf42021-06-22 11:55:03366 void SetPrimaryMainFrameImportance(ChildProcessImportance importance);
Bo Liu168c8642017-08-28 18:26:02367#endif
Bo Liu7c6779e92017-08-16 02:02:28368
Kuznetsov Alexey1a516bd2021-08-04 23:49:05369 // Returns the human-readable name for title in Media Controls.
370 // If the returned value is an empty string, it means that there is no
371 // human-readable name.
372 std::string GetTitleForMediaControls();
373
Greg Thompsonf855bf882024-01-30 10:39:45374 // Sets the accessibility mode if this WebContents will potentially be
375 // user-visible, and broadcasts it to all of its frames if it differs from the
Greg Thompson92d069b2025-01-30 20:26:27376 // previous mode. Application of the new mode may be deferred to a later time
377 // by the AccessibilityModePolicy.
Greg Thompsonf855bf882024-01-30 10:39:45378 void SetAccessibilityMode(ui::AXMode mode);
379
Elad Alonb0a3fc82024-04-03 18:22:34380 // Inform the WebContentsImpl object that a write-access Captured Surface
381 // Control API was invoked (sendWheel, setZoomLevel) for this object.
382 // A notification is then propagated to observers.
383 void DidCapturedSurfaceControl();
384
Jinsuk Kimc8eac442024-07-19 18:33:52385 // Let long press on links select the link text instead of triggering
386 // the context menu.
387#if BUILDFLAG(IS_ANDROID)
388 void SetLongPressLinkSelectText(bool enabled);
389#endif
390
[email protected]8ff00d72012-10-23 19:12:21391 // WebContents ------------------------------------------------------
Jeremy Romana0b70c32023-11-09 22:22:53392 WebContentsDelegate* GetDelegate() final;
dchengc2282aa2014-10-21 12:07:58393 void SetDelegate(WebContentsDelegate* delegate) override;
394 NavigationControllerImpl& GetController() override;
Elad Alon32044f532025-03-04 22:16:03395 const NavigationControllerImpl& GetController() const override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41396 BrowserContext* GetBrowserContext() override;
Claudio DeSouza2be02d42021-08-12 23:23:40397 base::WeakPtr<WebContents> GetWeakPtr() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41398 const GURL& GetURL() override;
399 const GURL& GetVisibleURL() override;
Elad Alon32044f532025-03-04 22:16:03400 const GURL& GetLastCommittedURL() const override;
Peter Kasting2caacff62023-05-24 16:06:53401 const RenderFrameHostImpl* GetPrimaryMainFrame() const override;
Dave Tapuska1d5e5772022-06-02 17:26:01402 RenderFrameHostImpl* GetPrimaryMainFrame() override;
Sreeja Kamishetty3dde6312021-06-22 14:05:29403 PageImpl& GetPrimaryPage() override;
nick53d5cbf2015-04-23 22:50:14404 RenderFrameHostImpl* GetFocusedFrame() override;
Avi Drissmane4de1252024-09-05 00:15:45405 bool IsPrerenderedFrame(FrameTreeNodeId frame_tree_node_id) override;
creisf71a2632017-05-04 19:03:50406 RenderFrameHostImpl* UnsafeFindFrameByFrameTreeNodeId(
Avi Drissmane4de1252024-09-05 00:15:45407 FrameTreeNodeId frame_tree_node_id) override;
Daniel Cheng982f2b22022-08-25 23:46:16408 void ForEachRenderFrameHostWithAction(
409 base::FunctionRef<FrameIterationAction(RenderFrameHost*)> on_frame)
410 override;
Kevin McNeec9d0fda2021-05-19 15:55:17411 void ForEachRenderFrameHost(
Daniel Cheng982f2b22022-08-25 23:46:16412 base::FunctionRef<void(RenderFrameHost*)> on_frame) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41413 RenderViewHostImpl* GetRenderViewHost() override;
414 RenderWidgetHostView* GetRenderWidgetHostView() override;
lfg265a2672016-04-23 03:11:02415 RenderWidgetHostView* GetTopLevelRenderWidgetHostView() override;
naskoc0fceff2015-04-30 15:53:52416 void ClosePage() override;
Arthur Sonzognic686e8f2024-01-11 08:36:37417 std::optional<SkColor> GetThemeColor() override;
418 std::optional<SkColor> GetBackgroundColor() override;
419 void SetPageBaseBackgroundColor(std::optional<SkColor> color) override;
tom855c4bf32021-09-30 00:27:26420 void SetColorProviderSource(ui::ColorProviderSource* source) override;
Sean Kaud730f5b2023-06-22 16:21:33421 ui::ColorProviderKey::ColorMode GetColorMode() const override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41422 WebUI* GetWebUI() override;
Maks Orlovich73f374d2020-04-02 12:46:13423 void SetUserAgentOverride(const blink::UserAgentOverride& ua_override,
Changwan Ryuc1134a82018-03-07 02:10:14424 bool override_in_new_tabs) override;
Scott Violet2a6c5bff2020-04-29 23:59:06425 void SetRendererInitiatedUserAgentOverrideOption(
426 NavigationController::UserAgentOverrideOption option) override;
Maks Orlovich73f374d2020-04-02 12:46:13427 const blink::UserAgentOverride& GetUserAgentOverride() override;
Scott Violet2a6c5bff2020-04-29 23:59:06428 bool ShouldOverrideUserAgentForRendererInitiatedNavigation() override;
Aman Vermaa4b33cf2023-06-13 19:32:33429 void SetAlwaysSendSubresourceNotifications() override;
430 bool GetSendSubresourceNotification() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41431 bool IsWebContentsOnlyAccessibilityModeForTesting() override;
432 bool IsFullAccessibilityModeForTesting() override;
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58433 const std::u16string& GetTitle() override;
Stanley Honf83c4b8b2025-01-08 00:52:30434 const std::optional<std::u16string>& GetApplicationTitle() override;
afakhry6f0c1ec22016-07-14 13:55:13435 void UpdateTitleForEntry(NavigationEntry* entry,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58436 const std::u16string& title) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41437 SiteInstanceImpl* GetSiteInstance() override;
438 bool IsLoading() override;
439 double GetLoadProgress() override;
Nate Chapin9aabf5f2021-11-12 00:31:19440 bool ShouldShowLoadingUI() override;
Sreeja Kamishetty81347582022-01-06 12:46:33441 bool IsDocumentOnLoadCompletedInPrimaryMainFrame() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41442 bool IsWaitingForResponse() override;
Lijin Shen8c0f4362024-03-25 20:05:09443 bool HasUncommittedNavigationInPrimaryMainFrame() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41444 const net::LoadStateWithParam& GetLoadState() override;
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58445 const std::u16string& GetLoadStateHost() override;
Avi Drissman1e620f32018-03-16 13:57:29446 void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,
Dominic Mazzoni77d0aba2021-01-14 09:42:16447 ui::AXMode ax_mode,
Dominic Mazzoni77d0aba2021-01-14 09:42:16448 size_t max_nodes,
Vladimir Levinf01905d2024-07-23 13:35:21449 base::TimeDelta timeout,
450 AXTreeSnapshotPolicy policy) override;
Mark Schillacic1e067e82025-04-02 17:36:11451 ui::AXTreeUpdate RequestAXTreeSnapshotWithinBrowserProcess() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41452 uint64_t GetUploadSize() override;
453 uint64_t GetUploadPosition() override;
454 const std::string& GetEncoding() override;
Thomas Lukaszewicz8ada31b2024-09-01 19:18:16455 void Discard() override;
Charles Zhaod72f99d2018-09-17 14:18:27456 bool WasDiscarded() override;
Thomas Lukaszewicz034b34f2024-08-29 22:44:32457 void SetWasDiscarded(bool was_discarded) override;
Daniel Cheng9c9fa1a2022-01-14 03:42:11458 [[nodiscard]] base::ScopedClosureRunner IncrementCapturerCount(
Dale Curtis7030f252021-04-07 14:05:31459 const gfx::Size& capture_size,
460 bool stay_hidden,
Elad Alon0feb6602021-10-14 09:26:36461 bool stay_awake,
Avi Drissman5710b062024-07-02 21:23:29462 bool is_activity) override;
Elad Alonf156eb62021-05-17 22:02:37463 const blink::mojom::CaptureHandleConfig& GetCaptureHandleConfig() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41464 bool IsBeingCaptured() override;
Xianzhu Wangc61434c2020-08-21 19:17:30465 bool IsBeingVisiblyCaptured() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41466 bool IsAudioMuted() override;
dchengc2282aa2014-10-21 12:07:58467 void SetAudioMuted(bool mute) override;
Jan Rucka442c83f2017-08-08 13:27:54468 bool IsCurrentlyAudible() override;
Patrick Monette15442a12025-01-22 20:09:31469 bool IsCapabilityActive(WebContentsCapabilityType capability_type) override;
Austin Sullivanafefb722021-01-14 01:26:39470 bool HasFileSystemAccessHandles() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41471 bool HasPictureInPictureVideo() override;
Klaus Weidnerd8219432022-02-08 21:50:59472 bool HasPictureInPictureDocument() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41473 bool IsCrashed() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41474 base::TerminationStatus GetCrashedStatus() override;
475 int GetCrashedErrorCode() override;
476 bool IsBeingDestroyed() override;
dchengc2282aa2014-10-21 12:07:58477 void NotifyNavigationStateChanged(InvalidateTypes changed_flags) override;
Chris Hamiltondf0d72cd2018-05-29 16:23:53478 void OnAudioStateChanged() override;
Olivier ROBIN4b58dd932024-08-06 13:30:32479 base::TimeTicks GetLastActiveTimeTicks() override;
Olivier ROBINda292fb2024-08-07 14:32:29480 base::Time GetLastActiveTime() override;
dchengc2282aa2014-10-21 12:07:58481 void WasShown() override;
482 void WasHidden() override;
Francois Doray18800972017-08-25 22:38:58483 void WasOccluded() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41484 Visibility GetVisibility() override;
Rakina Zata Amni26e8d8a2020-08-05 06:06:06485 bool NeedToFireBeforeUnloadOrUnloadEvents() override;
Chris Hamilton3b3e315d2018-09-19 13:16:21486 void DispatchBeforeUnload(bool auto_cancel) override;
Dave Tapuska82b54012022-07-15 23:26:10487 void AttachInnerWebContents(
488 std::unique_ptr<WebContents> inner_web_contents,
489 RenderFrameHost* render_frame_host,
Dave Tapuska82b54012022-07-15 23:26:10490 bool is_full_page) override;
Kevin McNee2585e732024-10-28 22:11:19491 void AttachGuestPage(std::unique_ptr<GuestPageHolder> guest_page,
492 RenderFrameHost* outer_render_frame_host) override;
W. James MacLean2539adb32019-12-13 00:40:44493 bool IsInnerWebContentsForGuest() override;
Lucas Furukawa Gadani2ec00c82018-12-14 15:53:16494 RenderFrameHostImpl* GetOuterWebContentsFrame() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41495 WebContentsImpl* GetOuterWebContents() override;
W. James MacLean3f9fba232018-08-16 15:20:36496 WebContentsImpl* GetOutermostWebContents() override;
Lucas Furukawa Gadani2ec00c82018-12-14 15:53:16497 std::vector<WebContents*> GetInnerWebContents() override;
Jeremy Roman7e70bf952020-01-07 23:23:58498 WebContentsImpl* GetResponsibleWebContents() override;
dalecurtis6c58ed02016-10-28 23:02:37499 void DidChangeVisibleSecurityState() override;
Bruce Long1e3e1f542019-10-16 17:56:28500 void SyncRendererPrefs() override;
dchengc2282aa2014-10-21 12:07:58501 void Stop() override;
Francois Doray47f759d2018-06-11 18:13:51502 void SetPageFrozen(bool frozen) override;
erikchen6c7df7f7a2018-05-03 18:13:59503 std::unique_ptr<WebContents> Clone() override;
arthursonzogni818c2642019-09-27 12:18:10504 void ReloadFocusedFrame() override;
dchengc2282aa2014-10-21 12:07:58505 void Undo() override;
506 void Redo() override;
507 void Cut() override;
508 void Copy() override;
509 void CopyToFindPboard() override;
Leonard Greyc2bc8002023-03-08 17:53:06510 void CenterSelection() override;
dchengc2282aa2014-10-21 12:07:58511 void Paste() override;
512 void PasteAndMatchStyle() override;
513 void Delete() override;
514 void SelectAll() override;
yabinh351e7ec2017-03-10 02:43:24515 void CollapseSelection() override;
Leonard Greyf378e7d2021-03-25 20:53:50516 void ScrollToTopOfDocument() override;
517 void ScrollToBottomOfDocument() override;
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58518 void Replace(const std::u16string& word) override;
519 void ReplaceMisspelling(const std::u16string& word) override;
Andrew Paseltiner31c56ab2024-11-20 18:26:19520 void NotifyContextMenuClosed(
521 const GURL& link_followed,
522 const std::optional<blink::Impression>&) override;
Gyuyoung Kim1bc1ba82021-02-08 23:32:44523 void ExecuteCustomContextMenuCommand(int action,
524 const GURL& link_followed) override;
dchengc2282aa2014-10-21 12:07:58525 gfx::NativeView GetNativeView() override;
526 gfx::NativeView GetContentNativeView() override;
527 gfx::NativeWindow GetTopLevelNativeWindow() override;
528 gfx::Rect GetContainerBounds() override;
529 gfx::Rect GetViewBounds() override;
530 DropData* GetDropData() override;
531 void Focus() override;
532 void SetInitialFocus() override;
533 void StoreFocus() override;
534 void RestoreFocus() override;
535 void FocusThroughTabTraversal(bool reverse) override;
dchengc2282aa2014-10-21 12:07:58536 bool IsSavable() override;
537 void OnSavePage() override;
538 bool SavePage(const base::FilePath& main_file,
539 const base::FilePath& dir_path,
540 SavePageType save_type) override;
Yao Xiaoe5007042021-02-26 02:32:09541 void SaveFrame(const GURL& url,
542 const Referrer& referrer,
543 RenderFrameHost* rfh) override;
kundaji6c7f9692015-03-09 18:00:37544 void SaveFrameWithHeaders(const GURL& url,
545 const Referrer& referrer,
Xing Liu10329bf2018-03-20 19:22:14546 const std::string& headers,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58547 const std::u16string& suggested_filename,
Jeremy Roman4d408d8a2024-01-10 02:27:21548 RenderFrameHost* rfh,
549 bool is_subresource) override;
dewittj6dc5747a2016-05-17 01:48:47550 void GenerateMHTML(const MHTMLGenerationParams& params,
Avi Drissman149b7832018-03-23 14:31:49551 base::OnceCallback<void(int64_t)> callback) override;
Angel Alvarez902496682019-08-27 22:58:42552 void GenerateMHTMLWithResult(
553 const MHTMLGenerationParams& params,
554 MHTMLGenerationResult::GenerateMHTMLCallback callback) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41555 const std::string& GetContentsMimeType() override;
Mario Sanchez Prada0bd8b8c2020-10-21 17:49:23556 blink::RendererPreferences* GetMutableRendererPrefs() override;
dchengc2282aa2014-10-21 12:07:58557 void Close() override;
dchengc2282aa2014-10-21 12:07:58558 void SetClosedByUserGesture(bool value) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41559 bool GetClosedByUserGesture() override;
560 int GetMinimumZoomPercent() override;
561 int GetMaximumZoomPercent() override;
mcnee432e47d2015-11-09 19:37:46562 void SetPageScale(float page_scale_factor) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41563 gfx::Size GetPreferredSize() override;
Takumi Fujimoto4661871d2024-01-25 02:04:18564 bool GotResponseToPointerLockRequest(
James Hollyerd5c9de462020-03-10 19:02:45565 blink::mojom::PointerLockResult result) override;
Takumi Fujimoto4661871d2024-01-25 02:04:18566 void GotPointerLockPermissionResponse(bool allowed) override;
567 void DropPointerLockForTesting() override;
Joe Downing13dd76b2018-04-09 18:32:15568 bool GotResponseToKeyboardLockRequest(bool allowed) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41569 bool HasOpener() override;
570 RenderFrameHostImpl* GetOpener() override;
Rakina Zata Amni3a48ae42022-05-05 03:39:56571 bool HasLiveOriginalOpenerChain() override;
572 WebContents* GetFirstWebContentsInLiveOriginalOpenerChain() override;
Tom Burginf0e48622024-05-16 15:06:12573#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
dchengc2282aa2014-10-21 12:07:58574 void DidChooseColorInColorChooser(SkColor color) override;
575 void DidEndColorChooser() override;
Julie Jeongeun Kim88ce9ec2023-07-28 02:25:40576#endif
Jacob Francis0043f242024-07-24 21:46:21577 int DownloadImageFromAxNode(const ui::AXTreeID tree_id,
578 const ui::AXNodeID node_id,
579 const gfx::Size& preferred_size,
580 uint32_t max_bitmap_size,
581 bool bypass_cache,
582 ImageDownloadCallback callback) override;
dchengc2282aa2014-10-21 12:07:58583 int DownloadImage(const GURL& url,
584 bool is_favicon,
Rouslan Solomakhindb19343e2021-09-15 15:34:55585 const gfx::Size& preferred_size,
dchengc2282aa2014-10-21 12:07:58586 uint32_t max_bitmap_size,
pkotwiczfd773552015-03-16 00:29:14587 bool bypass_cache,
Avi Drissmana5a52dd2018-03-27 03:39:02588 ImageDownloadCallback callback) override;
Jacob Francis0043f242024-07-24 21:46:21589
Danyao Wanga78f3dd22020-03-05 05:31:27590 int DownloadImageInFrame(
Alexander Timin8690530c2021-06-19 00:34:32591 const GlobalRenderFrameHostId& initiator_frame_routing_id,
Danyao Wanga78f3dd22020-03-05 05:31:27592 const GURL& url,
593 bool is_favicon,
Rouslan Solomakhindb19343e2021-09-15 15:34:55594 const gfx::Size& preferred_size,
Danyao Wanga78f3dd22020-03-05 05:31:27595 uint32_t max_bitmap_size,
596 bool bypass_cache,
597 WebContents::ImageDownloadCallback callback) override;
dchengc2282aa2014-10-21 12:07:58598 void Find(int request_id,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58599 const std::u16string& search_text,
Joey Arharcac45bf2022-01-07 21:59:31600 blink::mojom::FindOptionsPtr options,
Avi Drissman5710b062024-07-02 21:23:29601 bool skip_delay) override;
dchengc2282aa2014-10-21 12:07:58602 void StopFinding(StopFindAction action) override;
Tommy Steimel18360512017-11-01 00:38:19603 bool WasEverAudible() override;
Avi Drissman97aef042020-06-30 21:04:48604 bool IsFullscreen() override;
Malay Keshav87c42c02019-01-15 08:37:47605 bool ShouldShowStaleContentOnEviction() override;
Muyao Xudb226be52023-12-01 04:23:09606 void ExitFullscreen(bool will_cause_resize) override;
Daniel Cheng9c9fa1a2022-01-14 03:42:11607 [[nodiscard]] base::ScopedClosureRunner ForSecurityDropFullscreen(
Avi Drissman5710b062024-07-02 21:23:29608 int64_t display_id) override;
mariakhomenko44bdc4732015-04-29 01:55:38609 void ResumeLoadingCreatedWebContents() override;
qinmin72e8bd02016-10-21 19:35:37610 void SetIsOverlayContent(bool is_overlay_content) override;
ekaramad5c1f9392017-01-25 02:05:23611 bool IsFocusedElementEditable() override;
612 void ClearFocusedElement() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41613 bool IsShowingContextMenu() override;
ekaramadf6750aa2017-06-06 18:29:42614 void SetShowingContextMenu(bool showing) override;
Aidan Wolter52bcc12a2018-11-14 03:27:29615 base::UnguessableToken GetAudioGroupId() override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41616 bool CompletedFirstVisuallyNonEmptyPaint() override;
Miyoung Shin5709ab02020-02-19 06:50:41617 void UpdateFaviconURL(
Kevin McNeefb86fcf2021-02-26 23:20:57618 RenderFrameHostImpl* source,
Ian Vollick6d75ac32021-05-05 17:45:09619 const std::vector<blink::mojom::FaviconURLPtr>& candidates) override;
Miyoung Shin5709ab02020-02-19 06:50:41620 const std::vector<blink::mojom::FaviconURLPtr>& GetFaviconURLs() override;
Mugdha Lakhani0a0d7862020-07-29 09:58:45621 void Resize(const gfx::Rect& new_bounds) override;
622 gfx::Size GetSize() override;
Amanda Baker228ec482021-03-24 19:50:08623 void UpdateWindowControlsOverlay(const gfx::Rect& bounding_rect) override;
Xiaohan Wang24ec9342022-01-15 17:34:22624#if BUILDFLAG(IS_ANDROID)
dcheng48d97c52015-02-04 20:03:20625 base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() override;
Nicolas Ouellet-Payeur177a6c42023-01-25 20:25:07626 base::android::ScopedJavaLocalRef<jthrowable> GetJavaCreatorLocation()
627 override;
Kevin McNee576bb5d82019-05-29 16:47:51628 WebContentsAndroid* GetWebContentsAndroid();
629 void ClearWebContentsAndroid();
paulmeyerc0b762b2016-04-13 11:55:17630 void ActivateNearestFindResult(float x, float y) override;
631 void RequestFindMatchRects(int current_version) override;
rockot400ea35b2016-10-15 19:15:32632 service_manager::InterfaceProvider* GetJavaInterfaces() override;
[email protected]155c7f22013-12-09 17:07:18633#endif
Evan Stade6decc972022-10-24 19:42:18634 bool HasRecentInteraction() override;
Takashi Toyoshimad72a465a2024-03-11 23:37:31635 [[nodiscard]] ScopedIgnoreInputEvents IgnoreInputEvents(
636 std::optional<WebInputEventAuditCallback> audit_callback) override;
Erik Chenfac576802024-11-14 15:26:33637 bool ShouldIgnoreInputEventsForTesting() override;
Sebastien Marchandc38e5ae2021-02-18 20:28:13638 bool HasActiveEffectivelyFullscreenVideo() override;
Alexander Timinbebb2002021-04-20 15:42:24639 void WriteIntoTrace(perfetto::TracedValue context) override;
Lukasz Anforowicz2c1573a2021-09-21 18:58:18640 const base::Location& GetCreatorLocation() override;
Arthur Sonzognic686e8f2024-01-11 08:36:37641 const std::optional<blink::mojom::PictureInPictureWindowOptions>&
Tommy Steimel57eafde2023-01-27 17:33:24642 GetPictureInPictureOptions() const override;
Peilin Wangae08e26e2024-06-10 20:55:30643 void UpdateBrowserControlsState(
644 cc::BrowserControlsState constraints,
645 cc::BrowserControlsState current,
646 bool animate,
Peilin Wang1187e4e82025-02-10 08:53:29647 const std::optional<cc::BrowserControlsOffsetTagModifications>&
648 offset_tag_modifications) override;
Marja Hölttä2019e9d2023-09-07 14:07:35649 void SetV8CompileHints(base::ReadOnlySharedMemoryRegion data) override;
Joe Mason7ae0e2b2021-11-01 12:30:36650 void SetTabSwitchStartTime(base::TimeTicks start_time,
Joe Masonb7004352022-04-06 03:11:08651 bool destination_is_loaded) override;
Takashi Toyoshima8dfc05c2024-01-29 21:03:51652 bool IsInPreviewMode() const override;
653 void WillActivatePreviewPage() override;
Takashi Toyoshima138cf44a2023-11-02 10:33:25654 void ActivatePreviewPage() override;
Min Qin7b7cbbbf2018-06-04 21:49:31655
[email protected]0bfbf882011-12-22 18:19:27656 // Implementation of PageNavigator.
HuanPo Lin0d795c62024-03-28 03:54:05657 WebContents* OpenURL(const OpenURLParams& params,
658 base::OnceCallback<void(content::NavigationHandle&)>
659 navigation_handle_callback) override;
[email protected]151a63d2011-12-20 22:32:52660
Gyuyoung Kim1ac4ca782020-09-11 03:32:51661 const blink::web_pref::WebPreferences& GetOrCreateWebPreferences() override;
Rakina Zata Amni347b70902020-07-22 10:49:04662 void NotifyPreferencesChanged() override;
Gyuyoung Kim1ac4ca782020-09-11 03:32:51663 void SetWebPreferences(const blink::web_pref::WebPreferences& prefs) override;
Rakina Zata Amni4029b6d2020-07-28 02:36:20664 void OnWebPreferencesChanged() override;
Rakina Zata Amni347b70902020-07-22 10:49:04665
Thomas Lukaszewicz034b34f2024-08-29 22:44:32666 void AboutToBeDiscarded(WebContents* new_contents) override;
Thomas Lukaszewicz8ada31b2024-09-01 19:18:16667 void NotifyWasDiscarded() override;
Thomas Lukaszewicz034b34f2024-08-29 22:44:32668
Jan Keitel1d8d51d2023-08-22 05:53:47669 [[nodiscard]] base::ScopedClosureRunner CreateDisallowCustomCursorScope(
670 int max_dimension_dips) override;
Andy Paicu5608bda82023-03-03 15:09:20671
Charles Mengc2cca37e2023-08-15 18:14:30672 void SetOverscrollNavigationEnabled(bool enabled) override;
673
[email protected]92404c62013-12-04 16:40:46674 // RenderFrameHostDelegate ---------------------------------------------------
nicka0ac8382016-12-15 23:59:23675 bool OnMessageReceived(RenderFrameHostImpl* render_frame_host,
dchengc2282aa2014-10-21 12:07:58676 const IPC::Message& message) override;
Abhijeet Kandalkarde7348e2020-01-13 06:06:54677 void OnDidBlockNavigation(
678 const GURL& blocked_url,
679 const GURL& initiator_url,
680 blink::mojom::NavigationBlockedReason reason) override;
Kevin McNeefb86fcf2021-02-26 23:20:57681 void OnDidFinishLoad(RenderFrameHostImpl* render_frame_host,
Gyuyoung Kim525e0c5d2020-03-09 15:04:19682 const GURL& url) override;
Sreeja Kamishettycfb4b862022-03-29 16:59:39683 void OnManifestUrlChanged(PageImpl& page) override;
Kevin McNeefb86fcf2021-02-26 23:20:57684 void RenderFrameCreated(RenderFrameHostImpl* render_frame_host) override;
685 void RenderFrameDeleted(RenderFrameHostImpl* render_frame_host) override;
Gyuyoung Kim1bc1ba82021-02-08 23:32:44686 void ShowContextMenu(
Dave Tapuskacf5a9622024-11-03 19:01:27687 RenderFrameHostImpl& render_frame_host,
Gyuyoung Kim1bc1ba82021-02-08 23:32:44688 mojo::PendingAssociatedRemote<blink::mojom::ContextMenuClient>
689 context_menu_client,
690 const ContextMenuParams& params) override;
Kevin McNeefb86fcf2021-02-26 23:20:57691 void RunJavaScriptDialog(RenderFrameHostImpl* render_frame_host,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58692 const std::u16string& message,
693 const std::u16string& default_prompt,
avi777ff452017-02-09 19:04:48694 JavaScriptDialogType dialog_type,
Carlos IL5c669bc2021-05-26 21:16:24695 bool disable_third_party_subframe_suppresion,
Dave Tapuskacdf545cc2020-01-23 18:38:52696 JavaScriptDialogCallback response_callback) override;
Dave Tapuskabe4fbe42025-01-08 16:31:43697 void Close(RenderFrameHostImpl* render_frame_host) override;
Dave Tapuskacdf545cc2020-01-23 18:38:52698 void RunBeforeUnloadConfirm(
Kevin McNeefb86fcf2021-02-26 23:20:57699 RenderFrameHostImpl* render_frame_host,
Dave Tapuskacdf545cc2020-01-23 18:38:52700 bool is_reload,
701 JavaScriptDialogCallback response_callback) override;
Kevin McNeefb86fcf2021-02-26 23:20:57702 void DidChangeName(RenderFrameHostImpl* render_frame_host,
alexmosbe2f4c32015-03-10 02:30:23703 const std::string& name) override;
John Delaneyb625dca92021-04-14 17:00:34704 void DidReceiveUserActivation(
Kevin McNeefb86fcf2021-02-26 23:20:57705 RenderFrameHostImpl* render_frame_host) override;
Jonathan Njeunjeb769687652023-06-15 16:46:30706 void WebAuthnAssertionRequestSucceeded(
707 RenderFrameHostImpl* render_frame_host) override;
Robert Sesekc4eeccbd2021-07-23 21:20:19708 void BindDisplayCutoutHost(
709 RenderFrameHostImpl* render_frame_host,
710 mojo::PendingAssociatedReceiver<blink::mojom::DisplayCutoutHost> receiver)
711 override;
Kevin McNeefb86fcf2021-02-26 23:20:57712 void DidChangeDisplayState(RenderFrameHostImpl* render_frame_host,
John Delaney0146a742019-01-25 19:25:28713 bool is_display_none) override;
Kevin McNeefb86fcf2021-02-26 23:20:57714 void FrameSizeChanged(RenderFrameHostImpl* render_frame_host,
John Delaney0146a742019-01-25 19:25:28715 const gfx::Size& frame_size) override;
Kevin McNeefb86fcf2021-02-26 23:20:57716 void DOMContentLoaded(RenderFrameHostImpl* render_frame_host) override;
717 void DocumentOnLoadCompleted(RenderFrameHostImpl* render_frame_host) override;
718 void UpdateTitle(RenderFrameHostImpl* render_frame_host,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58719 const std::u16string& title,
dchengc2282aa2014-10-21 12:07:58720 base::i18n::TextDirection title_direction) override;
Haben Foto533aa352024-01-09 22:01:16721 // The app title is an alternative title. If non-empty, the browser may choose
722 // to use the app title instead of the regular title for a web app displayed
723 // in an app window. See
724 // https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DocumentSubtitle/explainer.md
Stanley Honf83c4b8b2025-01-08 00:52:30725 void UpdateApplicationTitle(RenderFrameHostImpl* render_frame_host,
726 const std::u16string& application_title) override;
Kevin McNeefb86fcf2021-02-26 23:20:57727 void UpdateTargetURL(RenderFrameHostImpl* render_frame_host,
Mario Sanchez Pradadffbe66e2020-09-07 12:01:08728 const GURL& url) override;
danakj77eb7e82020-01-09 19:38:46729 bool IsNeverComposited() override;
Elad Alonf156eb62021-05-17 22:02:37730 void SetCaptureHandleConfig(
731 blink::mojom::CaptureHandleConfigPtr config) override;
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:41732 ui::AXMode GetAccessibilityMode() override;
James Wallace-Leeeafc94cb92018-07-23 21:35:09733 // Broadcasts the mode change to all frames.
Greg Thompsonf855bf882024-01-30 10:39:45734 void ResetAccessibility() override;
Mario Sanchez Prada5d7f1ac2020-07-16 17:18:40735 void AXTreeIDForMainFrameHasChanged() override;
David Tseng63bbdea2024-05-30 17:40:34736 void ProcessAccessibilityUpdatesAndEvents(
737 ui::AXUpdatesAndEvents& details) override;
dmazzoni2400c462016-08-23 15:07:13738 void AccessibilityLocationChangesReceived(
Ahmed Elwasefi79a665e2024-10-01 18:24:47739 const ui::AXTreeID& tree_id,
740 ui::AXLocationAndScrollUpdates& details) override;
Nektarios Paisios8e9da982024-02-20 23:14:22741 ui::AXNode* GetAccessibilityRootNode() override;
Alexander Surkov2ab51622020-09-02 12:01:42742 std::string DumpAccessibilityTree(
Abigail Kleinabb428332019-09-13 18:26:21743 bool internal,
Alexander Surkov90482882020-10-12 16:30:38744 std::vector<ui::AXPropertyFilter> property_filters) override;
Jacques Newmane313e142024-03-13 18:47:22745 std::string DumpAccessibilityTree(
746 ui::AXApiType::Type api_type,
747 std::vector<ui::AXPropertyFilter> property_filters) override;
Mark Schillaciac6c9f72025-04-02 17:37:34748 void ApplyAXTreeFixingResult(ui::AXTreeID tree_id,
749 ui::AXNodeID node_id,
750 ax::mojom::Role role) override;
Abigail Kleinbb8304bd2020-05-18 21:44:18751 void RecordAccessibilityEvents(
752 bool start_recording,
Arthur Sonzognic686e8f2024-01-11 08:36:37753 std::optional<ui::AXEventCallback> callback) override;
Jacques Newmane313e142024-03-13 18:47:22754 void RecordAccessibilityEvents(
755 ui::AXApiType::Type api_type,
756 bool start_recording,
757 std::optional<ui::AXEventCallback> callback) override;
Aaron Leventhal6ceb5882024-04-17 15:19:38758 void UnrecoverableAccessibilityError() override;
Ke He7319dbe2017-11-09 05:54:44759 device::mojom::GeolocationContext* GetGeolocationContext() override;
ke.he98b761e2017-05-09 05:59:17760 device::mojom::WakeLockContext* GetWakeLockContext() override;
Xiaohan Wang24ec9342022-01-15 17:34:22761#if BUILDFLAG(IS_ANDROID)
Reilly Grantafbe2242020-02-20 21:14:55762 void GetNFC(RenderFrameHost*,
763 mojo::PendingReceiver<device::mojom::NFC>) override;
blundellf5316fc2017-05-15 11:49:03764#endif
Mike Wasserman16f130da2024-04-17 23:03:30765 bool CanEnterFullscreenMode(RenderFrameHostImpl* requesting_frame) override;
Dave Tapuskaa4189512019-10-15 20:27:34766 void EnterFullscreenMode(
Kevin McNeefb86fcf2021-02-26 23:20:57767 RenderFrameHostImpl* requesting_frame,
Dave Tapuskaa4189512019-10-15 20:27:34768 const blink::mojom::FullscreenOptions& options) override;
Muyao Xudb226be52023-12-01 04:23:09769 void ExitFullscreenMode(bool will_cause_resize) override;
Batalov Vladislave9a5f3822020-12-02 07:31:11770 void FullscreenStateChanged(
Kevin McNeefb86fcf2021-02-26 23:20:57771 RenderFrameHostImpl* rfh,
Batalov Vladislave9a5f3822020-12-02 07:31:11772 bool is_fullscreen,
773 blink::mojom::FullscreenOptionsPtr options) override;
Jeremy Roman608bcab2023-11-09 22:29:30774 bool CanUseWindowingControls(RenderFrameHostImpl* requesting_frame) override;
Ivan Šandrk5277117562023-07-05 14:07:28775 void Maximize() override;
Ivan Šandrk1b68e6e2023-06-29 11:47:22776 void Minimize() override;
Ivan Šandrkbf6b7302023-07-05 15:16:02777 void Restore() override;
Michael Thiessene5663522022-05-25 21:23:28778#if BUILDFLAG(IS_ANDROID)
779 void UpdateUserGestureCarryoverInfo() override;
780#endif
Avi Drissman36f801f2018-02-01 20:06:04781 void DidCallFocus() override;
ekaramada110f642016-12-21 19:47:28782 void OnFocusedElementChangedInFrame(
783 RenderFrameHostImpl* frame,
Emily Stark023dbacc2020-08-27 22:31:40784 const gfx::Rect& bounds_in_root_view,
785 blink::mojom::FocusType focus_type) override;
Lucas Furukawa Gadaniabbfa342017-08-29 19:37:57786 void OnAdvanceFocus(RenderFrameHostImpl* source_rfh) override;
Alexander Timin9666d502021-06-19 01:34:50787 FrameTree* CreateNewWindow(
Kevin McNeefb86fcf2021-02-26 23:20:57788 RenderFrameHostImpl* opener,
nick5ae4d2d2017-01-06 01:18:35789 const mojom::CreateNewWindowParams& params,
Albert J. Wong65fe64d2019-09-20 02:48:14790 bool is_new_browsing_instance,
Sergey Kuznetsov32257a22019-02-11 20:26:50791 bool has_user_gesture,
nick5ae4d2d2017-01-06 01:18:35792 SessionStorageNamespace* session_storage_namespace) override;
Stefan Zager6f6e57c2025-03-19 22:03:45793 WebContents* ShowCreatedWindow(
794 RenderFrameHostImpl* opener,
795 int main_frame_widget_route_id,
796 WindowOpenDisposition disposition,
797 const blink::mojom::WindowFeatures& window_features,
798 bool user_gesture) override;
Sreeja Kamishetty49783302022-01-28 17:52:25799 void PrimaryMainDocumentElementAvailable() override;
carloskd9d97942017-02-16 08:58:09800 void PassiveInsecureContentFound(const GURL& resource_url) override;
Carlos IL29294a62020-05-15 00:21:16801 bool ShouldAllowRunningInsecureContent(bool allowed_per_prefs,
carloskd9d97942017-02-16 08:58:09802 const url::Origin& origin,
803 const GURL& resource_url) override;
Lukasz Anforowicze1b954d92017-10-30 21:28:06804 void ViewSource(RenderFrameHostImpl* frame) override;
Kevin McNeefb86fcf2021-02-26 23:20:57805 void PrintCrossProcessSubframe(
806 const gfx::Rect& rect,
807 int document_cookie,
808 RenderFrameHostImpl* render_frame_host) override;
ckitagawa8695799b2020-02-05 16:08:49809 void CapturePaintPreviewOfCrossProcessSubframe(
810 const gfx::Rect& rect,
811 const base::UnguessableToken& guid,
Kevin McNeefb86fcf2021-02-26 23:20:57812 RenderFrameHostImpl* render_frame_host) override;
Xiaohan Wang24ec9342022-01-15 17:34:22813#if BUILDFLAG(IS_ANDROID)
rob.buis300b0872017-03-10 20:43:58814 base::android::ScopedJavaLocalRef<jobject> GetJavaRenderFrameHostDelegate()
815 override;
816#endif
Jay Civelli116683f2018-03-27 19:56:23817 void ResourceLoadComplete(
Kevin McNeefb86fcf2021-02-26 23:20:57818 RenderFrameHostImpl* render_frame_host,
Clark DuVall36164bd2018-08-09 22:49:08819 const GlobalRequestID& request_id,
Minggang Wangee5af392020-02-05 02:55:28820 blink::mojom::ResourceLoadInfoPtr resource_load_information) override;
Alexander Timin1cc31f42020-05-12 16:26:01821 void OnCookiesAccessed(RenderFrameHostImpl*,
822 const CookieAccessDetails& details) override;
Steven Valdeza06f680c2023-03-21 19:00:10823 void OnTrustTokensAccessed(RenderFrameHostImpl*,
824 const TrustTokenAccessDetails& details) override;
Tsuyoshi Horobcd0b9f62023-06-28 11:35:32825 void OnSharedDictionaryAccessed(
826 RenderFrameHostImpl*,
827 const network::mojom::SharedDictionaryAccessDetails& details) override;
Daniel Rubery6420d74302024-11-19 01:42:40828 void OnDeviceBoundSessionAccessed(
829 RenderFrameHostImpl* render_frame_host,
Daniel Rubery7cdfa532025-01-24 16:57:50830 const net::device_bound_sessions::SessionAccess& access) override;
Joanne de Abreu7cdb0862024-05-03 21:12:42831 void NotifyStorageAccessed(RenderFrameHostImpl*,
832 blink::mojom::StorageTypeAccessed storage_type,
833 bool blocked) override;
Seung Jae Limc16c5e12024-05-10 23:30:00834 void OnVibrate(RenderFrameHostImpl*) override;
835
Sandor Major878f8352025-02-18 20:16:02836 std::optional<network::ParsedPermissionsPolicy>
Robbie McElrath34dab002024-02-23 20:12:35837 GetPermissionsPolicyForIsolatedWebApp(RenderFrameHostImpl* source) override;
Raymond Toye413650c2018-08-31 00:12:47838
839 // Called when WebAudio starts or stops playing audible audio in an
840 // AudioContext.
Kevin McNeefb86fcf2021-02-26 23:20:57841 void AudioContextPlaybackStarted(RenderFrameHostImpl* host,
Raymond Toye413650c2018-08-31 00:12:47842 int context_id) override;
Kevin McNeefb86fcf2021-02-26 23:20:57843 void AudioContextPlaybackStopped(RenderFrameHostImpl* host,
Raymond Toye413650c2018-08-31 00:12:47844 int context_id) override;
Kevin McNeefb86fcf2021-02-26 23:20:57845 void OnFrameAudioStateChanged(RenderFrameHostImpl* host,
Chris Hamilton16ca64a2020-05-14 23:13:17846 bool is_audible) override;
Patrick Monettebade7342024-09-09 14:07:10847 void OnRemoteSubframeViewportIntersectionStateChanged(
848 RenderFrameHostImpl* host,
849 const blink::mojom::ViewportIntersectionState&
850 viewport_intersection_state) override;
Patrick Monette214fab672023-10-29 03:56:06851 void OnFrameVisibilityChanged(
852 RenderFrameHostImpl* host,
853 blink::mojom::FrameVisibility visibility) override;
Patrick Monette6f1fc912023-11-21 22:10:18854 void OnFrameIsCapturingMediaStreamChanged(
Patrick Monette031229b2023-11-02 17:21:18855 RenderFrameHostImpl* host,
Patrick Monette6f1fc912023-11-21 22:10:18856 bool is_capturing_media_stream) override;
Kevin McNee5f594382021-05-06 23:18:23857 std::vector<FrameTreeNode*> GetUnattachedOwnedNodes(
858 RenderFrameHostImpl* owner) override;
Dave Tapuskaf9fc3122019-10-18 19:42:55859 void RegisterProtocolHandler(RenderFrameHostImpl* source,
860 const std::string& protocol,
861 const GURL& url,
Dave Tapuskaf9fc3122019-10-18 19:42:55862 bool user_gesture) override;
863 void UnregisterProtocolHandler(RenderFrameHostImpl* source,
864 const std::string& protocol,
865 const GURL& url,
866 bool user_gesture) override;
Carlos Caballeroede6f8c2021-01-28 11:01:50867 bool IsAllowedToGoToEntryAtOffset(int32_t offset) override;
Dominique Fauteux-Chapleau4407a85d2024-01-05 13:18:58868 void IsClipboardPasteAllowedByPolicy(
869 const ClipboardEndpoint& source,
870 const ClipboardEndpoint& destination,
871 const ClipboardMetadata& metadata,
Nancy Xiao4f3eae5d62023-04-25 19:38:59872 ClipboardPasteData clipboard_paste_data,
Dominique Fauteux-Chapleau4407a85d2024-01-05 13:18:58873 IsClipboardPasteAllowedCallback callback) override;
siashah1cac9c52024-07-09 23:50:36874 void OnTextCopiedToClipboard(RenderFrameHostImpl* render_frame_host,
875 const std::u16string& copied_text) override;
Dominique Fauteux-Chapleau4407a85d2024-01-05 13:18:58876 void IsClipboardPasteAllowedWrapperCallback(
877 IsClipboardPasteAllowedCallback callback,
Arthur Sonzognic686e8f2024-01-11 08:36:37878 std::optional<ClipboardPasteData> clipboard_paste_data);
Kevin McNee3183a7792021-11-09 21:03:36879 void OnPageScaleFactorChanged(PageImpl& source) override;
Robert Sesek5047c412021-08-09 17:36:18880 void BindScreenOrientation(
881 RenderFrameHost* rfh,
882 mojo::PendingAssociatedReceiver<device::mojom::ScreenOrientation>
883 receiver) override;
Mike Wassermanc22b77442024-01-02 19:10:18884 bool IsTransientActivationRequiredForHtmlFullscreen() override;
Dave Tapuskadfff7382021-04-23 19:46:41885 bool IsBackForwardCacheSupported() override;
Dave Tapuska42f9b902020-10-23 21:57:06886 RenderWidgetHostImpl* CreateNewPopupWidget(
Dave Tapuska80fb72522022-03-18 21:34:23887 base::SafeRef<SiteInstanceGroup> site_instance_group,
Dave Tapuska04ccda062020-10-21 21:58:12888 int32_t route_id,
889 mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost>
890 blink_popup_widget_host,
891 mojo::PendingAssociatedReceiver<blink::mojom::WidgetHost>
892 blink_widget_host,
893 mojo::PendingAssociatedRemote<blink::mojom::Widget> blink_widget)
894 override;
Gyuyoung Kim1905f7c2020-05-02 00:00:24895 void DidLoadResourceFromMemoryCache(
896 RenderFrameHostImpl* source,
897 const GURL& url,
898 const std::string& http_request,
899 const std::string& mime_type,
Arthur Sonzogni54013f22021-09-03 14:57:12900 network::mojom::RequestDestination request_destination,
901 bool include_credentials) override;
Ewelina Baraned2df8ad2021-12-22 10:05:37902 void DomOperationResponse(RenderFrameHost* render_frame_host,
903 const std::string& json_string) override;
Gyuyoung Kim4c50517842020-06-04 17:50:44904 void SavableResourceLinksResponse(
905 RenderFrameHostImpl* source,
906 const std::vector<GURL>& resources_list,
907 blink::mojom::ReferrerPtr referrer,
908 const std::vector<blink::mojom::SavableSubframePtr>& subframes) override;
909 void SavableResourceLinksError(RenderFrameHostImpl* source) override;
Sreeja Kamishettybe0ccd6b2020-06-09 11:52:50910 void RenderFrameHostStateChanged(
Sreeja Kamishetty2771b7d2021-04-07 06:34:18911 RenderFrameHost* render_frame_host,
912 RenderFrameHost::LifecycleState old_state,
913 RenderFrameHost::LifecycleState new_state) override;
Dave Tapuska3f201fa2020-10-28 14:17:10914 void SetWindowRect(const gfx::Rect& new_bounds) override;
Kevin McNee5604b1c42025-01-09 22:30:40915 void UpdateWindowPreferredSize(RenderFrameHostImpl* render_frame_host,
916 const gfx::Size& pref_size) override;
Camille Lamy8766bd3e2020-11-26 11:36:32917 std::vector<RenderFrameHostImpl*>
918 GetActiveTopLevelDocumentsInBrowsingContextGroup(
919 RenderFrameHostImpl* render_frame_host) override;
Arthur Hemery79d203e2023-05-26 11:52:45920 std::vector<RenderFrameHostImpl*>
921 GetActiveTopLevelDocumentsInCoopRelatedGroup(
922 RenderFrameHostImpl* render_frame_host) override;
Hiroki Nakagawa1cb14552021-04-23 03:37:34923 PrerenderHostRegistry* GetPrerenderHostRegistry() override;
K. Moon9ae6ef2c2022-08-18 01:30:06924#if BUILDFLAG(ENABLE_PPAPI)
Dave Tapuska2cf21a472021-01-06 15:56:19925 void OnPepperInstanceCreated(RenderFrameHostImpl* source,
926 int32_t pp_instance) override;
Dave Tapuskac372dba2021-01-06 20:01:07927 void OnPepperInstanceDeleted(RenderFrameHostImpl* source,
928 int32_t pp_instance) override;
Dave Tapuska2cf21a472021-01-06 15:56:19929 void OnPepperStartsPlayback(RenderFrameHostImpl* source,
930 int32_t pp_instance) override;
931 void OnPepperStopsPlayback(RenderFrameHostImpl* source,
932 int32_t pp_instance) override;
Dave Tapuska993dae352021-01-08 17:40:59933 void OnPepperPluginCrashed(RenderFrameHostImpl* source,
934 const base::FilePath& plugin_path,
935 base::ProcessId plugin_pid) override;
Dave Tapuskaef8be1612021-01-11 17:53:14936 void OnPepperPluginHung(RenderFrameHostImpl* source,
937 int plugin_child_id,
938 const base::FilePath& path,
939 bool is_hung) override;
K. Moon9ae6ef2c2022-08-18 01:30:06940#endif // BUILDFLAG(ENABLE_PPAPI)
Dave Tapuska5f966bb72024-11-25 22:39:48941 void DidChangeLoadProgressForMainFrame(
942 RenderFrameHostImpl* render_frame_host) override;
Hyowon Kim5310a2c2022-11-15 03:07:15943 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host,
944 const GURL& url,
945 int error_code) override;
Amanda Bakerf48f04b2024-03-26 18:12:33946 void DraggableRegionsChanged(
947 const std::vector<blink::mojom::DraggableRegionPtr>& regions) override;
Rakina Zata Amni2620dcb2024-11-13 01:41:58948 void OnFirstContentfulPaintInPrimaryMainFrame() override;
Benjamin Beaudryfed497b2025-02-21 05:45:17949 gfx::NativeWindow GetOwnerNativeWindow() override;
Sreeja Kamishettybe0ccd6b2020-06-09 11:52:50950
Benjamin Keenfdd1a3cb2025-04-07 20:53:58951 media::PictureInPictureEventsInfo::AutoPipInfo GetAutoPipInfo()
Benjamin Keen919ed0f2025-02-25 15:47:20952 const override;
953
[email protected]92404c62013-12-04 16:40:46954 // RenderViewHostDelegate ----------------------------------------------------
dchengc2282aa2014-10-21 12:07:58955 RenderViewHostDelegateView* GetDelegateView() override;
dchengc2282aa2014-10-21 12:07:58956 void RenderViewReady(RenderViewHost* render_view_host) override;
957 void RenderViewTerminated(RenderViewHost* render_view_host,
958 base::TerminationStatus status,
959 int error_code) override;
960 void RenderViewDeleted(RenderViewHost* render_view_host) override;
Ian Barkley-Yeung07d8a262020-11-19 22:45:35961 bool DidAddMessageToConsole(
Kevin McNeefb86fcf2021-02-26 23:20:57962 RenderFrameHostImpl* source_frame,
Ian Barkley-Yeung07d8a262020-11-19 22:45:35963 blink::mojom::ConsoleMessageLevel log_level,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58964 const std::u16string& message,
Ian Barkley-Yeung07d8a262020-11-19 22:45:35965 int32_t line_no,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:58966 const std::u16string& source_id,
Arthur Sonzognic686e8f2024-01-11 08:36:37967 const std::optional<std::u16string>& untrusted_stack_trace) override;
Kevin McNee7705fe82024-11-07 18:56:31968 const blink::RendererPreferences& GetRendererPrefs(
969 RenderViewHostImpl* render_view_host) override;
Dave Tapuska183b8d702025-01-07 18:47:18970 const blink::web_pref::WebPreferences& GetOrCreateWebPreferences(
971 RenderViewHostImpl* render_view_host) override;
Daniel Cheng90196c82018-04-25 21:49:14972 void DidReceiveInputEvent(RenderWidgetHostImpl* render_widget_host,
Emily Starkc7bd40c42020-07-21 19:12:55973 const blink::WebInputEvent& event) override;
Takashi Toyoshimad72a465a2024-03-11 23:37:31974 bool ShouldIgnoreWebInputEvents(const blink::WebInputEvent& event) override;
Avi Drissman738ea192018-08-29 20:24:16975 bool ShouldIgnoreInputEvents() override;
dchengc2282aa2014-10-21 12:07:58976 void OnIgnoredUIEvent() override;
dchengc2282aa2014-10-21 12:07:58977 void Activate() override;
alexmosc2a8cec2016-05-23 22:19:53978 void ShowCreatedWidget(int process_id,
Albert J. Wongf6e13ed2018-09-18 15:25:47979 int widget_route_id,
Maksim Sisov113ea342021-08-26 16:19:31980 const gfx::Rect& initial_rect,
981 const gfx::Rect& initial_anchor_rect) override;
Mario Sanchez Pradaf68d98272020-12-09 18:47:52982 void CreateMediaPlayerHostForRenderFrameHost(
Kevin McNeefb86fcf2021-02-26 23:20:57983 RenderFrameHostImpl* frame_host,
Miyoung Shin040d8342021-02-23 15:12:31984 mojo::PendingAssociatedReceiver<media::mojom::MediaPlayerHost> receiver)
985 override;
Dave Tapuskaddcf18f2025-01-13 19:39:36986 void RequestMediaAccessPermission(RenderFrameHostImpl* render_frame_host,
987 const MediaStreamRequest& request,
Mark Pilgrim57499082018-06-12 12:38:30988 MediaResponseCallback callback) override;
Olha Sirikovaa6c4d522024-11-08 18:12:50989
990 void ProcessSelectAudioOutput(const SelectAudioOutputRequest& request,
991 SelectAudioOutputCallback callback) override;
992
Kevin McNeefb86fcf2021-02-26 23:20:57993 bool CheckMediaAccessPermission(RenderFrameHostImpl* render_frame_host,
Raymes Khouryad7c24a12018-03-05 23:22:58994 const url::Origin& security_origin,
Antonio Gomesc8b734b2019-06-05 18:22:16995 blink::mojom::MediaStreamType type) override;
avi85ee8362016-10-08 02:09:08996 bool IsJavaScriptDialogShowing() const override;
avic031d392017-03-03 03:09:42997 bool ShouldIgnoreUnresponsiveRenderer() override;
Charlie Reis3d189602021-04-27 21:24:47998 bool IsGuest() override;
Arthur Sonzognic686e8f2024-01-11 08:36:37999 std::optional<SkColor> GetBaseBackgroundColor() override;
Taiyo Mizuhashi15ba3bc2025-01-28 04:20:311000 std::unique_ptr<PrefetchHandle> StartPrefetch(
1001 const GURL& prefetch_url,
1002 bool use_prefetch_proxy,
1003 const blink::mojom::Referrer& referrer,
1004 const std::optional<url::Origin>& referring_origin,
kenoss8a1493b2025-03-10 08:16:061005 std::optional<net::HttpNoVarySearchData> no_vary_search_hint,
kenossa1af66f12025-03-07 06:10:551006 scoped_refptr<PreloadPipelineInfo> preload_pipeline_info,
Taiyo Mizuhashi15ba3bc2025-01-28 04:20:311007 base::WeakPtr<PreloadingAttempt> attempt,
1008 std::optional<PreloadingHoldbackStatus> holdback_status_override)
1009 override;
Robert Linc37fb582021-11-11 03:18:471010 std::unique_ptr<PrerenderHandle> StartPrerendering(
Asami Doicf0f1642021-11-25 05:00:261011 const GURL& prerendering_url,
Kouhei Ueno3f37992b2023-11-09 23:29:021012 PreloadingTriggerType trigger_type,
Robert Lin125720c042022-01-21 01:14:581013 const std::string& embedder_histogram_suffix,
Hiroki Nakagawa8348bc42024-12-13 16:24:421014 net::HttpRequestHeaders additional_headers,
Rulong Chen(陈汝龙)bf12169c2024-12-16 05:38:161015 std::optional<net::HttpNoVarySearchData> no_vary_search_hint,
Lingqi Chi21d9feb2022-02-02 09:42:181016 ui::PageTransition page_transition,
Taiyo Mizuhashibc91f802024-06-20 19:37:221017 bool should_warm_up_compositor,
Lingqi Chia2efa8c2024-11-08 10:20:291018 bool should_prepare_paint_tree,
Domenic Denicolabb5d843c2023-07-18 01:47:331019 PreloadingHoldbackStatus holdback_status_override,
kenoss8e8e4112025-03-07 07:33:331020 scoped_refptr<PreloadPipelineInfo> preload_pipeline_info,
Sreeja Kamishettyac12140e2022-07-14 22:16:511021 PreloadingAttempt* preloading_attempt,
Liviu Tintacf066d52024-07-24 16:00:551022 base::RepeatingCallback<bool(const GURL&,
1023 const std::optional<UrlMatchType>&)>,
Taiyo Mizuhashi72be9642024-03-21 13:45:371024 base::RepeatingCallback<void(NavigationHandle&)>) override;
Hiroki Nakagawa2db55b32024-05-09 08:41:271025 void CancelAllPrerendering() override;
Hiroki Nakagawa68ba6ed92025-01-29 03:39:271026 bool IsAllowedToStartPrerendering() override;
Kevin McNee097680d2023-04-05 22:14:511027 void BackNavigationLikely(PreloadingPredictor predictor,
1028 WindowOpenDisposition disposition) override;
Bo Liud4ced692023-09-18 21:17:141029 void SetOwnerLocationForDebug(
Arthur Sonzognic686e8f2024-01-11 08:36:371030 std::optional<base::Location> owner_location) override;
Sam Davis Omekara (from Dev Box)26b91992023-11-07 20:07:461031 blink::ColorProviderColorMaps GetColorProviderColorMaps() const override;
Rakina Zata Amni347b70902020-07-22 10:49:041032
Joanne de Abreu7cbed872023-10-30 23:25:261033 network::mojom::AttributionSupport GetAttributionSupport() override;
1034 void UpdateAttributionSupportRenderer() override;
1035 static void UpdateAttributionSupportAllRenderers();
William Liu6cf58fe2024-01-19 21:29:321036 BackForwardTransitionAnimationManager*
1037 GetBackForwardTransitionAnimationManager() override;
Xiao Ma29b2d1e62024-06-13 06:17:091038 net::handles::NetworkHandle GetTargetNetwork() override;
Joanne de Abreu7cbed872023-10-30 23:25:261039
Bryant Chandler490c6de2024-01-02 22:08:361040 void GetMediaCaptureRawDeviceIdsOpened(
1041 blink::mojom::MediaStreamType type,
1042 base::OnceCallback<void(std::vector<std::string>)> callback) override;
1043
[email protected]52913802013-12-10 05:52:181044 // NavigatorDelegate ---------------------------------------------------------
1045
clamy0e119882015-07-31 16:12:331046 void DidStartNavigation(NavigationHandle* navigation_handle) override;
1047 void DidRedirectNavigation(NavigationHandle* navigation_handle) override;
clamyefca29e2015-09-17 00:22:111048 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override;
clamy0e119882015-07-31 16:12:331049 void DidFinishNavigation(NavigationHandle* navigation_handle) override;
William Liuc6cc30ec2024-03-14 16:54:161050 void DidCancelNavigationBeforeStart(
1051 NavigationHandle* navigation_handle) override;
William Liub26568da2024-02-21 20:46:141052 void DidNavigateMainFramePreCommit(NavigationHandle* navigation_handle,
Liviu Tinta235581962021-07-14 20:37:071053 bool navigation_is_within_page) override;
dchengc2282aa2014-10-21 12:07:581054 void DidNavigateMainFramePostCommit(
sky8b00392d2015-01-10 00:30:281055 RenderFrameHostImpl* render_frame_host,
Rakina Zata Amniff10975d2021-10-08 06:04:241056 const LoadCommittedDetails& details) override;
dchengc2282aa2014-10-21 12:07:581057 void DidNavigateAnyFramePostCommit(
[email protected]37567b432014-02-12 01:12:221058 RenderFrameHostImpl* render_frame_host,
Rakina Zata Amniff10975d2021-10-08 06:04:241059 const LoadCommittedDetails& details) override;
Rakina Zata Amni742c2022024-07-02 05:29:171060 void DidUpdateNavigationHandleTiming(
1061 NavigationHandle* navigation_handle) override;
dchengc2282aa2014-10-21 12:07:581062 void NotifyChangedNavigationState(InvalidateTypes changed_flags) override;
Alexander Timina0ef6df2021-06-24 13:34:461063 bool ShouldAllowRendererInitiatedCrossProcessNavigation(
Ian Vollick1c6dd3e2022-04-13 02:06:261064 bool is_outermost_main_frame_navigation) override;
Dave Tapuska94a6978a2024-11-22 14:37:291065 const blink::UserAgentOverride& GetUserAgentOverride(
1066 FrameTree& frame_tree) override;
avid6d88b912017-01-13 00:16:001067 std::vector<std::unique_ptr<NavigationThrottle>> CreateThrottlesForNavigation(
clamycbf524d42016-09-27 12:48:351068 NavigationHandle* navigation_handle) override;
David Bokan1bdb3701f2021-04-30 22:02:351069 std::vector<std::unique_ptr<CommitDeferringCondition>>
1070 CreateDeferringConditionsForNavigationCommit(
David Bokan51a6df832022-02-17 18:31:191071 NavigationHandle& navigation_handle,
1072 CommitDeferringCondition::NavigationType type) override;
clamy1e5574e92016-09-29 16:48:441073 std::unique_ptr<NavigationUIData> GetNavigationUIData(
1074 NavigationHandle* navigation_handle) override;
Alexander Timin17edc742020-04-23 18:22:181075 void OnServiceWorkerAccessed(NavigationHandle* navigation,
1076 const GURL& scope,
1077 AllowServiceWorkerResult allowed) override;
Alexander Timin1cc31f42020-05-12 16:26:011078 void OnCookiesAccessed(NavigationHandle*,
1079 const CookieAccessDetails& details) override;
Steven Valdeza06f680c2023-03-21 19:00:101080 void OnTrustTokensAccessed(NavigationHandle*,
1081 const TrustTokenAccessDetails& details) override;
Daniel Rubery6420d74302024-11-19 01:42:401082 void OnDeviceBoundSessionAccessed(
1083 NavigationHandle* navigation_handle,
Daniel Rubery7cdfa532025-01-24 16:57:501084 const net::device_bound_sessions::SessionAccess& access) override;
Tsuyoshi Horobcd0b9f62023-06-28 11:35:321085 void OnSharedDictionaryAccessed(
1086 NavigationHandle*,
1087 const network::mojom::SharedDictionaryAccessDetails& details) override;
W. James MacLeanc07dc41b2022-07-25 18:52:161088 void RegisterExistingOriginAsHavingDefaultIsolation(
W. James MacLeanb70fab82020-05-01 18:51:141089 const url::Origin& origin,
1090 NavigationRequest* navigation_request_to_exclude) override;
Lijin Shene4511c12024-03-19 19:31:301091 bool MaybeCopyContentAreaAsBitmap(
1092 base::OnceCallback<void(const SkBitmap&)> callback) override;
Aldo Culquicondorda38be12025-01-13 16:16:231093 bool SupportsForwardTransitionAnimation() override;
[email protected]52913802013-12-10 05:52:181094
Aldo Culquicondor88fe3962025-01-21 16:04:261095#if BUILDFLAG(IS_ANDROID)
1096 void SetSupportsForwardTransitionAnimation(bool supports);
1097#endif
1098
[email protected]4ca76c02012-05-16 16:19:051099 // RenderWidgetHostDelegate --------------------------------------------------
1100
Ahmed Fakhryfaa32d22018-10-05 15:56:161101 void SetTopControlsShownRatio(RenderWidgetHostImpl* render_widget_host,
1102 float ratio) override;
Ahmed Fakhry58e6ef542018-09-04 18:05:381103 void SetTopControlsGestureScrollInProgress(bool in_progress) override;
lazyboy63f5b312015-11-23 20:19:521104 void RenderWidgetCreated(RenderWidgetHostImpl* render_widget_host) override;
dchengc2282aa2014-10-21 12:07:581105 void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) override;
rouslan2f5993f2015-01-29 00:18:311106 void RenderWidgetWasResized(RenderWidgetHostImpl* render_widget_host,
1107 bool width_changed) override;
Fady Samuel97947112018-05-05 16:24:541108 void ResizeDueToAutoResize(RenderWidgetHostImpl* render_widget_host,
1109 const gfx::Size& new_size) override;
David Black9cca3592019-11-06 23:02:221110 void OnVerticalScrollDirectionChanged(
1111 viz::VerticalScrollDirection scroll_direction) override;
David Bokan7ec5ac922022-11-29 03:31:311112 int GetVirtualKeyboardResizeHeight() override;
Anupam Snigdha915824a2024-03-05 17:55:301113 bool ShouldDoLearning() override;
akabac6bd1212018-06-25 20:10:481114
W. James MacLean37af605e2025-01-20 16:59:381115 double GetPendingZoomLevel(RenderWidgetHostImpl* rwh) override;
akabac6bd1212018-06-25 20:10:481116
Emily Shack381369752025-02-19 20:49:191117 bool PreHandleMouseEvent(const blink::WebMouseEvent& event) override;
skyf65d9bb2017-03-24 02:26:391118 KeyboardEventProcessingResult PreHandleKeyboardEvent(
Kartar Singh5c8e0b22024-05-30 10:32:141119 const input::NativeWebKeyboardEvent& event) override;
Dave Tapuska344399e2019-09-09 15:18:261120 bool HandleMouseEvent(const blink::WebMouseEvent& event) override;
Kartar Singh5c8e0b22024-05-30 10:32:141121 bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
dchengc2282aa2014-10-21 12:07:581122 bool HandleWheelEvent(const blink::WebMouseWheelEvent& event) override;
1123 bool PreHandleGestureEvent(const blink::WebGestureEvent& event) override;
Jacques Newman6f230d782024-08-26 19:13:341124 ui::BrowserAccessibilityManager* GetRootBrowserAccessibilityManager()
1125 override;
1126 ui::BrowserAccessibilityManager* GetOrCreateRootBrowserAccessibilityManager()
anand.ratn120b0b002014-10-07 15:49:321127 override;
lgarron145aaa82015-07-10 07:39:561128 // The following 4 functions are already listed under WebContents overrides:
mohsen7ab1ec16ec2015-07-02 18:26:231129 // void Cut() override;
1130 // void Copy() override;
1131 // void Paste() override;
lgarron145aaa82015-07-10 07:39:561132 // void SelectAll() override;
Dave Tapuskab336b922017-07-06 19:24:051133 void ExecuteEditCommand(const std::string& command,
Arthur Sonzognic686e8f2024-01-11 08:36:371134 const std::optional<std::u16string>& value) override;
mohsen7ab1ec16ec2015-07-02 18:26:231135 void MoveRangeSelectionExtent(const gfx::Point& extent) override;
1136 void SelectRange(const gfx::Point& base, const gfx::Point& extent) override;
Michellebb18e2d2023-02-22 04:52:221137 void SelectAroundCaret(blink::mojom::SelectionGranularity granularity,
1138 bool should_show_handle,
1139 bool should_show_context_menu) override;
Dave Tapuskab336b922017-07-06 19:24:051140 void MoveCaret(const gfx::Point& extent) override;
Aman Verma7908f9562024-12-13 18:45:481141 base::UnguessableToken GetCompositorFrameSinkGroupingId() const override;
Shimi Zhang37deeb22017-09-28 00:59:011142 void AdjustSelectionByCharacterOffset(int start_adjust,
1143 int end_adjust,
1144 bool show_selection_menu) override;
Kartar Singhb1bfa1a2024-06-24 13:14:571145 input::RenderWidgetHostInputEventRouter* GetInputEventRouter() override;
Aman Vermab3ed74e2024-04-29 13:58:131146 void GetRenderWidgetHostAtPointAsynchronously(
1147 RenderWidgetHostViewBase* root_view,
1148 const gfx::PointF& point,
1149 base::OnceCallback<void(base::WeakPtr<RenderWidgetHostViewBase>,
1150 std::optional<gfx::PointF>)> callback) override;
alexmosc4cbacb2015-11-21 01:29:221151 RenderWidgetHostImpl* GetFocusedRenderWidgetHost(
1152 RenderWidgetHostImpl* receiving_widget) override;
avallee9993fca2016-11-17 06:16:501153 RenderWidgetHostImpl* GetRenderWidgetHostWithPageFocus() override;
1154 void FocusOwningWebContents(
1155 RenderWidgetHostImpl* render_widget_host) override;
Lukasz Anforowicz52b93722018-06-20 16:11:391156 void RendererUnresponsive(
1157 RenderWidgetHostImpl* render_widget_host,
1158 base::RepeatingClosure hang_monitor_restarter) override;
avic3aa8422015-11-09 20:57:221159 void RendererResponsive(RenderWidgetHostImpl* render_widget_host) override;
Takumi Fujimoto4661871d2024-01-25 02:04:181160 void RequestToLockPointer(RenderWidgetHostImpl* render_widget_host,
1161 bool user_gesture,
1162 bool last_unlocked_by_target,
1163 bool privileged) override;
Anantanarayanan G Iyengar21c80ce2024-10-07 16:39:561164 bool IsWaitingForPointerLockPrompt(
1165 RenderWidgetHostImpl* render_widget_host) override;
Joe Downing13dd76b2018-04-09 18:32:151166 bool RequestKeyboardLock(RenderWidgetHostImpl* render_widget_host,
1167 bool esc_key_locked) override;
Joe Downing192998b22018-03-22 15:51:361168 void CancelKeyboardLock(RenderWidgetHostImpl* render_widget_host) override;
1169 RenderWidgetHostImpl* GetKeyboardLockWidget() override;
avi0720b02e2017-06-13 03:22:131170 // The following function is already listed under WebContents overrides:
Avi Drissman97aef042020-06-30 21:04:481171 // bool IsFullscreen() const override;
danakj45d42452020-04-08 17:24:181172 blink::mojom::DisplayMode GetDisplayMode() const override;
Md Hasibul Hasan2fe709feb2024-09-12 15:39:561173 ui::mojom::WindowShowState GetWindowShowState() override;
Alexis Menard634234d2024-05-10 14:27:331174 blink::mojom::DevicePostureProvider* GetDevicePostureProvider() override;
Sonja1e9d6bc12023-09-19 11:19:301175 bool GetResizable() override;
Takumi Fujimoto4661871d2024-01-25 02:04:181176 void LostPointerLock(RenderWidgetHostImpl* render_widget_host) override;
1177 bool HasPointerLock(RenderWidgetHostImpl* render_widget_host) override;
1178 RenderWidgetHostImpl* GetPointerLockWidget() override;
Dave Tapuskae1c62952021-11-02 23:14:061179 bool OnRenderFrameProxyVisibilityChanged(
1180 RenderFrameProxyHost* render_frame_proxy_host,
Dave Tapuskac3344362019-02-20 17:54:281181 blink::mojom::FrameVisibility visibility) override;
lfgbb9c28a2016-03-01 03:19:491182 void SendScreenRects() override;
Dave Tapuska3450d0b2022-04-08 21:27:531183 void SendActiveState(bool active) override;
ekaramadadd882292016-06-08 15:22:561184 TextInputManager* GetTextInputManager() override;
Dave Tapuska1d72e332021-10-13 19:24:381185 bool IsWidgetForPrimaryMainFrame(
1186 RenderWidgetHostImpl* render_widget_host) override;
ekaramadf6750aa2017-06-06 18:29:421187 bool IsShowingContextMenuOnPage() const override;
Klaus Weidnerd32baf42020-02-21 04:10:551188 void DidChangeScreenOrientation() override;
Mike Jacksonf116a2e2021-06-09 16:48:301189 gfx::Rect GetWindowsControlsOverlayRect() const override;
Joe Mason4dc51d42022-12-17 00:00:141190 VisibleTimeRequestTrigger& GetVisibleTimeRequestTrigger() final;
Aman Vermabb589a32024-05-07 16:38:171191 gfx::mojom::DelegatedInkPointRenderer* GetDelegatedInkRenderer(
1192 ui::Compositor* compositor) override;
Baran Erfanide163bd2024-08-26 22:26:271193 void OnInputIgnored(const blink::WebInputEvent& event) override;
Kartar Singh9991d6662024-12-11 16:46:241194 input::mojom::RenderInputRouterDelegate* GetRenderInputRouterDelegateRemote()
1195 override;
Kartar Singh48fb0a72025-03-21 15:52:221196#if BUILDFLAG(IS_ANDROID)
1197 float GetCurrentTouchSequenceYOffset() override;
1198#endif
[email protected]4ca76c02012-05-16 16:19:051199
[email protected]b0936d22013-11-28 06:47:361200 // RenderFrameHostManager::Delegate ------------------------------------------
[email protected]0bfbf882011-12-22 18:19:271201
dchengc2282aa2014-10-21 12:07:581202 bool CreateRenderViewForRenderManager(
[email protected]bffc8302014-01-23 20:52:161203 RenderViewHost* render_view_host,
Arthur Sonzognic686e8f2024-01-11 08:36:371204 const std::optional<blink::FrameToken>& opener_frame_token,
Aaron Colwell6fdff5e2021-01-27 22:42:011205 RenderFrameProxyHost* proxy_host) override;
Fergal Daly6de62f52020-10-14 01:56:441206 void ReattachOuterDelegateIfNeeded() override;
lfgbede6392015-09-11 21:54:061207 void CreateRenderWidgetHostViewForRenderManager(
1208 RenderViewHost* render_view_host) override;
dchengc2282aa2014-10-21 12:07:581209 void BeforeUnloadFiredFromRenderManager(
1210 bool proceed,
anand.ratn120b0b002014-10-07 15:49:321211 bool* proceed_to_fire_unload) override;
dchengc2282aa2014-10-21 12:07:581212 void CancelModalDialogsForRenderManager() override;
Kevin McNeefb86fcf2021-02-26 23:20:571213 void NotifySwappedFromRenderManager(RenderFrameHostImpl* old_frame,
Dave Tapuskae45d6fd2021-09-29 17:03:591214 RenderFrameHostImpl* new_frame) override;
Jonathan Ross61ec65342021-12-14 23:01:401215 void NotifySwappedFromRenderManagerWithoutFallbackContent(
1216 RenderFrameHostImpl* new_frame) override;
naskof5940b9f2015-03-02 23:04:051217 void NotifyMainFrameSwappedFromRenderManager(
Kevin McNeefb86fcf2021-02-26 23:20:571218 RenderFrameHostImpl* old_frame,
1219 RenderFrameHostImpl* new_frame) override;
dchengc2282aa2014-10-21 12:07:581220 bool FocusLocationBarByDefault() override;
Carlos Caballero6ff6ace2021-02-05 16:53:001221 void OnFrameTreeNodeDestroyed(FrameTreeNode* node) override;
[email protected]0bfbf882011-12-22 18:19:271222
Jeremy Roman2d8dfe132021-07-06 20:51:261223 // PageDelegate -------------------------------------------------------------
1224
1225 void OnFirstVisuallyNonEmptyPaint(PageImpl& page) override;
1226
1227 // These both check that the color has in fact changed before notifying
1228 // observers.
1229 void OnThemeColorChanged(PageImpl& page) override;
1230 void OnBackgroundColorChanged(PageImpl& page) override;
Michael Bai19f17a302021-12-08 04:08:331231 void DidInferColorScheme(PageImpl& page) override;
David Bokand6e44055b2022-09-21 03:58:081232 void OnVirtualKeyboardModeChanged(PageImpl& page) override;
Julie Jeongeun Kimd4597df12022-11-11 02:44:511233 void NotifyPageBecamePrimary(PageImpl& page) override;
Jeremy Roman2d8dfe132021-07-06 20:51:261234
Takashi Toyoshima8dfc05c2024-01-29 21:03:511235 bool IsPageInPreviewMode() const override;
Takashi Toyoshimaa35e5fc2023-10-20 04:00:341236 void CancelPreviewByMojoBinderPolicy(
1237 const std::string& interface_name) override;
Robert Ferens9610d7282025-02-17 09:52:321238 void OnWebApiWindowResizableChanged() override;
Takashi Toyoshima1b73e312023-10-17 04:53:351239
Joel Hockey163835a2017-12-20 11:51:571240 // blink::mojom::ColorChooserFactory ---------------------------------------
Miyoung Shincb6475a2019-11-09 10:49:451241 void OnColorChooserFactoryReceiver(
Julie Jeongeun Kim8e2879e2019-08-06 23:55:201242 mojo::PendingReceiver<blink::mojom::ColorChooserFactory> receiver);
Tom Burginf0e48622024-05-16 15:06:121243#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
Joel Hockey85b379d2017-12-11 10:42:131244 void OpenColorChooser(
Julie Jeongeun Kim8e2879e2019-08-06 23:55:201245 mojo::PendingReceiver<blink::mojom::ColorChooser> chooser,
1246 mojo::PendingRemote<blink::mojom::ColorChooserClient> client,
Joel Hockey85b379d2017-12-11 10:42:131247 SkColor color,
Joel Hockey163835a2017-12-20 11:51:571248 std::vector<blink::mojom::ColorSuggestionPtr> suggestions) override;
Julie Jeongeun Kim88ce9ec2023-07-28 02:25:401249#endif
Joel Hockey85b379d2017-12-11 10:42:131250
Carlos Caballero03262522021-02-05 14:49:581251 // FrameTree::Delegate -------------------------------------------------------
1252
Nate Chapin470dbc62023-04-25 16:34:381253 void LoadingStateChanged(LoadingState new_state) override;
1254 void DidStartLoading(FrameTreeNode* frame_tree_node) override;
Carlos Caballero03262522021-02-05 14:49:581255 void DidStopLoading() override;
Tsuyoshi Horocd828462021-04-21 04:59:581256 bool IsHidden() override;
Avi Drissmanbd153642024-09-03 18:58:051257 FrameTreeNodeId GetOuterDelegateFrameTreeNodeId() override;
Kevin McNee86e64ee2023-02-17 16:35:501258 RenderFrameHostImpl* GetProspectiveOuterDocument() override;
Sreeja Kamishettyd64b993d2022-02-14 12:04:421259 FrameTree* LoadingTree() override;
Julie Jeongeun Kim2132b37f82022-11-23 08:30:461260 void SetFocusedFrame(FrameTreeNode* node, SiteInstanceGroup* source) override;
Tommy Steimel71f154462024-05-22 19:05:071261 FrameTree* GetOwnedPictureInPictureFrameTree() override;
1262 FrameTree* GetPictureInPictureOpenerFrameTree() override;
Carlos Caballero03262522021-02-05 14:49:581263
[email protected]ec6c05f2013-10-23 18:41:571264 // NavigationControllerDelegate ----------------------------------------------
1265
dchengc2282aa2014-10-21 12:07:581266 void NotifyNavigationEntryCommitted(
anand.ratn120b0b002014-10-07 15:49:321267 const LoadCommittedDetails& load_details) override;
Sam McNally5c087a32017-08-25 01:46:141268 void NotifyNavigationEntryChanged(
1269 const EntryChangedDetails& change_details) override;
1270 void NotifyNavigationListPruned(const PrunedDetails& pruned_details) override;
Christian Dullweber1af31e62018-02-22 11:49:481271 void NotifyNavigationEntriesDeleted() override;
arthursonzogni66f711c2019-10-08 14:40:361272 bool ShouldPreserveAbortedURLs() override;
Abhijeet Kandalkar3dc6e602022-11-09 05:08:371273 void NotifyNavigationStateChangedFromController(
1274 InvalidateTypes changed_flags) override;
[email protected]ec6c05f2013-10-23 18:41:571275
Aman Verma3047aa412024-05-28 09:09:241276 // RenderWidgetHostInputEventRouter::Delegate -------------------------------
Kartar Singhb1bfa1a2024-06-24 13:14:571277 input::TouchEmulator* GetTouchEmulator(bool create_if_necessary) override;
Aman Verma3047aa412024-05-28 09:09:241278
Aman Vermaea1fcd02024-11-07 20:04:281279 // input::mojom::RenderInputRouterDelegateClient -----------------------------
1280 void NotifyObserversOfInputEvent(
1281 const viz::FrameSinkId& frame_sink_id,
Kartar Singh15b5c84d2025-01-30 17:47:201282 std::unique_ptr<blink::WebCoalescedInputEvent> event,
1283 bool dispatched_to_renderer) override;
Aman Vermaea1fcd02024-11-07 20:04:281284 void NotifyObserversOfInputEventAcks(
1285 const viz::FrameSinkId& frame_sink_id,
1286 blink::mojom::InputEventResultSource ack_source,
1287 blink::mojom::InputEventResultState ack_result,
1288 std::unique_ptr<blink::WebCoalescedInputEvent> event) override;
1289 void OnInvalidInputEventSource(
1290 const viz::FrameSinkId& frame_sink_id) override;
Aman Vermaaf215652025-04-04 15:03:241291 void StateOnOverscrollTransfer(
1292 const viz::FrameSinkId& frame_sink_id,
1293 blink::mojom::DidOverscrollParamsPtr params) override;
Aman Vermaea1fcd02024-11-07 20:04:281294
[email protected]ec6c05f2013-10-23 18:41:571295 // Invoked before a form repost warning is shown.
dchengc2282aa2014-10-21 12:07:581296 void NotifyBeforeFormRepostWarningShow() override;
[email protected]ec6c05f2013-10-23 18:41:571297
1298 // Activate this WebContents and show a form repost warning.
dchengc2282aa2014-10-21 12:07:581299 void ActivateAndShowRepostFormWarningDialog() override;
[email protected]ec6c05f2013-10-23 18:41:571300
Mounir Lamouri0f5bdf52019-04-04 16:32:351301 void MediaMutedStatusChanged(const MediaPlayerId& id, bool muted);
Becca Hughes9f6fd4b82017-06-15 10:01:401302
aelias5252baa2016-04-10 01:18:021303 void UpdateOverridingUserAgent() override;
1304
[email protected]34ff1cfc2014-08-20 06:16:051305 // Forces overscroll to be disabled (used by touch emulation).
1306 void SetForceDisableOverscrollContent(bool force_disable);
1307
Jianzhou Fengd8720c72018-01-18 03:06:301308 // Override the render view/widget size of the main frame, return whether the
1309 // size changed.
1310 bool SetDeviceEmulationSize(const gfx::Size& new_size);
1311 void ClearDeviceEmulationSize();
1312
rajendrant4c288462020-10-13 07:35:351313 AudioStreamMonitor* audio_stream_monitor() { return &audio_stream_monitor_; }
dalecurtisbc6572e12014-09-12 19:22:301314
Max Morin5bc74f52018-05-09 07:00:211315 ForwardingAudioStreamFactory* GetAudioStreamFactory();
1316
Dave Tapuska894bfb42024-11-04 22:44:351317 // Creates a new ForwardingAudioStreamFactory. This can only be used by
1318 // GuestPageHolders, if you are looking for the audio stream factory you
1319 // likely want to use GetAudioStreamFactory();
1320 std::unique_ptr<ForwardingAudioStreamFactory> CreateAudioStreamFactory(
1321 base::PassKey<GuestPageHolderImpl> pass_key);
1322
dalecurtis88c240072015-12-09 02:11:181323 // Called by MediaWebContentsObserver when playback starts or stops. See the
1324 // WebContentsObserver function stubs for more details.
billorr21c005d2016-11-17 03:57:041325 void MediaStartedPlaying(
1326 const WebContentsObserver::MediaPlayerInfo& media_info,
Mounir Lamouri0f5bdf52019-04-04 16:32:351327 const MediaPlayerId& id);
billorr21c005d2016-11-17 03:57:041328 void MediaStoppedPlaying(
1329 const WebContentsObserver::MediaPlayerInfo& media_info,
Mounir Lamouri0f5bdf52019-04-04 16:32:351330 const MediaPlayerId& id,
Becca Hughes220bfc102017-11-14 18:24:071331 WebContentsObserver::MediaStoppedReason reason);
peconn257951522017-06-09 18:24:591332 // This will be called before playback is started, check
1333 // GetCurrentlyPlayingVideoCount if you need this when playback starts.
Mounir Lamouri0f5bdf52019-04-04 16:32:351334 void MediaResized(const gfx::Size& size, const MediaPlayerId& id);
Peter E Conneccb34c22017-09-08 09:37:581335 void MediaEffectivelyFullscreenChanged(bool is_fullscreen);
billorr21c005d2016-11-17 03:57:041336
Michael Crousee75c7a42020-07-31 21:11:551337 // Called by MediaWebContentsObserver when a buffer underflow occurs. See the
1338 // WebContentsObserver function stubs for more details.
1339 void MediaBufferUnderflow(const MediaPlayerId& id);
1340
rajendrant4c288462020-10-13 07:35:351341 // Called by MediaWebContentsObserver when player seek event occurs.
1342 void MediaPlayerSeek(const MediaPlayerId& id);
1343
Chris Hamiltonc347e102020-11-18 23:10:211344 // Called by MediaWebContentsObserver when a media player is destroyed.
1345 void MediaDestroyed(const MediaPlayerId& id);
1346
Tommy Steimele95348e2024-01-09 21:15:331347 // Called by MediaSessionImpl when one is created and initialized for this.
1348 void MediaSessionCreated(MediaSession* media_session);
1349
peconn257951522017-06-09 18:24:591350 int GetCurrentlyPlayingVideoCount() override;
Arthur Sonzognic686e8f2024-01-11 08:36:371351 std::optional<gfx::Size> GetFullscreenVideoSize() override;
dalecurtisbc6572e12014-09-12 19:22:301352
qinmin58567c82015-01-07 21:00:201353 MediaWebContentsObserver* media_web_contents_observer() {
1354 return media_web_contents_observer_.get();
1355 }
qinmin58567c82015-01-07 21:00:201356
tapted65ff2ea72016-03-01 23:39:001357 // Update the web contents visibility.
Sreeja Kamishetty1c1ca7a2023-05-12 16:36:401358 void UpdateWebContentsVisibility(Visibility visibility) override;
tapted65ff2ea72016-03-01 23:39:001359
Tsuyoshi Horocd828462021-04-21 04:59:581360 // Returns the PageVisibilityState for the primary page of this web contents,
1361 // taking the capturing state into account.
1362 PageVisibilityState GetPageVisibilityState() const;
1363
paulmeyerc0b762b2016-04-13 11:55:171364 // Called by FindRequestManager when find replies come in from a renderer
1365 // process.
1366 void NotifyFindReply(int request_id,
1367 int number_of_matches,
1368 const gfx::Rect& selection_rect,
1369 int active_match_ordinal,
1370 bool final_update);
1371
ortuno467e5792016-06-10 04:32:391372 // Modify the counter of connected devices for this WebContents.
1373 void IncrementBluetoothConnectedDeviceCount();
1374 void DecrementBluetoothConnectedDeviceCount();
1375
Ovidio Henriquez76696f62020-07-08 03:06:591376 void IncrementBluetoothScanningSessionsCount();
1377 void DecrementBluetoothScanningSessionsCount();
1378
Reilly Grant5e7c79b22019-04-09 17:26:201379 // Modify the counter of frames in this WebContents actively using serial
1380 // ports.
1381 void IncrementSerialActiveFrameCount();
1382 void DecrementSerialActiveFrameCount();
1383
Matt Reynoldse8c6c1f2019-11-02 09:53:531384 // Modify the counter of frames in this WebContents actively using HID
1385 // devices.
1386 void IncrementHidActiveFrameCount();
1387 void DecrementHidActiveFrameCount();
1388
Yifan Luo8e5d3d52024-10-22 19:18:161389 // Modify the counter of frames in this WebContents actively using
1390 // geolocation.
1391 void IncrementGeolocationActiveFrameCount();
1392 void DecrementGeolocationActiveFrameCount();
1393
François Doraye753bf902024-09-17 15:03:081394 // Notifies the delegate and observers when device connection types used by
1395 // the WebContents change.
Patrick Monette15442a12025-01-22 20:09:311396 void OnCapabilityTypesChanged(
1397 WebContentsCapabilityType device_capability_type,
1398 bool used);
Matt Reynoldsed00ca7e72022-08-18 20:56:201399
1400 // Modify the counter of frames in this WebContents actively using USB
1401 // devices.
1402 void IncrementUsbActiveFrameCount();
1403 void DecrementUsbActiveFrameCount();
1404
Austin Sullivanafefb722021-01-14 01:26:391405 // Modify the counter of File System Access handles for this WebContents.
1406 void IncrementFileSystemAccessHandleCount();
1407 void DecrementFileSystemAccessHandleCount();
Marijn Kruisselbrink29051042019-08-06 22:56:551408
mlamouri5cd9ae82017-02-18 11:05:091409 // Called when the WebContents gains or loses a persistent video.
zqzhang8ac49002017-03-16 21:51:351410 void SetHasPersistentVideo(bool has_persistent_video);
mlamouri5cd9ae82017-02-18 11:05:091411
François Beaufortad6c5232018-02-26 11:00:441412 // Whether the WebContents effectively fullscreen active player allows
1413 // Picture-in-Picture.
1414 // |IsFullscreen| must return |true| when this method is called.
1415 bool IsPictureInPictureAllowedForFullscreenVideo() const;
1416
Carlos Caballerob65b6e3a2021-11-15 10:09:001417 // Set this WebContents's `primary_frame_tree_` as the focused frame tree.
1418 // `primary_frame_tree_`'s main frame RenderWidget (and all of its
Dave Tapuska54c76a032021-10-27 22:10:421419 // subframe widgets) will be activated. GetFocusedRenderWidgetHost will search
1420 // this WebContentsImpl for a focused RenderWidgetHost. The previously focused
1421 // WebContentsImpl, if any, will have its RenderWidgetHosts deactivated.
lfg1453e412017-04-11 00:48:501422 void SetAsFocusedWebContentsIfNecessary();
1423
Dave Tapuska54c76a032021-10-27 22:10:421424 // Sets the focused frame tree to be the `frame_tree_to_focus`.
1425 // `frame_tree_to_focus` must be either this WebContents's frame tree or
1426 // contained within it (but not owned by another WebContents).
1427 void SetFocusedFrameTree(FrameTree* frame_tree_to_focus);
1428
Klaus Weidnerd8219432022-02-08 21:50:591429 // Notifies the Picture-in-Picture controller that there is a new video player
1430 // entering video Picture-in-Picture. (This is not used for document
1431 // Picture-in-Picture,
1432 // cf. PictureInPictureWindowManager::EnterDocumentPictureInPicture().)
Becca Hughes112832e2019-06-11 17:19:021433 // Returns the result of the enter request.
François Beaufort1388f2892022-01-29 08:22:471434 PictureInPictureResult EnterPictureInPicture();
Mounir Lamouri11e9ef432018-05-22 03:10:161435
Mounir Lamouri6d759e12018-05-16 20:01:301436 // Updates the Picture-in-Picture controller with a signal that
1437 // Picture-in-Picture mode has ended.
1438 void ExitPictureInPicture();
1439
sawtellea7333a82018-05-31 02:36:361440 // Updates the tracking information for |this| to know if there is
1441 // a video currently in Picture-in-Picture mode.
1442 void SetHasPictureInPictureVideo(bool has_picture_in_picture_video);
1443
Klaus Weidnerd8219432022-02-08 21:50:591444 // Updates the tracking information for |this| to know if there is
1445 // a document currently in Picture-in-Picture mode.
1446 void SetHasPictureInPictureDocument(bool has_picture_in_picture_document);
1447
Ian Vollick5d5c37f2019-06-19 22:50:571448 // Sets the spatial navigation state.
1449 void SetSpatialNavigationDisabled(bool disabled);
1450
Yaroslav Shalivskyyd76a81f42024-10-21 20:08:201451#if BUILDFLAG(IS_ANDROID)
Mahesh Machavolu6cb80182022-07-22 08:09:311452 // Sets the Stylus handwriting feature status. This status is updated to web
1453 // preferences.
1454 void SetStylusHandwritingEnabled(bool enabled);
Yaroslav Shalivskyyd76a81f42024-10-21 20:08:201455#endif // BUILDFLAG(IS_ANDROID)
Mahesh Machavolu6cb80182022-07-22 08:09:311456
Avi Drissmanbd3e986442020-05-20 21:09:201457 // Called when a file selection is to be done.
1458 void RunFileChooser(
Bo Liu3afe2582023-08-11 23:02:561459 base::WeakPtr<FileChooserImpl> file_chooser,
Avi Drissmanbd3e986442020-05-20 21:09:201460 RenderFrameHost* render_frame_host,
Kent Tamura3abb32d2020-07-02 00:23:011461 scoped_refptr<FileChooserImpl::FileSelectListenerImpl> listener,
Avi Drissmanbd3e986442020-05-20 21:09:201462 const blink::mojom::FileChooserParams& params);
1463
1464 // Request to enumerate a directory. This is equivalent to running the file
1465 // chooser in directory-enumeration mode and having the user select the given
1466 // directory.
1467 void EnumerateDirectory(
Bo Liu3afe2582023-08-11 23:02:561468 base::WeakPtr<FileChooserImpl> file_chooser,
Avi Drissmanbd3e986442020-05-20 21:09:201469 RenderFrameHost* render_frame_host,
Kent Tamura3abb32d2020-07-02 00:23:011470 scoped_refptr<FileChooserImpl::FileSelectListenerImpl> listener,
Avi Drissmanbd3e986442020-05-20 21:09:201471 const base::FilePath& directory_path);
1472
Xiaohan Wang24ec9342022-01-15 17:34:221473#if BUILDFLAG(IS_ANDROID)
paulmeyerc0b762b2016-04-13 11:55:171474 // Called by FindRequestManager when all of the find match rects are in.
1475 void NotifyFindMatchRectsReply(int version,
1476 const std::vector<gfx::RectF>& rects,
1477 const gfx::RectF& active_rect);
1478#endif
1479
Xiaohan Wang24ec9342022-01-15 17:34:221480#if BUILDFLAG(IS_ANDROID)
Becca Hughes6daf5662018-06-27 16:50:541481 // Called by WebContentsAndroid to send the Display Cutout safe area to
1482 // DisplayCutoutHostImpl.
1483 void SetDisplayCutoutSafeArea(gfx::Insets insets);
Mason Freede478e4932025-03-31 23:52:151484 // Called by WebContentsAndroid to send the context menu insets over to
1485 // the RenderWidgetHostView, and on to the Page.
1486 void SetContextMenuInsets(gfx::Rect);
Becca Hughes6daf5662018-06-27 16:50:541487#endif
1488
Becca Hughesd11d6502018-07-31 17:01:281489 // Notify observers that the viewport fit value changed. This is called by
Wenyu Fu29b3bb72024-12-27 17:48:041490 // |SafeAreaInsetsHost|.
Becca Hughesd11d6502018-07-31 17:01:281491 void NotifyViewportFitChanged(blink::mojom::ViewportFit value);
Wenyu Fu29b3bb72024-12-27 17:48:041492 // Notify observers that safe area constraint has changed. This is called by
1493 // |SafeAreaInsetsHost|.
1494 void NotifySafeAreaConstraintChanged(bool has_constraint);
Becca Hughesd11d6502018-07-31 17:01:281495
Ehsan Karamad6beb2ea2018-11-25 18:15:131496 // Returns the current FindRequestManager associated with the WebContents;
1497 // this won't create one if none exists.
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:411498 FindRequestManager* GetFindRequestManagerForTesting();
Ehsan Karamad6beb2ea2018-11-25 18:15:131499
Kevin McNee8576c402020-09-10 21:58:571500 // Convenience method to notify observers that an inner WebContents was
1501 // created with |this| WebContents as its owner. This does *not* immediately
1502 // guarantee that |inner_web_contents| has been added to the WebContents tree.
1503 void InnerWebContentsCreated(WebContents* inner_web_contents);
1504
Lucas Furukawa Gadani99125822019-01-03 15:41:491505 // Reattaches this inner WebContents to its outer WebContents.
Adithya Srinivasan5bc3b712020-05-21 13:07:571506 virtual void ReattachToOuterWebContentsFrame();
Lucas Furukawa Gadani99125822019-01-03 15:41:491507
Takashi Toyoshima138cf44a2023-11-02 10:33:251508 // Notifies observers that this WebContents completed preview activation
1509 // steps.
1510 // `activation_time` is the time the activation happened, in wall time.
1511 void DidActivatePreviewedPage(base::TimeTicks activation_time);
1512
Alexander Timin17edc742020-04-23 18:22:181513 void OnServiceWorkerAccessed(RenderFrameHost* render_frame_host,
1514 const GURL& scope,
1515 AllowServiceWorkerResult allowed);
1516
David Bokan1bdb3701f2021-04-30 22:02:351517 bool JavaScriptDialogDefersNavigations() {
1518 return javascript_dialog_dismiss_notifier_.get();
Charlie Reis96077362019-07-04 00:34:041519 }
1520
David Bokan1bdb3701f2021-04-30 22:02:351521 void NotifyOnJavaScriptDialogDismiss(base::OnceClosure callback);
1522
John Abd-El-Malek74f0b95c2021-04-05 06:24:021523 bool has_persistent_video() { return has_persistent_video_; }
1524
Dave Tapuskae782bea2019-07-09 16:21:511525 // Returns the focused frame's input handler.
Dave Tapuska58a099e2020-06-08 21:48:401526 blink::mojom::FrameWidgetInputHandler* GetFocusedFrameWidgetInputHandler();
Dave Tapuskae782bea2019-07-09 16:21:511527
Alexander Timinc7bee322020-05-19 17:54:341528 // A render view-originated drag has ended. Informs the render view host and
1529 // WebContentsDelegate.
1530 void SystemDragEnded(RenderWidgetHost* source_rwh);
1531
Kevin McNeec9d0fda2021-05-19 15:55:171532 // These are the content internal equivalents of
Peter Kastingd2876a22024-12-03 01:12:551533 // `WebContents::ForEachRenderFrameHost` whose comment can be referred to
Kevin McNeec9d0fda2021-05-19 15:55:171534 // for details. Content internals can also access speculative
1535 // RenderFrameHostImpls if necessary by using the
Peter Kastingd2876a22024-12-03 01:12:551536 // `ForEachRenderFrameHostImplIncludingSpeculative` variations.
1537 void ForEachRenderFrameHostImplWithAction(
Daniel Cheng982f2b22022-08-25 23:46:161538 base::FunctionRef<FrameIterationAction(RenderFrameHostImpl*)> on_frame);
Peter Kastingd2876a22024-12-03 01:12:551539 void ForEachRenderFrameHostImpl(
Daniel Cheng982f2b22022-08-25 23:46:161540 base::FunctionRef<void(RenderFrameHostImpl*)> on_frame);
Peter Kastingd2876a22024-12-03 01:12:551541 void ForEachRenderFrameHostImplIncludingSpeculativeWithAction(
Daniel Cheng982f2b22022-08-25 23:46:161542 base::FunctionRef<FrameIterationAction(RenderFrameHostImpl*)> on_frame);
Peter Kastingd2876a22024-12-03 01:12:551543 void ForEachRenderFrameHostImplIncludingSpeculative(
Daniel Cheng982f2b22022-08-25 23:46:161544 base::FunctionRef<void(RenderFrameHostImpl*)> on_frame);
Kevin McNeec9d0fda2021-05-19 15:55:171545
Rakina Zata Amni4029b6d2020-07-28 02:36:201546 // Computes and returns the content specific preferences for this WebContents.
1547 // Recomputes only the "fast" preferences (those not requiring slow
1548 // platform/device polling); the remaining "slow" ones are recomputed only if
1549 // the preference cache is empty.
Dave Tapuska183b8d702025-01-07 18:47:181550 const blink::web_pref::WebPreferences ComputeWebPreferences(
1551 RenderFrameHostImpl* main_frame);
Rakina Zata Amni4029b6d2020-07-28 02:36:201552
Alexander Cooper987d046cc2021-04-14 00:07:211553 // Certain WebXr modes integrate with Viz as a compositor directly, and thus
1554 // have their own FrameSinkId that typically renders fullscreen, obscuring
1555 // the WebContents. This allows those WebXr modes to notify us if that
1556 // is occurring. When it has finished, this method may be called again with an
1557 // Invalid FrameSinkId to indicate such. Note that other fullscreen modes,
1558 // e.g. Fullscreen videos, are largely controlled by the renderer process and
1559 // as such are still parented under the existing FrameSinkId.
1560 void OnXrHasRenderTarget(const viz::FrameSinkId& frame_sink_id);
1561
1562 // Because something else may be rendering as the primary contents of this
1563 // WebContents rather than the RenderHostView, targets that wish to capture
Jordan Baylescf8387852023-09-13 21:16:351564 // the contents of this WebContents should query its capture target here.
1565 struct CaptureTarget {
1566 viz::FrameSinkId sink_id;
1567 gfx::NativeView view;
1568 };
1569 CaptureTarget GetCaptureTarget();
Alexander Cooper987d046cc2021-04-14 00:07:211570
Sreeja Kamishetty0be3b1b2021-08-12 17:04:151571 // Sets the value in tests to ensure expected ordering and correctness.
1572 void set_minimum_delay_between_loading_updates_for_testing(
1573 base::TimeDelta duration) {
1574 minimum_delay_between_loading_updates_ms_ = duration;
1575 }
1576
Kevin McNeeab98c4a52022-01-28 16:53:061577 // If the given frame is prerendered, cancels the associated prerender.
1578 // Returns true if a prerender was canceled.
1579 bool CancelPrerendering(FrameTreeNode* frame_tree_node,
Yoshiki Tanioka49b4cfb2022-10-20 09:25:311580 PrerenderFinalStatus final_status);
Kevin McNeeab98c4a52022-01-28 16:53:061581
David Bokane86aa032022-05-08 18:21:241582 void set_suppress_ime_events_for_testing(bool suppress) {
1583 suppress_ime_events_for_testing_ = suppress;
1584 }
1585
Alex Moshchuk83805532022-08-12 15:15:231586 RenderWidgetHost* mouse_lock_widget_for_testing() {
Takumi Fujimoto4661871d2024-01-25 02:04:181587 return pointer_lock_widget_;
Alex Moshchuk83805532022-08-12 15:15:231588 }
1589
David Bokand6e44055b2022-09-21 03:58:081590 ui::mojom::VirtualKeyboardMode GetVirtualKeyboardMode() const;
1591
Arthur Sonzognic686e8f2024-01-11 08:36:371592 const std::optional<base::Location>& ownership_location() const {
Bo Liud4ced692023-09-18 21:17:141593 return ownership_location_;
1594 }
1595
Ari Chivukula41f7bfc92024-07-17 18:16:011596 bool IsPopup() const override;
1597
Ari Chivukula17ba533d2024-09-11 22:47:421598 bool IsPartitionedPopin() const override;
1599
Ari Chivukula2d8d5e02024-11-04 20:09:571600 const struct PartitionedPopinOpenerProperties&
1601 GetPartitionedPopinOpenerProperties() const override;
Ari Chivukula9390bf12024-08-14 18:08:011602
Ari Chivukula2d8d5e02024-11-04 20:09:571603 // Returns the opener of this window if this window is a partitioned popin
1604 // and the opener still exists. This may return null for if the opener was
1605 // already deleted even if this window is a popin.
1606 // See https://explainers-by-googlers.github.io/partitioned-popins/
1607 RenderFrameHostImpl* GetPartitionedPopinOpener(
1608 base::PassKey<PartitionedPopinsController>) const;
1609
1610 // Clears `partitioned_popin_opener_` to test what happens if the opener
1611 // disappears after the popin is opened.
1612 void ClearPartitionedPopinOpenerForTesting();
1613
1614 WebContents* GetOpenedPartitionedPopin() const override;
Ari Chivukulaee503052024-08-30 20:33:531615
Ari Chivukulaf6f09ba2025-03-04 20:01:341616 // Returns the origin of the popin's opener if this is a partitioned popin.
1617 // CHECKS if this is not a partitioned popin, as it should never be called
1618 // in that case. This is used in permissions checks.
1619 // See https://explainers-by-googlers.github.io/partitioned-popins/
1620 GURL GetPartitionedPopinEmbedderOrigin(
1621 base::PassKey<StorageAccessGrantPermissionContext>) const override;
1622
1623 // Same as GetPartitionedPopinEmbedderOrigin but for testing to bypass
1624 // PassKey requirements.
1625 GURL GetPartitionedPopinEmbedderOriginForTesting() const;
1626
lof84501da082016-05-23 21:22:541627 private:
Dave Tapuska894bfb42024-11-04 22:44:351628 using FrameTreeIterationCallback = base::FunctionRef<void(FrameTree&)>;
Dave Tapuska05fcfb62021-10-18 17:09:031629 using RenderViewHostIterationCallback =
1630 base::RepeatingCallback<void(RenderViewHostImpl*)>;
Takashi Toyoshimadc3f7472021-07-21 08:02:321631
[email protected]8ff00d72012-10-23 19:12:211632 friend class WebContentsObserver;
1633 friend class WebContents; // To implement factory methods.
[email protected]0dd3a0ab2011-02-18 08:17:441634
Alex Moshchuk6fcaca752018-07-14 02:13:591635 friend class RenderFrameHostImplBeforeUnloadBrowserTest;
Becca Hughesfd5d8f892018-06-14 18:23:361636 friend class WebContentsImplBrowserTest;
Sarah Murphy3bccae62022-02-15 20:22:451637 friend class TestWebContentsDestructionObserver;
Arthur Hemery2b6bc5a42019-06-20 09:25:121638 friend class BeforeUnloadBlockingDelegate;
Avi Drissman360847d2018-11-02 22:46:511639 friend class TestWCDelegateForDialogsAndFullscreen;
Becca Hughesfd5d8f892018-06-14 18:23:361640
Dale Curtisc496a7762021-02-24 01:15:441641 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, CaptureHoldsWakeLock);
[email protected]2db9bd72012-04-13 20:20:561642 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, NoJSMessageOnInterstitials);
1643 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, UpdateTitle);
[email protected]45a22ad2013-02-21 03:25:001644 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FindOpenerRVHWhenPending);
[email protected]2db9bd72012-04-13 20:20:561645 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
1646 CrossSiteCantPreemptAfterUnload);
nick5ae4d2d2017-01-06 01:18:351647 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContentsDestroyed);
1648 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, PendingContentsShown);
[email protected]50904452013-05-09 02:05:121649 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FrameTreeShape);
Elad Alon0feb6602021-10-14 09:26:361650 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
1651 NonActivityCaptureDoesNotCountAsActivity);
Olivier ROBIN4b58dd932024-08-06 13:30:321652 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, GetLastActiveTimeTicks);
estarka5635c42015-07-14 00:06:531653 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
1654 LoadResourceFromMemoryCacheWithBadSecurityInfo);
jwwf4684d12015-09-02 06:12:521655 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
jam91dd24e2016-08-12 17:16:421656 LoadResourceWithEmptySecurityInfo);
avid53461d2016-02-25 17:15:041657 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest,
1658 ResetJavaScriptDialogOnUserNavigate);
Megan Jablonski2f6a4c52017-07-10 23:01:251659 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, ParseDownloadHeaders);
Mounir Lamouri7b4a1f232019-12-23 16:32:101660 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FaviconURLsSet);
1661 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FaviconURLsResetWithNavigation);
1662 FRIEND_TEST_ALL_PREFIXES(WebContentsImplTest, FaviconURLsUpdateDelay);
Becca Hughesfd5d8f892018-06-14 18:23:361663 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1664 NotifyFullscreenAcquired);
1665 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1666 NotifyFullscreenAcquired_Navigate);
1667 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1668 NotifyFullscreenAcquired_SameOrigin);
Arthur Sonzogni22e314b02018-08-23 13:55:561669 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
Batalov Vladislave9a5f3822020-12-02 07:31:111670 PropagateFullscreenOptions);
1671 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
Nasko Oskov0f3cbb12020-01-07 17:52:141672 FullscreenAfterFrameUnload);
yilkal796e89e2019-10-02 23:58:281673 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1674 MaxFrameCountForCrossProcessNavigation);
1675 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1676 MaxFrameCountRemovedIframes);
1677 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1678 MaxFrameCountInjectedIframes);
Kevin McNee53f0b2d2021-11-02 18:00:451679 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1680 ForEachFrameTreeInnerContents);
Andrew Comminosd2256652024-06-21 00:58:371681 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1682 UserAgentOverrideDuringDeferredNavigation);
Xiaochen Zhou6443f752022-08-10 16:40:461683 FRIEND_TEST_ALL_PREFIXES(FencedFrameMPArchBrowserTest, FrameIteration);
1684 FRIEND_TEST_ALL_PREFIXES(FencedFrameParameterizedBrowserTest,
1685 ShouldIgnoreJsDialog);
[email protected]0dd3a0ab2011-02-18 08:17:441686 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles);
1687 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate);
[email protected]b0936d22013-11-28 06:47:361688 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, PageDoesBackAndReload);
[email protected]de3c5d82014-05-28 22:12:591689 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrossSiteIframe);
alexmosc2a8cec2016-05-23 22:19:531690 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
1691 TwoSubframesCreatePopupsSimultaneously);
Antonio Gomesda7e03d2020-08-05 15:03:081692 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, TextAutosizerPageInfo);
alexmosc2a8cec2016-05-23 22:19:531693 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
1694 TwoSubframesCreatePopupMenuWidgetsSimultaneously);
dmazzoni0b5d2482014-09-10 19:45:571695 FRIEND_TEST_ALL_PREFIXES(SitePerProcessAccessibilityBrowserTest,
1696 CrossSiteIframeAccessibility);
avi2d7d2c32017-03-15 21:55:021697 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
1698 IframeBeforeUnloadParentHang);
avi336125f72017-05-06 22:25:401699 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
1700 BeforeUnloadDialogRequiresGesture);
Charles Reis15d60b132017-11-03 17:43:471701 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
1702 CancelBeforeUnloadResetsURL);
Chris Hamilton81997702018-09-12 14:18:061703 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
1704 BeforeUnloadDialogSuppressedForDiscard);
1705 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
Dave Tapuska19578e92021-08-09 17:14:021706 BeforeUnloadConfirmOnNonActive);
1707 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
Chris Hamilton81997702018-09-12 14:18:061708 PendingDialogMakesDiscardUnloadReturnFalse);
Pavel Feldman3c1842b2017-08-02 05:00:161709 FRIEND_TEST_ALL_PREFIXES(DevToolsProtocolTest, JavaScriptDialogNotifications);
1710 FRIEND_TEST_ALL_PREFIXES(DevToolsProtocolTest, JavaScriptDialogInterop);
1711 FRIEND_TEST_ALL_PREFIXES(DevToolsProtocolTest, BeforeUnloadDialog);
Pavel Feldmanfab3cb62017-10-05 01:02:011712 FRIEND_TEST_ALL_PREFIXES(DevToolsProtocolTest, PageDisableWithOpenedDialog);
1713 FRIEND_TEST_ALL_PREFIXES(DevToolsProtocolTest,
1714 PageDisableWithNoDialogManager);
Adithya Srinivasan1964f7e2021-09-21 20:40:021715 FRIEND_TEST_ALL_PREFIXES(
1716 PrerenderWithRenderDocumentBrowserTest,
1717 ModalDialogShouldNotBeDismissedAfterPrerenderSubframeNavigation);
Peter Kastingd2876a22024-12-03 01:12:551718 FRIEND_TEST_ALL_PREFIXES(PrerenderBrowserTest, ForEachRenderFrameHostImpl);
Yuzu Saijoa11069a2020-04-22 10:56:551719 FRIEND_TEST_ALL_PREFIXES(PluginContentOriginAllowlistTest,
Yuzu Saijo97addc32020-04-22 07:51:121720 ClearAllowlistOnNavigate);
Yuzu Saijoa11069a2020-04-22 10:56:551721 FRIEND_TEST_ALL_PREFIXES(PluginContentOriginAllowlistTest,
Yuzu Saijo97addc32020-04-22 07:51:121722 SubframeInheritsAllowlist);
Nick Carterd73635b2018-03-13 18:31:411723 FRIEND_TEST_ALL_PREFIXES(PointerLockBrowserTest,
1724 PointerLockInnerContentsCrashes);
Lucas Gadania0ea0172018-09-20 18:31:371725 FRIEND_TEST_ALL_PREFIXES(PointerLockBrowserTest, PointerLockOopifCrashes);
Wang Hui9f7884a2023-02-20 02:17:591726 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1727 PopupWindowBrowserNavResumeLoad);
1728 FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
1729 SuppressedPopupWindowBrowserNavResumeLoad);
Thomas Nguyen583f07e2023-07-19 17:45:371730 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostSitePerProcessTest,
1731 BrowserClosesPopupIntersectsPermissionPrompt);
[email protected]0dd3a0ab2011-02-18 08:17:441732
paulmeyera41de3b2016-05-05 16:30:181733 // So |find_request_manager_| can be accessed for testing.
1734 friend class FindRequestManagerTest;
1735
[email protected]80e776ae2012-03-23 16:17:201736 // TODO(brettw) TestWebContents shouldn't exist!
[email protected]8ff00d72012-10-23 19:12:211737 friend class TestWebContents;
[email protected]0dd3a0ab2011-02-18 08:17:441738
Avi Drissman783c1232021-02-05 01:27:051739 class RenderWidgetHostDestructionObserver;
1740 class WebContentsDestructionObserver;
[email protected]7fff43e2013-05-21 20:21:101741
lazyboy6ec48b2a2015-06-29 15:18:141742 // Represents a WebContents node in a tree of WebContents structure.
1743 //
1744 // Two WebContents with separate FrameTrees can be connected by
1745 // outer/inner relationship using this class. Note that their FrameTrees
1746 // still remain disjoint.
1747 // The parent is referred to as "outer WebContents" and the descendents are
1748 // referred to as "inner WebContents".
1749 // For each inner WebContents, the outer WebContents will have a
1750 // corresponding FrameTreeNode.
lfga3e2bdc2017-03-07 20:44:011751 class WebContentsTreeNode final : public FrameTreeNode::Observer {
lazyboy6ec48b2a2015-06-29 15:18:141752 public:
lfg601233692017-03-06 22:45:441753 explicit WebContentsTreeNode(WebContentsImpl* current_web_contents);
lfga3e2bdc2017-03-07 20:44:011754 ~WebContentsTreeNode() final;
lazyboy6ec48b2a2015-06-29 15:18:141755
Lucas Furukawa Gadani6e5b4f32019-03-02 04:18:501756 // Attaches |inner_web_contents| to the |render_frame_host| within this
1757 // WebContents.
1758 void AttachInnerWebContents(std::unique_ptr<WebContents> inner_web_contents,
1759 RenderFrameHostImpl* render_frame_host);
lazyboy6ec48b2a2015-06-29 15:18:141760
lfg601233692017-03-06 22:45:441761 WebContentsImpl* outer_web_contents() const { return outer_web_contents_; }
Avi Drissman13d20e92024-09-05 16:56:301762 FrameTreeNodeId outer_contents_frame_tree_node_id() const {
lazyboy6ec48b2a2015-06-29 15:18:141763 return outer_contents_frame_tree_node_id_;
1764 }
lfga3e2bdc2017-03-07 20:44:011765 FrameTreeNode* OuterContentsFrameTreeNode() const;
lazyboy6ec48b2a2015-06-29 15:18:141766
Daniel Cheng3f2c5ff2024-05-30 19:58:181767 FrameTree* focused_frame_tree();
Dave Tapuskad8b0530f2021-10-19 15:12:311768 void SetFocusedFrameTree(FrameTree* frame_tree);
avallee0206f782016-07-28 18:55:331769
paulmeyerfeafc2d2017-04-25 21:46:401770 // Returns the inner WebContents within |frame|, if one exists, or nullptr
1771 // otherwise.
1772 WebContentsImpl* GetInnerWebContentsInFrame(const FrameTreeNode* frame);
1773
Lucas Furukawa Gadani3d38ec152018-10-26 20:55:181774 std::vector<WebContentsImpl*> GetInnerWebContents() const;
paulmeyerfeafc2d2017-04-25 21:46:401775
lazyboy6ec48b2a2015-06-29 15:18:141776 private:
Lucas Furukawa Gadani3d38ec152018-10-26 20:55:181777 std::unique_ptr<WebContents> DetachInnerWebContents(
1778 WebContentsImpl* inner_web_contents);
paulmeyerfeafc2d2017-04-25 21:46:401779
lfga3e2bdc2017-03-07 20:44:011780 // FrameTreeNode::Observer implementation.
1781 void OnFrameTreeNodeDestroyed(FrameTreeNode* node) final;
lfg601233692017-03-06 22:45:441782
1783 // The WebContents that owns this WebContentsTreeNode.
Ali Hijazi4d4e24092022-10-20 22:59:311784 const raw_ptr<WebContentsImpl, DanglingUntriaged> current_web_contents_;
lfg601233692017-03-06 22:45:441785
1786 // The outer WebContents of |current_web_contents_|, or nullptr if
1787 // |current_web_contents_| is the outermost WebContents.
Ali Hijazi4d4e24092022-10-20 22:59:311788 raw_ptr<WebContentsImpl, DanglingUntriaged> outer_web_contents_;
lfg601233692017-03-06 22:45:441789
1790 // The ID of the FrameTreeNode in the |outer_web_contents_| that hosts
1791 // |current_web_contents_| as an inner WebContents.
Avi Drissman13d20e92024-09-05 16:56:301792 FrameTreeNodeId outer_contents_frame_tree_node_id_;
lfg601233692017-03-06 22:45:441793
Lucas Furukawa Gadani3d38ec152018-10-26 20:55:181794 // List of inner WebContents that we host. The outer WebContents owns the
1795 // inner WebContents.
1796 std::vector<std::unique_ptr<WebContents>> inner_web_contents_;
paulmeyerfeafc2d2017-04-25 21:46:401797
Dave Tapuskad8b0530f2021-10-19 15:12:311798 // Only the root node should have this set. This indicates the FrameTree
1799 // that has the focused frame. The FrameTree tree could be arbitrarily deep.
1800 // An inner WebContents if focused is responsible for setting this back to
1801 // another valid during its destruction. See WebContentsImpl destructor.
Alison Gale81f4f2c72024-04-22 19:33:311802 // TODO(crbug.com/40200744): Support clearing this for inner frame trees.
Daniel Cheng3f2c5ff2024-05-30 19:58:181803 raw_ptr<FrameTree> focused_frame_tree_;
lazyboy6ec48b2a2015-06-29 15:18:141804 };
1805
Alexander Timin90c20c32020-08-12 15:28:321806 // Container for WebContentsObservers, which knows when we are iterating over
1807 // observer set.
1808 class WebContentsObserverList {
1809 public:
1810 WebContentsObserverList();
1811 ~WebContentsObserverList();
1812
1813 void AddObserver(WebContentsObserver* observer);
1814 void RemoveObserver(WebContentsObserver* observer);
1815
Andrew Grievee19cd93e2021-01-22 05:43:061816 // T1 must be a pointer to a WebContentsObserver method.
1817 template <typename T1, typename... P1>
1818 void NotifyObservers(T1 func, P1&&... args) {
Etienne Pierre-doray2f16b82922024-11-08 15:10:251819 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
1820 "WebContentsObserverList::NotifyObservers");
Alexander Timin90c20c32020-08-12 15:28:321821 base::AutoReset<bool> scope(&is_notifying_observers_, true);
1822 for (WebContentsObserver& observer : observers_) {
1823 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
1824 "Dispatching WebContentsObserver callback");
Andrew Grievee19cd93e2021-01-22 05:43:061825 ((observer).*(func))(std::forward<P1>(args)...);
Alexander Timin90c20c32020-08-12 15:28:321826 }
1827 }
1828
1829 bool is_notifying_observers() { return is_notifying_observers_; }
1830
1831 // Exposed to deal with IPC message handlers which need to stop iteration
1832 // early.
Jordan Baylesa4d7edbe2023-10-07 05:59:341833 const base::ObserverList<WebContentsObserver>& observer_list() {
Alexander Timin90c20c32020-08-12 15:28:321834 return observers_;
1835 }
1836
1837 private:
1838 bool is_notifying_observers_ = false;
Jordan Baylesa4d7edbe2023-10-07 05:59:341839 base::ObserverList<WebContentsObserver> observers_;
Alexander Timin90c20c32020-08-12 15:28:321840 };
1841
[email protected]d1198fd2012-08-13 22:50:191842 // See WebContents::Create for a description of these parameters.
Lukasz Anforowicze9ae3722017-09-29 17:37:381843 explicit WebContentsImpl(BrowserContext* browser_context);
[email protected]d1198fd2012-08-13 22:50:191844
Albert J. Wong65fe64d2019-09-20 02:48:141845 // Covariant return type alternative for WebContents::Create(). Avoids
1846 // need for casting of objects inside the content layer.
1847 static std::unique_ptr<WebContentsImpl> Create(const CreateParams& params);
1848
[email protected]e2225bf2013-11-15 16:09:381849 // Add and remove observers for page navigation notifications. The order in
1850 // which notifications are sent to observers is undefined. Clients must be
1851 // sure to remove the observer before they go away.
[email protected]8ff00d72012-10-23 19:12:211852 void AddObserver(WebContentsObserver* observer);
1853 void RemoveObserver(WebContentsObserver* observer);
[email protected]d1198fd2012-08-13 22:50:191854
Greg Thompson92d069b2025-01-30 20:26:271855 // Sets the accessibility mode if this WebContents will potentially be
1856 // user-visible, and broadcasts it to all of its frames if it differs from the
1857 // previous mode.
1858 void SetAccessibilityModeImpl(ui::AXMode accessibility_mode);
1859
danakjcdab6ed52021-02-10 23:44:131860 // Indicates whether this tab should be considered crashed. The setter will
1861 // also notify the delegate when the flag is changed.
Khushalc5eaf222021-06-30 20:15:481862 void SetPrimaryMainFrameProcessStatus(base::TerminationStatus status,
1863 int error_code);
danakjcdab6ed52021-02-10 23:44:131864
alexmose201c7cd2015-06-10 17:14:211865 // Clears a pending contents that has been closed before being shown.
[email protected]7fff43e2013-05-21 20:21:101866 void OnWebContentsDestroyed(WebContentsImpl* web_contents);
1867
Daniel Cheng036c5b92024-05-07 15:19:371868 // Creates and adds to the map a destruction observer watching
1869 // `render_widget_host`. There must be no observer already watching
1870 // `render_widget_host`.
1871 void AddRenderWidgetHostDestructionObserver(
1872 RenderWidgetHost* render_widget_host);
1873
1874 // Deletes and removes from the map a destruction observer
1875 // watching `render_widget_host`. No-op if there is no such observer.
1876 void RemoveRenderWidgetHostDestructionObserver(
1877 RenderWidgetHost* render_widget_host);
1878
Avi Drissman783c1232021-02-05 01:27:051879 // Clears a pending render widget host that has been closed before being
1880 // shown.
1881 void OnRenderWidgetHostDestroyed(RenderWidgetHost* render_widget_host);
1882
1883 // Creates and adds to the map a destruction observer watching `web_contents`.
[email protected]7fff43e2013-05-21 20:21:101884 // No-op if such an observer already exists.
Avi Drissman783c1232021-02-05 01:27:051885 void AddWebContentsDestructionObserver(WebContentsImpl* web_contents);
[email protected]7fff43e2013-05-21 20:21:101886
1887 // Deletes and removes from the map a destruction observer
Avi Drissman783c1232021-02-05 01:27:051888 // watching `web_contents`. No-op if there is no such observer.
1889 void RemoveWebContentsDestructionObserver(WebContentsImpl* web_contents);
1890
Adithya Srinivasane6e7f842019-12-16 18:41:361891 // Traverses all the WebContents in the WebContentsTree and creates a set of
1892 // all the unique RenderWidgetHostViews.
Kevin McNeeef1e9362021-06-08 21:31:521893 std::set<RenderWidgetHostViewBase*>
1894 GetRenderWidgetHostViewsInWebContentsTree();
Adithya Srinivasane6e7f842019-12-16 18:41:361895
pkotwicz75ca8ffd2016-02-16 23:10:191896 // Called with the result of a DownloadImage() request.
Mikel Astiz034ba14e2021-04-30 07:23:491897 void OnDidDownloadImage(base::WeakPtr<RenderFrameHostImpl> rfh,
1898 ImageDownloadCallback callback,
pkotwicz75ca8ffd2016-02-16 23:10:191899 int id,
1900 const GURL& image_url,
leon.hancbc4bc3c2016-02-26 07:08:521901 int32_t http_status_code,
leon.hanc2228532016-08-16 05:59:181902 const std::vector<SkBitmap>& images,
1903 const std::vector<gfx::Size>& original_image_sizes);
pkotwicz75ca8ffd2016-02-16 23:10:191904
Jacob Francis0043f242024-07-24 21:46:211905 int GetNextDownloadId();
1906
Pavel Feldman3c1842b2017-08-02 05:00:161907 // Callback function when showing JavaScript dialogs. Takes in a routing ID
[email protected]6fba26d2014-04-29 09:38:281908 // pair to identify the RenderFrameHost that opened the dialog, because it's
1909 // possible for the RenderFrameHost to be deleted by the time this is called.
1910 void OnDialogClosed(int render_process_id,
1911 int render_frame_id,
Dave Tapuskacdf545cc2020-01-23 18:38:521912 JavaScriptDialogCallback response_callback,
Avi Drissman1a55a9d62020-03-10 18:56:451913 base::ScopedClosureRunner fullscreen_block,
[email protected]87de04b02014-04-08 22:14:491914 bool dialog_was_suppressed,
[email protected]51da7e32012-01-30 19:24:521915 bool success,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:581916 const std::u16string& user_input);
[email protected]51da7e32012-01-30 19:24:521917
[email protected]d0759f492012-04-19 22:50:501918 // IPC message handlers.
nicka0ac8382016-12-15 23:59:231919 void OnUpdateZoomLimits(RenderViewHostImpl* source,
1920 int minimum_percent,
[email protected]fce823222014-05-30 16:24:301921 int maximum_percent);
nicka0ac8382016-12-15 23:59:231922 void OnShowValidationMessage(RenderViewHostImpl* source,
1923 const gfx::Rect& anchor_in_root_view,
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:581924 const std::u16string& main_text,
1925 const std::u16string& sub_text);
nicka0ac8382016-12-15 23:59:231926 void OnHideValidationMessage(RenderViewHostImpl* source);
1927 void OnMoveValidationMessage(RenderViewHostImpl* source,
1928 const gfx::Rect& anchor_in_root_view);
[email protected]edc3af82013-12-12 21:24:071929
danakj5f22bcc2021-02-12 18:09:011930 // Determines if content is allowed to overscroll. This value comes from the
1931 // WebContentsDelegate, but can also be overridden by the WebContents.
1932 bool CanOverscrollContent() const;
1933
Aman Vermab3ed74e2024-04-29 13:58:131934 // void CastToViewBaseSafely(
1935 // RenderWidgetTargeter::RenderWidgetHostAtPointCallback callback,
1936 // base::WeakPtr<RenderWidgetHostViewInput> view,
1937 // std::optional<gfx::PointF> point) ;
1938
avallee9993fca2016-11-17 06:16:501939 // Inner WebContents Helpers -------------------------------------------------
1940 //
1941 // These functions are helpers in managing a hierarchy of WebContents
1942 // involved in rendering inner WebContents.
1943
K. Moon97def7d2022-02-01 15:56:021944 // The following functions update registrations for all RenderWidgetHostViews
1945 // rooted at this WebContents. They are used when attaching/detaching an inner
1946 // WebContents.
1947 //
1948 // Some properties of RenderWidgetHostViews, such as the FrameSinkId and
1949 // TextInputManager, depend on the outermost WebContents, and must be updated
1950 // during attach/detach.
1951 void RecursivelyRegisterRenderWidgetHostViews();
1952 void RecursivelyUnregisterRenderWidgetHostViews();
W. James MacLean2dc75ed42019-03-06 14:31:091953
avallee9993fca2016-11-17 06:16:501954 // When multiple WebContents are present within a tab or window, a single one
1955 // is focused and will route keyboard events in most cases to a RenderWidget
1956 // contained within it. |GetFocusedWebContents()|'s main frame widget will
1957 // receive page focus and blur events when the containing window changes focus
1958 // state.
1959
avallee9993fca2016-11-17 06:16:501960 // Returns true if |this| is the focused WebContents or an ancestor of the
1961 // focused WebContents.
1962 bool ContainsOrIsFocusedWebContents();
1963
Jeremy Roman03ce13ce2020-05-29 22:16:571964 // Called just after an inner web contents is attached.
1965 void InnerWebContentsAttached(WebContents* inner_web_contents);
1966
1967 // Called just after an inner web contents is detached.
1968 void InnerWebContentsDetached(WebContents* inner_web_contents);
1969
[email protected]0dd3a0ab2011-02-18 08:17:441970 // Navigation helpers --------------------------------------------------------
1971 //
1972 // These functions are helpers for Navigate() and DidNavigate().
1973
1974 // Handles post-navigation tasks in DidNavigate AFTER the entry has been
1975 // committed to the navigation controller. Note that the navigation entry is
1976 // not provided since it may be invalid/changed after being committed. The
1977 // current navigation entry is in the NavigationController at this point.
[email protected]2f7b3c5a2013-06-21 04:59:251978
[email protected]bafe6cd2012-05-23 23:09:501979 // Finds the new RenderWidgetHost and returns it. Note that this can only be
1980 // called once as this call also removes it from the internal map.
alexmosc2a8cec2016-05-23 22:19:531981 RenderWidgetHostView* GetCreatedWidget(int process_id, int route_id);
[email protected]bafe6cd2012-05-23 23:09:501982
Joel Hockey8c2011b22020-04-30 05:07:191983 // Finds the new CreatedWindow by |main_frame_widget_route_id|, initializes
nick5ae4d2d2017-01-06 01:18:351984 // it for renderer-initiated creation, and returns it. Note that this can only
1985 // be called once as this call also removes it from the internal map.
Arthur Sonzognic686e8f2024-01-11 08:36:371986 std::optional<CreatedWindow> GetCreatedWindow(int process_id,
1987 int main_frame_widget_route_id);
[email protected]bafe6cd2012-05-23 23:09:501988
Gyuyoung Kim877e86d2020-07-21 04:01:021989 // Execute a PageBroadcast Mojo method.
1990 void ExecutePageBroadcastMethod(PageBroadcastMethodCallback callback);
1991
Takashi Toyoshimadf3f4e312021-11-19 03:51:481992 // Execute a PageBroadcast Mojo method for all MPArch pages.
1993 void ExecutePageBroadcastMethodForAllPages(
1994 PageBroadcastMethodCallback callback);
1995
lukasza6f8ac622017-06-06 03:10:201996 void SetOpenerForNewContents(FrameTreeNode* opener, bool opener_suppressed);
1997
[email protected]960b0372014-05-19 18:01:001998 // Tracking loading progress -------------------------------------------------
1999
fdegansa696e5112015-04-17 01:57:592000 // Resets the tracking state of the current load progress.
[email protected]960b0372014-05-19 18:01:002001 void ResetLoadProgressState();
2002
fdegansa696e5112015-04-17 01:57:592003 // Notifies the delegate that the load progress was updated.
2004 void SendChangeLoadProgress();
[email protected]960b0372014-05-19 18:01:002005
[email protected]0dd3a0ab2011-02-18 08:17:442006 // Misc non-view stuff -------------------------------------------------------
2007
avi2b177592014-12-10 02:08:022008 // Sets the history for a specified RenderViewHost to |history_length|
Charlie Reis99b2eba22025-01-31 19:18:572009 // entries, with an index of |history_index|.
2010 void SetHistoryIndexAndLengthForView(RenderViewHost* render_view_host,
2011 int history_index,
2012 int history_length);
avi2b177592014-12-10 02:08:022013
[email protected]0dd3a0ab2011-02-18 08:17:442014 // Helper functions for sending notifications.
danakja0bce4c952020-05-12 20:40:282015 void NotifyViewSwapped(RenderViewHost* old_view, RenderViewHost* new_view);
Kevin McNeefb86fcf2021-02-26 23:20:572016 void NotifyFrameSwapped(RenderFrameHostImpl* old_frame,
Dave Tapuskae45d6fd2021-09-29 17:03:592017 RenderFrameHostImpl* new_frame);
[email protected]0dd3a0ab2011-02-18 08:17:442018
[email protected]fa944cb82013-11-15 17:51:212019 // TODO(creis): This should take in a FrameTreeNode to know which node's
2020 // render manager to return. For now, we just return the root's.
Paul Semel3e241042022-10-11 12:57:312021 RenderFrameHostManager* GetRenderManager();
[email protected]fa944cb82013-11-15 17:51:212022
[email protected]7a846df2012-09-20 19:17:392023 // Removes browser plugin embedder if there is one.
2024 void RemoveBrowserPluginEmbedder();
2025
danakja0bce4c952020-05-12 20:40:282026 // Returns the size that the main frame should be sized to.
2027 gfx::Size GetSizeForMainFrame();
[email protected]dc0fd432013-08-27 15:29:212028
[email protected]222f5822014-02-05 23:40:492029 // Helper method that's called whenever |preferred_size_| or
2030 // |preferred_size_for_capture_| changes, to propagate the new value to the
2031 // |delegate_|.
2032 void OnPreferredSizeChanged(const gfx::Size& old_size);
2033
paulmeyerfeafc2d2017-04-25 21:46:402034 // Returns the FindRequestManager, which may be found in an outer WebContents.
Lucas Furukawa Gadanie1c5dfda2018-11-29 17:57:412035 FindRequestManager* GetFindRequestManager();
paulmeyerfeafc2d2017-04-25 21:46:402036
Ehsan Karamad6beb2ea2018-11-25 18:15:132037 // Returns the FindRequestManager, or tries to create one if it doesn't
2038 // already exist. The FindRequestManager may be found in an outer
2039 // WebContents. If this is an inner WebContents which is not yet attached to
2040 // an outer WebContents the method will return nullptr.
paulmeyerc0b762b2016-04-13 11:55:172041 FindRequestManager* GetOrCreateFindRequestManager();
2042
falken52a56e32016-12-08 05:02:402043 // Prints a console warning when visiting a localhost site with a bad
2044 // certificate via --allow-insecure-localhost.
Jeremy Romand597d3372021-07-09 23:36:562045 void ShowInsecureLocalhostWarningIfNeeded(PageImpl& page);
falken52a56e32016-12-08 05:02:402046
Megan Jablonski2f6a4c52017-07-10 23:01:252047 // Format of |headers| is a new line separated list of key value pairs:
2048 // "<key1>: <value1>\r\n<key2>: <value2>".
Min Qina904f3302018-02-13 23:33:342049 static download::DownloadUrlParameters::RequestHeadersType
2050 ParseDownloadHeaders(const std::string& headers);
Megan Jablonski2f6a4c52017-07-10 23:01:252051
EhsanK2075c7e2017-08-21 02:42:392052 // Sets the visibility of immediate child views, i.e. views whose parent view
2053 // is that of the main frame.
2054 void SetVisibilityForChildViews(bool visible);
2055
Lukasz Anforowiczfd707142018-02-07 19:46:132056 // A helper for clearing the link status bubble after navigating away.
2057 // See also UpdateTargetURL.
2058 void ClearTargetURL();
2059
Arthur Sonzogni929d29f2018-09-17 14:19:442060 // Called each time |fullscreen_frames_| is updated. Find the new
Charlie Reis207e93c2023-10-04 23:48:492061 // |current_fullscreen_frame_id_| and notify observers whenever it changes.
Arthur Sonzogni929d29f2018-09-17 14:19:442062 void FullscreenFrameSetUpdated();
2063
Sonja3e1acb12024-01-15 12:06:412064 // Adjusts bounds for minimum window size and available screen area
2065 // constraints. This compliments similar renderer-side adjustments, using the
2066 // resolved display mode for new windows, which renderers may be unable to
2067 // determine.
2068 int64_t AdjustWindowRect(gfx::Rect* bounds, RenderFrameHostImpl* opener);
2069
Alison Maher7f366dc62020-03-03 19:46:002070 // ui::NativeThemeObserver:
2071 void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
Abigail Klein08cfe3f2021-04-01 02:09:312072 void OnCaptionStyleUpdated() override;
Alison Maher7f366dc62020-03-03 19:46:002073
tom855c4bf32021-09-30 00:27:262074 // ui::ColorProviderSourceObserver:
2075 void OnColorProviderChanged() override;
2076
2077 // Returns the ColorProvider instance for this WebContents object. This will
2078 // always return a valid ColorProvider instance.
Tom Lukaszewicz63b3da52022-01-26 01:37:572079 const ui::ColorProvider& GetColorProvider() const override;
tom855c4bf32021-09-30 00:27:262080
Shintaro Kawamura1042d572024-09-30 13:52:222081 // implements SlowWebPreferenceCacheObserver
2082 void OnSlowWebPreferenceChanged() override;
2083
Collin Baker989e0882019-11-01 01:27:172084 // Sets the visibility to |new_visibility| and propagates this to the
2085 // renderer side, taking into account the current capture state. This
Elad Alon0feb6602021-10-14 09:26:362086 // can be called with the current visibility to affect capturing
Collin Baker989e0882019-11-01 01:27:172087 // changes.
Elad Alon0feb6602021-10-14 09:26:362088 // |is_activity| controls whether a change to |visible| affects
Olivier ROBIN4b58dd932024-08-06 13:30:322089 // the value returned by GetLastActiveTimeTicks().
Elad Alon0feb6602021-10-14 09:26:362090 void UpdateVisibilityAndNotifyPageAndView(Visibility new_visibility,
2091 bool is_activity = true);
Collin Baker989e0882019-11-01 01:27:172092
Alexander Timine3ec4192020-04-20 16:39:402093 // Returns UKM source id for the currently displayed page.
2094 // Intentionally kept private, prefer using
2095 // render_frame_host->GetPageUkmSourceId() if you already have a
Dave Tapuska327c06c92022-06-13 20:31:512096 // |render_frame_host| reference or
2097 // GetPrimaryMainFrame()->GetPageUkmSourceId() if you don't.
Alexander Timine3ec4192020-04-20 16:39:402098 ukm::SourceId GetCurrentPageUkmSourceId() override;
2099
Dave Tapuska05fcfb62021-10-18 17:09:032100 // Bit mask to indicate what types of RenderViewHosts to be returned in
2101 // ForEachRenderViewHost.
2102 enum ForEachRenderViewHostTypes {
2103 kPrerenderViews = 1 << 0,
2104 kBackForwardCacheViews = 1 << 1,
2105 kActiveViews = 1 << 2,
2106 kAllViews = kActiveViews | kBackForwardCacheViews | kPrerenderViews,
2107 };
2108
2109 // For each RenderViewHost (including bfcache, prerendering) call the
2110 // callback, this will be filtered by `view_mask`.
2111 void ForEachRenderViewHost(
2112 ForEachRenderViewHostTypes view_mask,
2113 RenderViewHostIterationCallback on_render_view_host);
Yuzu Saijo232076f2020-05-29 07:14:022114
Kevin McNeec9d0fda2021-05-19 15:55:172115 // This is the actual implementation of the various overloads of
2116 // |ForEachRenderFrameHost|.
2117 void ForEachRenderFrameHostImpl(
Daniel Cheng982f2b22022-08-25 23:46:162118 base::FunctionRef<FrameIterationAction(RenderFrameHostImpl*)> on_frame,
Kevin McNeec9d0fda2021-05-19 15:55:172119 bool include_speculative);
2120
Takashi Toyoshimadc3f7472021-07-21 08:02:322121 // Calls |on_frame_tree| for every FrameTree in this WebContents.
Kevin McNee53f0b2d2021-11-02 18:00:452122 // This does not descend into inner WebContents, but does include inner frame
2123 // trees based on MPArch.
Takashi Toyoshimadc3f7472021-07-21 08:02:322124 void ForEachFrameTree(FrameTreeIterationCallback on_frame_tree);
2125
Kevin McNee53f0b2d2021-11-02 18:00:452126 // Returns the primary frame tree, followed by any other outermost frame trees
2127 // in this WebContents. Outermost frame trees include, for example,
Jeremy Romanc0c69be2023-11-21 19:14:522128 // prerendering frame trees, and do not include, for example, fenced frames.
2129 // Also note that bfcached pages do not have a distinct frame tree,
Kevin McNee53f0b2d2021-11-02 18:00:452130 // so the primary frame tree in the result would be the only FrameTree
2131 // representing any bfcached pages.
2132 std::vector<FrameTree*> GetOutermostFrameTrees();
2133
Kevin McNeec9d0fda2021-05-19 15:55:172134 // Returns the primary main frame, followed by the main frames of any other
Kevin McNee53f0b2d2021-11-02 18:00:452135 // outermost frame trees in this WebContents and the main frames of any
2136 // bfcached pages. Note that unlike GetOutermostFrameTrees, bfcached pages
2137 // have a distinct RenderFrameHostImpl in this result.
Kevin McNeec9d0fda2021-05-19 15:55:172138 std::vector<RenderFrameHostImpl*> GetOutermostMainFrames();
2139
Dale Curtis7030f252021-04-07 14:05:312140 // Called when the base::ScopedClosureRunner returned by
2141 // IncrementCapturerCount() is destructed.
Elad Alon0feb6602021-10-14 09:26:362142 void DecrementCapturerCount(bool stay_hidden,
2143 bool stay_awake,
2144 bool is_activity = true);
Dale Curtis7030f252021-04-07 14:05:312145
Tsuyoshi Horocd828462021-04-21 04:59:582146 // Calculates the PageVisibilityState for |visibility|, taking the capturing
2147 // state into account.
2148 PageVisibilityState CalculatePageVisibilityState(Visibility visibility) const;
2149
Khushalc5eaf222021-06-30 20:15:482150 // Called when the process hosting the primary main RenderFrameHost is known
2151 // to be alive.
2152 void NotifyPrimaryMainFrameProcessIsAlive();
2153
Rakina Zata Amni46087a12022-11-11 08:28:382154 // Updates |entry|'s title. |entry| must belong to the WebContents' primary
2155 // NavigationController. Returns true if |entry|'s title was changed, and
2156 // false otherwise.
Adithya Srinivasan9b0c99c2021-08-10 15:19:452157 bool UpdateTitleForEntryImpl(NavigationEntryImpl* entry,
2158 const std::u16string& title);
2159 // Dispatches WebContentsObserver::TitleWasSet and also notifies the delegate
2160 // of a title change if |entry| is the entry whose title is being used as the
2161 // display title.
2162 void NotifyTitleUpdateForEntry(NavigationEntryImpl* entry);
2163 // Returns the navigation entry whose title is used as the display title for
Rakina Zata Amni46087a12022-11-11 08:28:382164 // this WebContents (i.e. for WebContents::GetTitle()).
Adithya Srinivasan9b0c99c2021-08-10 15:19:452165 NavigationEntry* GetNavigationEntryForTitle();
2166
Klaus Weidnerd8219432022-02-08 21:50:592167 // Apply shared logic for SetHasPictureInPictureVideo() and
2168 // SetHasPictureInPictureDocument().
2169 void SetHasPictureInPictureCommon(bool has_picture_in_picture);
2170
Andy Paicu5608bda82023-03-03 15:09:202171 // A scope that disallows custom cursors has expired.
2172 void DisallowCustomCursorScopeExpired();
2173
Jiacheng Guo6dcc29c2024-07-26 00:28:402174 // WarmUp a spare render process for future navigations.
2175 void WarmUpAndroidSpareRenderer();
2176
Ari Chivukulaee503052024-08-30 20:33:532177 // If the new window will be a partitioned popin, we need to validate the
2178 // settings and set the opener.
2179 // See https://explainers-by-googlers.github.io/partitioned-popins/
2180 void SetPartitionedPopinOpenerOnNewWindowIfNeeded(
2181 WebContentsImpl* new_window,
2182 const mojom::CreateNewWindowParams& params,
2183 RenderFrameHostImpl* opener);
2184
Arthur Hemery79d203e2023-05-26 11:52:452185 // Describes the different types of groups we can be interested in when
2186 // looking for scriptable frames.
2187 enum class GroupType { kBrowsingContextGroup, kCoopRelatedGroup };
2188
2189 // Returns a vector of all the top-level active frames in the same group type
2190 // specified by `group_type`.
2191 std::vector<RenderFrameHostImpl*> GetActiveTopLevelDocumentsInGroup(
2192 RenderFrameHostImpl* render_frame_host,
2193 GroupType group_type);
2194
Dave Tapuska894bfb42024-11-04 22:44:352195 // Creates a new ForwardingAudioStreamFactory.
2196 std::unique_ptr<ForwardingAudioStreamFactory> CreateAudioStreamFactory();
2197
Dave Tapuska463717e2024-11-21 18:42:472198 // Cancel any pending dialogs created from the delegate's
2199 // JavascriptDialogManager.
2200 void CancelDialogManagerDialogs(bool reset_state);
2201
Aman Verma44335c72025-02-19 18:43:572202 // Sets up RenderInputRouterDelegate mojo connections with InputManager on
2203 // the VizCompositorThread for input handling with InputVizard.
2204 void SetupRenderInputRouterDelegateConnection();
2205
Ari Chivukulaf6f09ba2025-03-04 20:01:342206 // See GetPartitionedPopinEmbedderOrigin for details.
2207 GURL GetPartitionedPopinEmbedderOriginImpl() const;
2208
Mark Schillacic1e067e82025-04-02 17:36:112209 // Recursively constructs a vector of AXNodeData objects for the children of
2210 // the given |node|.
2211 void RecursivelyConstructAXTree(ui::AXNode* node,
2212 std::vector<ui::AXNodeData>& nodes);
2213
[email protected]0dd3a0ab2011-02-18 08:17:442214 // Data for core operation ---------------------------------------------------
2215
2216 // Delegate for notifying our owner about stuff. Not owned by us.
Ali Hijazi4d4e24092022-10-20 22:59:312217 raw_ptr<WebContentsDelegate, DanglingUntriaged> delegate_;
[email protected]0dd3a0ab2011-02-18 08:17:442218
[email protected]0dd3a0ab2011-02-18 08:17:442219 // The corresponding view.
dcheng59716272016-04-09 05:19:082220 std::unique_ptr<WebContentsView> view_;
[email protected]0dd3a0ab2011-02-18 08:17:442221
[email protected]5a3bdf52012-05-24 15:12:572222 // The view of the RVHD. Usually this is our WebContentsView implementation,
2223 // but if an embedder uses a different WebContentsView, they'll need to
2224 // provide this.
Lukasz Anforowicz3eacd9e62023-05-17 21:58:542225 raw_ptr<RenderViewHostDelegateView> render_view_host_delegate_view_;
[email protected]5a3bdf52012-05-24 15:12:572226
Joel Hockey8c2011b22020-04-30 05:07:192227 // Tracks CreatedWindow objects that have not been shown yet. They are
2228 // identified by the process ID and routing ID passed to CreateNewWindow.
2229 std::map<GlobalRoutingID, CreatedWindow> pending_contents_;
[email protected]bafe6cd2012-05-23 23:09:502230
Avi Drissman783c1232021-02-05 01:27:052231 // Watches for the destruction of items in `pending_contents_`.
2232 std::map<WebContentsImpl*, std::unique_ptr<WebContentsDestructionObserver>>
2233 web_contents_destruction_observers_;
2234
alexmosc2a8cec2016-05-23 22:19:532235 // This map holds widgets that were created on behalf of the renderer but
2236 // haven't been shown yet.
Ali Hijazi60a72b0a2024-09-30 17:58:532237 std::map<GlobalRoutingID, raw_ptr<RenderWidgetHost, CtnExperimental>>
2238 pending_widgets_;
[email protected]bafe6cd2012-05-23 23:09:502239
Avi Drissman783c1232021-02-05 01:27:052240 // Watches for the destruction of items in `pending_widgets_`.
2241 std::map<RenderWidgetHost*,
2242 std::unique_ptr<RenderWidgetHostDestructionObserver>>
2243 render_widget_host_destruction_observers_;
[email protected]7fff43e2013-05-21 20:21:102244
[email protected]996042972011-11-08 22:43:592245 // A list of observers notified when page state changes. Weak references.
Carlos Caballerob65b6e3a2021-11-15 10:09:002246 // This MUST be listed above `primary_frame_tree_` since at destruction time
2247 // the latter might cause RenderViewHost's destructor to call us and we might
2248 // use the observer list then.
Alexander Timin90c20c32020-08-12 15:28:322249 WebContentsObserverList observers_;
[email protected]996042972011-11-08 22:43:592250
Rakina Zata Amnic7ffea882021-08-16 10:04:282251 // True if this tab was opened by another window. This is true even if the tab
2252 // is opened with "noopener", and won't be unset if the opener is closed.
2253 bool opened_by_another_window_;
[email protected]c7c0d822014-04-16 20:19:492254
Daniel Chengbcbc30f2024-05-28 09:02:122255 // Set to true while calling out to notify one-off observers (ie non-
2256 // WebContentsObservers). These observers should not destroy WebContentsImpl
2257 // while it is on the call stack, as that leads to use-after-frees.
2258 bool prevent_destruction_ = false;
2259
2260 bool is_being_destroyed_ = false;
2261
Xiaohan Wang24ec9342022-01-15 17:34:222262#if BUILDFLAG(IS_ANDROID)
Kevin McNee576bb5d82019-05-29 16:47:512263 std::unique_ptr<WebContentsAndroid> web_contents_android_;
2264#endif
2265
Daniel Cheng37d22722024-06-29 00:43:442266 // Manages the embedder state for browser plugins, if this WebContents is an
2267 // embedder; NULL otherwise.
2268 std::unique_ptr<BrowserPluginEmbedder> browser_plugin_embedder_;
2269
2270 // Manages the guest state for browser plugin, if this WebContents is a guest;
2271 // NULL otherwise.
2272 std::unique_ptr<BrowserPluginGuest> browser_plugin_guest_;
2273
[email protected]0dd3a0ab2011-02-18 08:17:442274 // Helper classes ------------------------------------------------------------
2275
Daniel Cheng3f2c5ff2024-05-30 19:58:182276 // Contains information about the WebContents tree structure.
2277 WebContentsTreeNode node_;
2278
Carlos Caballerob65b6e3a2021-11-15 10:09:002279 // Primary FrameTree of this WebContents instance. This WebContents might have
2280 // additional FrameTrees for features like prerendering and fenced frames,
2281 // which either might be standalone (prerendering) to nested within a
2282 // different FrameTree (fenced frame).
2283 FrameTree primary_frame_tree_;
Lucas Furukawa Gadani99125822019-01-03 15:41:492284
[email protected]c7dd2f62011-07-18 15:57:592285 // SavePackage, lazily created.
2286 scoped_refptr<SavePackage> save_package_;
2287
paulmeyerc8cb7cb2016-06-07 01:14:192288 // Manages/coordinates multi-process find-in-page requests. Created lazily.
dcheng18ec0b542016-04-26 19:28:532289 std::unique_ptr<FindRequestManager> find_request_manager_;
paulmeyerc0b762b2016-04-13 11:55:172290
[email protected]0dd3a0ab2011-02-18 08:17:442291 // Data for loading state ----------------------------------------------------
2292
danakjcdab6ed52021-02-10 23:44:132293 // Indicates the process state of the primary main frame's renderer process.
2294 // If the process is not live due to a crash, this will be reflected by
2295 // IsCrashed(), though it's possible to not be live while not indicating a
2296 // crash occurred.
Khushalc5eaf222021-06-30 20:15:482297 base::TerminationStatus primary_main_frame_process_status_;
2298 int primary_main_frame_process_error_code_;
[email protected]0dd3a0ab2011-02-18 08:17:442299
[email protected]0dd3a0ab2011-02-18 08:17:442300 // The current load state and the URL associated with it.
[email protected]9c235f042011-08-10 22:28:212301 net::LoadStateWithParam load_state_;
Jan Wilken Dörrieaace0cfef2021-03-11 22:01:582302 std::u16string load_state_host_;
Dave Tapuskae1a08aaf2021-03-05 18:31:592303 base::TimeTicks load_info_timestamp_;
[email protected]960b0372014-05-19 18:01:002304
[email protected]960b0372014-05-19 18:01:002305 base::TimeTicks loading_last_progress_update_;
2306
Sreeja Kamishetty0be3b1b2021-08-12 17:04:152307 // Default value is set to 100ms between LoadProgressChanged events.
2308 base::TimeDelta minimum_delay_between_loading_updates_ms_ =
Peter Kastinge5a38ed2021-10-02 03:06:352309 base::Milliseconds(100);
Sreeja Kamishetty0be3b1b2021-08-12 17:04:152310
[email protected]0dd3a0ab2011-02-18 08:17:442311 // Upload progress, for displaying in the status bar.
2312 // Set to zero when there is no significant upload happening.
avib7348942015-12-25 20:57:102313 uint64_t upload_size_;
2314 uint64_t upload_position_;
[email protected]0dd3a0ab2011-02-18 08:17:442315
dfalcantarae6b7b46752015-07-10 18:14:162316 // Tracks that this WebContents needs to unblock requests to the renderer.
2317 // See ResumeLoadingCreatedWebContents.
2318 bool is_resume_pending_;
2319
[email protected]0dd3a0ab2011-02-18 08:17:442320 // Data for current page -----------------------------------------------------
2321
yusufod41c5f92015-03-06 00:14:282322 // The last published theme color.
Arthur Sonzognic686e8f2024-01-11 08:36:372323 std::optional<SkColor> last_sent_theme_color_;
yusufod41c5f92015-03-06 00:14:282324
Alan Cutterd73a15d92020-08-21 07:12:452325 // The last published background color.
Arthur Sonzognic686e8f2024-01-11 08:36:372326 std::optional<SkColor> last_sent_background_color_;
Alan Cutterd73a15d92020-08-21 07:12:452327
[email protected]0dd3a0ab2011-02-18 08:17:442328 // Data for misc internal state ----------------------------------------------
2329
Collin Bakerc5259962019-11-14 17:51:582330 // When either > 0, the WebContents is currently being captured (e.g.,
2331 // for screenshots or mirroring); and the underlying RenderWidgetHost
2332 // should not be told it is hidden. If |visible_capturer_count_| > 0,
2333 // the underlying Page is set to fully visible. Otherwise, it is set
2334 // to be hidden but still paint.
Dale Curtis7030f252021-04-07 14:05:312335 int visible_capturer_count_ = 0;
2336 int hidden_capturer_count_ = 0;
2337
2338 // When > 0, |capture_wake_lock_| will be held to prevent display sleep.
2339 int stay_awake_capturer_count_ = 0;
2340
2341 // WakeLock held to ensure screen capture keeps the display on. E.g., for
2342 // presenting through tab capture APIs.
Dale Curtisc496a7762021-02-24 01:15:442343 mojo::Remote<device::mojom::WakeLock> capture_wake_lock_;
[email protected]54597982013-02-06 01:59:552344
Aman Vermabb589a32024-05-07 16:38:172345 // Remote end of the connection for sending delegated ink points to viz to
2346 // support the delegated ink trails feature.
2347 mojo::Remote<gfx::mojom::DelegatedInkPointRenderer>
2348 delegated_ink_point_renderer_;
2349
Francois Doraye6161152018-03-27 22:05:372350 // The visibility of the WebContents. Initialized from
2351 // |CreateParams::initially_hidden|. Updated from
2352 // UpdateWebContentsVisibility(), WasShown(), WasHidden(), WasOccluded().
2353 Visibility visibility_ = Visibility::VISIBLE;
[email protected]0dd3a0ab2011-02-18 08:17:442354
Francois Doraye6161152018-03-27 22:05:372355 // Whether there has been a call to UpdateWebContentsVisibility(VISIBLE).
2356 bool did_first_set_visible_ = false;
tapted65ff2ea72016-03-01 23:39:002357
[email protected]0dd3a0ab2011-02-18 08:17:442358 // Indicates whether we should notify about disconnection of this
[email protected]b172aee2012-04-10 17:05:262359 // WebContentsImpl. This is used to ensure disconnection notifications only
[email protected]0dd3a0ab2011-02-18 08:17:442360 // happen if a connection notification has happened and that they happen only
2361 // once.
2362 bool notify_disconnection_;
2363
Frank Liberatoe837b362023-10-20 23:31:152364 // Counts the number of outstanding requests to ignore input events. They will
2365 // not be sent when this is greater than zero.
2366 int ignore_input_events_count_ = 0;
Takashi Toyoshimad72a465a2024-03-11 23:37:312367 uint64_t next_web_input_event_audit_callback_id_ = 0;
2368 base::flat_map<uint64_t, WebInputEventAuditCallback>
2369 web_input_event_audit_callbacks_;
Avi Drissman738ea192018-08-29 20:24:162370
Dave Tapuska463717e2024-11-21 18:42:472371 // Whether a dialog has been created since the last cancel of dialogs.
2372 bool created_dialog_since_last_cancel_ = false;
[email protected]2e5b90c2011-08-16 21:11:552373
avi85ee8362016-10-08 02:09:082374 // Set to true when there is an active JavaScript dialog showing.
2375 bool is_showing_javascript_dialog_ = false;
2376
[email protected]0dd3a0ab2011-02-18 08:17:442377 // Set to true when there is an active "before unload" dialog. When true,
2378 // we've forced the throbber to start in Navigate, and we need to remember to
2379 // turn it off in OnJavaScriptMessageBoxClosed if the navigation is canceled.
2380 bool is_showing_before_unload_dialog_;
2381
[email protected]0dd3a0ab2011-02-18 08:17:442382 // Settings that get passed to the renderer process.
Mario Sanchez Prada0bd8b8c2020-10-21 17:49:232383 blink::RendererPreferences renderer_preferences_;
[email protected]0dd3a0ab2011-02-18 08:17:442384
Olivier ROBINda292fb2024-08-07 14:32:292385 // The time ticks that this WebContents was last made active. The initial
2386 // value is the WebContents creation time.
2387 base::TimeTicks last_active_time_ticks_;
2388
[email protected]9a890452014-02-13 22:21:022389 // The time that this WebContents was last made active. The initial value is
2390 // the WebContents creation time.
Olivier ROBINda292fb2024-08-07 14:32:292391 base::Time last_active_time_;
[email protected]0dd3a0ab2011-02-18 08:17:442392
Evan Stade6decc972022-10-24 19:42:182393 // The most recent time that this WebContents was interacted with. Currently,
2394 // this counts:
2395 // * 'interactive' input events from the user, like mouse clicks and keyboard
2396 // input but not mouse wheel scrolling
2397 // * editing commands such as `Paste()`, which are invoked programmatically,
2398 // presumably in response to user action
2399 base::TimeTicks last_interaction_time_;
Daniel Cheng90196c82018-04-25 21:49:142400
[email protected]0dd3a0ab2011-02-18 08:17:442401 // See description above setter.
2402 bool closed_by_user_gesture_;
2403
Avi Drissman1a55a9d62020-03-10 18:56:452404 // The number of active fullscreen blockers.
2405 int fullscreen_blocker_count_ = 0;
2406
[email protected]0dd3a0ab2011-02-18 08:17:442407 // Minimum/maximum zoom percent.
danakj30f733132019-09-20 16:14:142408 const int minimum_zoom_percent_;
2409 const int maximum_zoom_percent_;
[email protected]0dd3a0ab2011-02-18 08:17:442410
w.shackleton49bcd392016-01-06 17:38:222411 // Used to correctly handle integer zooming through a smooth scroll device.
2412 float zoom_scroll_remainder_;
2413
[email protected]bcd2815602012-01-14 18:17:232414 // The intrinsic size of the page.
2415 gfx::Size preferred_size_;
2416
[email protected]222f5822014-02-05 23:40:492417 // The preferred size for content screen capture. When |capturer_count_| > 0,
2418 // this overrides |preferred_size_|.
2419 gfx::Size preferred_size_for_capture_;
2420
Jianzhou Fengd8720c72018-01-18 03:06:302421 // When device emulation is enabled, override the size of current and newly
2422 // created render views/widgets.
2423 gfx::Size device_emulation_size_;
2424 gfx::Size view_size_before_emulation_;
2425
Tom Burginf0e48622024-05-16 15:06:122426#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
[email protected]8ed16472014-04-11 19:02:482427 // Holds information about a current color chooser dialog, if one is visible.
Bo Liu2bceebc2021-06-03 15:06:332428 class ColorChooserHolder;
2429 std::unique_ptr<ColorChooserHolder> color_chooser_holder_;
Julie Jeongeun Kim88ce9ec2023-07-28 02:25:402430#endif
[email protected]da8543762012-03-20 08:52:202431
[email protected]b24b68a2012-09-24 21:57:262432 // All live RenderWidgetHostImpls that are created by this object and may
2433 // outlive it.
Aman Vermaea1fcd02024-11-07 20:04:282434 base::flat_map<viz::FrameSinkId,
2435 raw_ptr<RenderWidgetHostImpl, SetExperimental>>
2436 created_widgets_;
[email protected]b24b68a2012-09-24 21:57:262437
alexmosc9e76ec2016-05-16 22:59:372438 // Process id of the shown fullscreen widget, or kInvalidUniqueID if there is
2439 // no fullscreen widget.
2440 int fullscreen_widget_process_id_;
2441
[email protected]44470a22013-01-24 01:21:542442 // Routing id of the shown fullscreen widget or MSG_ROUTING_NONE otherwise.
2443 int fullscreen_widget_routing_id_;
2444
[email protected]0b431992014-06-24 00:08:032445 // At the time the fullscreen widget was being shut down, did it have focus?
2446 // This is used to restore focus to the WebContentsView after both: 1) the
2447 // fullscreen widget is destroyed, and 2) the WebContentsDelegate has
2448 // completed making layout changes to effect an exit from fullscreen mode.
2449 bool fullscreen_widget_had_focus_at_shutdown_;
2450
mariakhomenkoa4971c12015-07-21 19:04:372451 // When a new tab is created asynchronously, stores the OpenURLParams needed
2452 // to continue loading the page once the tab is ready.
dcheng59716272016-04-09 05:19:082453 std::unique_ptr<OpenURLParams> delayed_open_url_params_;
mariakhomenkoa4971c12015-07-21 19:04:372454
Nasko Oskov83a8cf92018-10-19 14:58:562455 // When a new tab is created with window.open(), navigation can be deferred
2456 // to execute asynchronously. In such case, the parameters need to be saved
2457 // for the navigation to be started at a later point.
2458 std::unique_ptr<NavigationController::LoadURLParams> delayed_load_url_params_;
HuanPo Lin0d795c62024-03-28 03:54:052459 base::OnceCallback<void(content::NavigationHandle&)>
2460 delayed_navigation_handle_callback_;
Nasko Oskov83a8cf92018-10-19 14:58:562461
[email protected]34ff1cfc2014-08-20 06:16:052462 // Whether overscroll should be unconditionally disabled.
2463 bool force_disable_overscroll_content_;
[email protected]e85165c642014-06-10 14:34:312464
[email protected]87de04b02014-04-08 22:14:492465 // Whether the last JavaScript dialog shown was suppressed. Used for testing.
2466 bool last_dialog_suppressed_;
2467
Miyoung Shin0f4480d2019-09-12 01:15:262468 mojo::Remote<device::mojom::GeolocationContext> geolocation_context_;
blundellc57b93f2014-10-29 13:19:572469
Gyuyoung Kim1bc1ba82021-02-08 23:32:442470 mojo::AssociatedRemote<blink::mojom::ContextMenuClient> context_menu_client_;
2471
blundelle75a8f92017-03-27 08:11:172472 std::unique_ptr<WakeLockContextHost> wake_lock_context_host_;
Thoren Paulsond344c0a2021-10-14 19:20:312473 bool enable_wake_locks_ = true;
alogvinovf50445a2015-10-30 13:00:122474
Rakina Zata Amni347b70902020-07-22 10:49:042475 // The last set/computed value of WebPreferences for this WebContents, either
2476 // set directly through SetWebPreferences, or set after recomputing values
Rakina Zata Amni4029b6d2020-07-28 02:36:202477 // from ComputeWebPreferences.
Gyuyoung Kim1ac4ca782020-09-11 03:32:512478 std::unique_ptr<blink::web_pref::WebPreferences> web_preferences_;
Rakina Zata Amni347b70902020-07-22 10:49:042479
Rakina Zata Amni4029b6d2020-07-28 02:36:202480 bool updating_web_preferences_ = false;
2481
Xiaohan Wang24ec9342022-01-15 17:34:222482#if BUILDFLAG(IS_ANDROID)
Reilly Grantafbe2242020-02-20 21:14:552483 std::unique_ptr<NFCHost> nfc_host_;
2484#endif
2485
Julie Jeongeun Kim8e2879e2019-08-06 23:55:202486 mojo::ReceiverSet<blink::mojom::ColorChooserFactory>
2487 color_chooser_factory_receivers_;
Joel Hockey85b379d2017-12-11 10:42:132488
leon.hane4db177a2017-02-07 14:19:162489 std::unique_ptr<ScreenOrientationProvider> screen_orientation_provider_;
[email protected]01f83f92014-06-17 14:41:542490
Greg Thompson92d069b2025-01-30 20:26:272491 std::unique_ptr<AccessibilityModePolicy> accessibility_mode_policy_;
2492
[email protected]95640212014-07-26 18:14:302493 // The accessibility mode for all frames. This is queried when each frame
2494 // is created, and broadcast to all frames when it changes.
Doug Turner63f3c7b2017-07-29 05:10:012495 ui::AXMode accessibility_mode_;
[email protected]95640212014-07-26 18:14:302496
Alexander Surkov862feee2021-01-29 21:27:482497 std::unique_ptr<ui::AXEventRecorder> event_recorder_;
Abigail Kleinaa898742019-11-01 02:31:252498
Greg Thompsonf855bf882024-01-30 10:39:452499 // Enables ui::kAXModeBasic for the duration of a recording session.
2500 std::unique_ptr<ScopedAccessibilityMode> recording_mode_;
2501
avayvodcc85bbd2015-08-28 19:11:152502 // Monitors power levels for audio streams associated with this WebContents.
2503 AudioStreamMonitor audio_stream_monitor_;
2504
Max Morin5bc74f52018-05-09 07:00:212505 // Coordinates all the audio streams for this WebContents. Lazily initialized.
Dave Tapuska894bfb42024-11-04 22:44:352506 std::unique_ptr<ForwardingAudioStreamFactory> audio_stream_factory_;
Max Morin5bc74f52018-05-09 07:00:212507
Reilly Grant5e7c79b22019-04-09 17:26:202508 size_t bluetooth_connected_device_count_ = 0;
Ovidio Henriquez76696f62020-07-08 03:06:592509 size_t bluetooth_scanning_sessions_count_ = 0;
Reilly Grant5e7c79b22019-04-09 17:26:202510 size_t serial_active_frame_count_ = 0;
Matt Reynoldse8c6c1f2019-11-02 09:53:532511 size_t hid_active_frame_count_ = 0;
Matt Reynoldsed00ca7e72022-08-18 20:56:202512 size_t usb_active_frame_count_ = 0;
Yifan Luo8e5d3d52024-10-22 19:18:162513 size_t geolocation_active_frame_count_ = 0;
ortuno32e7db3c2016-03-29 16:14:202514
Austin Sullivanafefb722021-01-14 01:26:392515 size_t file_system_access_handle_count_ = 0;
Marijn Kruisselbrinkf1714aa22019-07-02 03:45:332516
sawtellea7333a82018-05-31 02:36:362517 bool has_picture_in_picture_video_ = false;
Klaus Weidnerd8219432022-02-08 21:50:592518 bool has_picture_in_picture_document_ = false;
sawtellea7333a82018-05-31 02:36:362519
dalecurtis88c240072015-12-09 02:11:182520 // Manages media players, CDMs, and power save blockers for media.
dcheng59716272016-04-09 05:19:082521 std::unique_ptr<MediaWebContentsObserver> media_web_contents_observer_;
qinmin58567c82015-01-07 21:00:202522
K. Moon9ae6ef2c2022-08-18 01:30:062523#if BUILDFLAG(ENABLE_PPAPI)
zqzhang181047e62016-07-01 13:37:172524 // Observes pepper playback changes, and notifies MediaSession.
2525 std::unique_ptr<PepperPlaybackObserver> pepper_playback_observer_;
K. Moon9ae6ef2c2022-08-18 01:30:062526#endif // BUILDFLAG(ENABLE_PPAPI)
zqzhang181047e62016-07-01 13:37:172527
Aman Vermadf974d4d22024-09-30 18:12:492528 // RenderWidgetHostInputEventRouter is uniquely owned by WebContentsImpl in
2529 // the browser process.
2530 scoped_refptr<input::RenderWidgetHostInputEventRouter>
Kartar Singhb1bfa1a2024-06-24 13:14:572531 rwh_input_event_router_;
kenrb2a565f82015-09-02 20:24:592532
Aman Verma3047aa412024-05-28 09:09:242533 std::unique_ptr<TouchEmulatorImpl> touch_emulator_;
2534
ekaramadadd882292016-06-08 15:22:562535 // TextInputManager tracks the IME-related state for all the
2536 // RenderWidgetHostViews on this WebContents. Only exists on the outermost
2537 // WebContents and is automatically destroyed when a WebContents becomes an
2538 // inner WebContents by attaching to an outer WebContents. Then the
2539 // IME-related state for RenderWidgetHosts on the inner WebContents is tracked
2540 // by the TextInputManager in the outer WebContents.
2541 std::unique_ptr<TextInputManager> text_input_manager_;
2542
David Bokane86aa032022-05-08 18:21:242543 // Tests can set this to true in order to force this web contents to always
2544 // return nullptr for the above `text_input_manager_`, effectively blocking
2545 // IME events from propagating out of the renderer.
2546 bool suppress_ime_events_for_testing_ = false;
2547
lfgbee1e0a2016-06-08 21:24:212548 // Stores the RenderWidgetHost that currently holds a mouse lock or nullptr if
2549 // there's no RenderWidgetHost holding a lock.
Takumi Fujimoto4661871d2024-01-25 02:04:182550 raw_ptr<RenderWidgetHostImpl, DanglingUntriaged> pointer_lock_widget_ =
2551 nullptr;
Joe Downing192998b22018-03-22 15:51:362552
2553 // Stores the RenderWidgetHost that currently holds a keyboard lock or nullptr
2554 // if no RenderWidgetHost has the keyboard locked.
Ali Hijazi4d4e24092022-10-20 22:59:312555 raw_ptr<RenderWidgetHostImpl, DanglingUntriaged> keyboard_lock_widget_ =
2556 nullptr;
lfgbee1e0a2016-06-08 21:24:212557
Joe Downing13dd76b2018-04-09 18:32:152558 // Indicates whether the escape key is one of the requested keys to be locked.
2559 // This information is used to drive the browser UI so the correct exit
2560 // instructions are displayed to the user in fullscreen mode.
2561 bool esc_key_locked_ = false;
2562
Xiaohan Wang24ec9342022-01-15 17:34:222563#if BUILDFLAG(IS_ANDROID)
rockot400ea35b2016-10-15 19:15:322564 std::unique_ptr<service_manager::InterfaceProvider> java_interfaces_;
sammcf5f1b0f2016-09-20 23:05:112565#endif
2566
qinmin72e8bd02016-10-21 19:35:372567 // Whether this WebContents is for content overlay.
2568 bool is_overlay_content_;
2569
ekaramadf6750aa2017-06-06 18:29:422570 bool showing_context_menu_;
2571
billorr21c005d2016-11-17 03:57:042572 int currently_playing_video_count_ = 0;
Mounir Lamouri0f5bdf52019-04-04 16:32:352573 base::flat_map<MediaPlayerId, gfx::Size> cached_video_sizes_;
billorr21c005d2016-11-17 03:57:042574
mlamouri5cd9ae82017-02-18 11:05:092575 bool has_persistent_video_ = false;
2576
Ian Vollick5d5c37f2019-06-19 22:50:572577 bool is_spatial_navigation_disabled_ = false;
2578
Jinsuk Kimc8eac442024-07-19 18:33:522579#if BUILDFLAG(IS_ANDROID)
Yaroslav Shalivskyyd76a81f42024-10-21 20:08:202580 bool stylus_handwriting_enabled_ = false;
Jinsuk Kimc8eac442024-07-19 18:33:522581 bool long_press_link_select_text_ = false;
2582#endif
2583
Chris Hamiltondf0d72cd2018-05-29 16:23:532584 bool is_currently_audible_ = false;
Tommy Steimel18360512017-11-01 00:38:192585 bool was_ever_audible_ = false;
2586
Lukasz Anforowiczfd707142018-02-07 19:46:132587 // Helper variable for resolving races in UpdateTargetURL / ClearTargetURL.
Ali Hijazi4d4e24092022-10-20 22:59:312588 raw_ptr<RenderFrameHost, DanglingUntriaged> frame_that_set_last_target_url_ =
2589 nullptr;
Lukasz Anforowiczfd707142018-02-07 19:46:132590
Changwan Ryuc1134a82018-03-07 02:10:142591 // Whether we should override user agent in new tabs.
2592 bool should_override_user_agent_in_new_tabs_ = false;
2593
Scott Violet2a6c5bff2020-04-29 23:59:062594 // Used to determine the value of is-user-agent-overriden for renderer
2595 // initiated navigations.
2596 NavigationController::UserAgentOverrideOption
2597 renderer_initiated_user_agent_override_option_ =
2598 NavigationController::UA_OVERRIDE_INHERIT;
2599
Becca Hughes6fe54e432018-06-09 04:18:562600 // Gets notified about changes in viewport fit events.
Donn Denmana6d91832023-11-28 21:25:462601 std::unique_ptr<SafeAreaInsetsHost> safe_area_insets_host_;
Becca Hughes6fe54e432018-06-09 04:18:562602
Arthur Sonzogni929d29f2018-09-17 14:19:442603 // Stores a set of frames that are fullscreen.
2604 // See https://fullscreen.spec.whatwg.org.
Ali Hijazi133b2d92024-02-09 14:01:522605 std::set<raw_ptr<RenderFrameHostImpl, SetExperimental>> fullscreen_frames_;
Becca Hughesfd5d8f892018-06-14 18:23:362606
Charlie Reis207e93c2023-10-04 23:48:492607 // Store an ID for the frame that is currently fullscreen, or an invalid ID if
2608 // there is none.
2609 GlobalRenderFrameHostId current_fullscreen_frame_id_ =
2610 GlobalRenderFrameHostId();
Becca Hughesfd5d8f892018-06-14 18:23:362611
Xiyuan Xia2a66b112018-12-06 15:52:162612 // Whether location bar should be focused by default. This is computed in
2613 // DidStartNavigation/DidFinishNavigation and only set for an initial
2614 // navigation triggered by the browser going to about:blank.
2615 bool should_focus_location_bar_by_default_ = false;
2616
Mike Jacksonf116a2e2021-06-09 16:48:302617 // Stores the rect of the Windows Control Overlay, which contains system UX
2618 // affordances (e.g. close), for installed desktop Progress Web Apps (PWAs),
2619 // if the app specifies the 'window-controls-overlay' DisplayMode in its
2620 // manifest. This is in frame space coordinates.
2621 gfx::Rect window_controls_overlay_rect_;
2622
Sam Davis Omekaradb307cf2024-03-05 00:15:412623 // Observe native theme for changes to dark mode, forced_colors, preferred
2624 // color scheme, and preferred contrast. Used to notify the renderer of
2625 // preferred color scheme and preferred contrast changes.
Sigurdur Asgeirsson103e2fb2020-11-10 00:50:162626 base::ScopedObservation<ui::NativeTheme, ui::NativeThemeObserver>
2627 native_theme_observation_{this};
Alison Maher7f366dc62020-03-03 19:46:002628
Shintaro Kawamura1042d572024-09-30 13:52:222629 base::ScopedObservation<SlowWebPreferenceCache,
2630 SlowWebPreferenceCacheObserver>
2631 slow_web_preference_cache_observation_{this};
2632
Alison Maher7f366dc62020-03-03 19:46:002633 bool using_dark_colors_ = false;
Sam Davis Omekaradb307cf2024-03-05 00:15:412634 bool in_forced_colors_ = false;
Alison Maher7f366dc62020-03-03 19:46:002635 ui::NativeTheme::PreferredColorScheme preferred_color_scheme_ =
Alison Maher60ddf6f2020-06-12 17:30:282636 ui::NativeTheme::PreferredColorScheme::kLight;
Alison Maher3b11e942020-10-27 17:17:502637 ui::NativeTheme::PreferredContrast preferred_contrast_ =
2638 ui::NativeTheme::PreferredContrast::kNoPreference;
Luke Warlowa9952932023-07-18 01:38:142639 bool prefers_reduced_transparency_ = false;
Luke Warlowa93b1ca2023-08-04 10:08:252640 bool inverted_colors_ = false;
Alison Maher7f366dc62020-03-03 19:46:002641
David Bokan1bdb3701f2021-04-30 22:02:352642 // Tracks clients who want to be notified when a JavaScript dialog is
2643 // dismissed.
2644 std::unique_ptr<JavaScriptDialogDismissNotifier>
2645 javascript_dialog_dismiss_notifier_;
Charlie Reis96077362019-07-04 00:34:042646
yilkal172da772019-11-06 22:49:072647 // The max number of loaded frames that have been seen in this WebContents.
2648 // This number is reset with each main frame navigation.
2649 size_t max_loaded_frame_count_ = 0;
yilkal796e89e2019-10-02 23:58:282650
yilkal172da772019-11-06 22:49:072651 // This boolean value is used to keep track of whether we finished the first
Khushal97d31e82021-06-23 21:07:542652 // successful navigation in this WebContents's primary main frame.
2653 bool first_primary_navigation_completed_ = false;
yilkal796e89e2019-10-02 23:58:282654
Mike Wassermanb213b9352020-04-16 00:32:342655 // Monitors system screen info changes to notify the renderer.
2656 std::unique_ptr<ScreenChangeMonitor> screen_change_monitor_;
2657
Mike Wassermandb8f4f02020-10-06 01:18:372658 // Records the last time we saw a screen orientation change.
Lan Weif81c6e7c2020-02-12 16:46:092659 base::TimeTicks last_screen_orientation_change_time_;
2660
Dominique Fauteux-Chapleau99244382020-07-08 20:37:002661 // Indicates how many sources are currently suppressing the unresponsive
2662 // renderer dialog.
2663 int suppress_unresponsive_renderer_count_ = 0;
2664
Aman Verma2e897242025-01-14 12:08:262665 // Stores the force enable zoom state for Accessibility.
2666 bool force_enable_zoom_ = false;
2667
Hiroki Nakagawa9bc09f22021-04-23 09:48:552668 std::unique_ptr<PrerenderHostRegistry> prerender_host_registry_;
Hiroki Nakagawa1cb14552021-04-23 03:37:342669
Kevin McNee097680d2023-04-05 22:14:512670 // Used to ignore multiple back navigation hints in rapid succession. For
2671 // example, we may get multiple hints due to imprecise mouse movement while
2672 // the user is trying to move the mouse to the back button.
2673 base::TimeTicks last_back_navigation_hint_time_ = base::TimeTicks::Min();
2674
Alexander Cooper987d046cc2021-04-14 00:07:212675 viz::FrameSinkId xr_render_target_;
2676
Elad Alonf156eb62021-05-17 22:02:372677 // Allows the app in the current WebContents to opt-in to exposing
2678 // information to apps that capture it.
2679 blink::mojom::CaptureHandleConfig capture_handle_config_;
2680
Bo Liub5e79d92021-06-12 01:40:412681 // Background color of the page set by the embedder to be passed to all
2682 // renderers attached to this WebContents, for use in the main frame.
2683 // It is used when the page has not loaded enough to know a background
2684 // color or if the page does not set a background color.
Arthur Sonzognic686e8f2024-01-11 08:36:372685 std::optional<SkColor> page_base_background_color_;
Bo Liub5e79d92021-06-12 01:40:412686
Nicolas Ouellet-Payeur177a6c42023-01-25 20:25:072687 // Stores WebContents::CreateParams::creator_location.
Lukasz Anforowicz2c1573a2021-09-21 18:58:182688 base::Location creator_location_;
2689
Nicolas Ouellet-Payeur177a6c42023-01-25 20:25:072690#if BUILDFLAG(IS_ANDROID)
2691 // Stores WebContents::CreateParams::java_creator_location.
2692 base::android::ScopedJavaGlobalRef<jthrowable> java_creator_location_;
2693#endif // BUILDFLAG(IS_ANDROID)
2694
Tommy Steimel57eafde2023-01-27 17:33:242695 // The options used for WebContents associated with a PictureInPicture window.
2696 // This value is the parameter given in
2697 // WebContents::CreateParams::picture_in_picture_options.
Arthur Sonzognic686e8f2024-01-11 08:36:372698 std::optional<blink::mojom::PictureInPictureWindowOptions>
Tommy Steimel57eafde2023-01-27 17:33:242699 picture_in_picture_options_;
Tommy Steimel991916c42022-06-24 20:59:572700
Tommy Steimel71f154462024-05-22 19:05:072701 // Only set if this WebContents represents a document picture-in-picture
2702 // window. This points to the WebContents that originally opened this
2703 // WebContents.
2704 base::WeakPtr<WebContents> picture_in_picture_opener_;
2705
Joe Mason1fc3e2e2021-11-02 05:25:072706 VisibleTimeRequestTrigger visible_time_request_trigger_;
2707
Andy Paicu5608bda82023-03-03 15:09:202708 // Counts the number of open scopes that disallow custom cursors in this web
2709 // contents. Custom cursors are allowed if this is 0.
2710 int disallow_custom_cursor_scope_count_ = 0;
2711
Bo Liu3afe2582023-08-11 23:02:562712 base::WeakPtr<FileChooserImpl> active_file_chooser_;
2713
Arthur Sonzognic686e8f2024-01-11 08:36:372714 std::optional<base::Location> ownership_location_;
Bo Liud4ced692023-09-18 21:17:142715
Aman Vermadf974d4d22024-09-30 18:12:492716 // This id is used by Viz to create RenderWidgetHostInputEventRouter per
2717 // WebContents(concept in browser) to allow grouping CompositorFrameSinks for
2718 // input event routing with InputVizard.
Aman Verma7908f9562024-12-13 18:45:482719 const base::UnguessableToken compositor_frame_sink_grouping_id_;
Aman Vermadf974d4d22024-09-30 18:12:492720
Aman Vermaea1fcd02024-11-07 20:04:282721 mojo::Receiver<input::mojom::RenderInputRouterDelegateClient>
2722 rir_delegate_client_receiver_{this};
2723
Kartar Singh9991d6662024-12-11 16:46:242724 mojo::Remote<input::mojom::RenderInputRouterDelegate> rir_delegate_remote_;
2725
Takashi Toyoshima8dfc05c2024-01-29 21:03:512726 // Indicates if the instance is hosted in a preview window.
2727 // This will be set in Init() and will be reset in WillActivatePreviewPage().
2728 bool is_in_preview_mode_ = false;
2729
David Tsengc3853d0b02024-02-15 16:35:102730 // Indicates accessibility had an unrecoverable error.
Aaron Leventhal6ceb5882024-04-17 15:19:382731 bool unrecoverable_accessibility_error_ = false;
David Tsengc3853d0b02024-02-15 16:35:102732
Xiao Ma29b2d1e62024-06-13 06:17:092733 // The network handle bound to the target network, is used to handle the
2734 // loading requests over a specific network. The network handle is set when
2735 // WebContents is created and will not change during the life cycle of
2736 // WebContents.
Jacob Francis0043f242024-07-24 21:46:212737 net::handles::NetworkHandle target_network_ =
2738 net::handles::kInvalidNetworkHandle;
Xiao Ma29b2d1e62024-06-13 06:17:092739
Ari Chivukula41f7bfc92024-07-17 18:16:012740 // Whether this contents represents a window initially opened as a new popup.
2741 bool is_popup_{false};
2742
Ari Chivukula2d8d5e02024-11-04 20:09:572743 // If this window was opened as a new partitioned popin this will contain the
2744 // properties needed to setup partitioning which aligns with the opener.
2745 // See https://explainers-by-googlers.github.io/partitioned-popins/
2746 std::optional<PartitionedPopinOpenerProperties>
2747 partitioned_popin_opener_properties_;
2748
Ari Chivukulae22828e2024-08-17 02:44:062749 // If this window was opened as a new partitioned popin this will be the
Giovanni Ortuno Urquidi94e37f692024-10-31 06:25:152750 // frame of the opener. This will only have a value if `is_popup_` is true.
2751 // If the opener frame is deleted the popin should be closed by
Ari Chivukula2d8d5e02024-11-04 20:09:572752 // `PartitionedPopinsController`. This is not a good indicator of whether this
2753 // window is a popin as it may go away before the popin closes.
Ari Chivukulae22828e2024-08-17 02:44:062754 // See https://explainers-by-googlers.github.io/partitioned-popins/
2755 base::WeakPtr<RenderFrameHostImpl> partitioned_popin_opener_;
Ari Chivukula9390bf12024-08-14 18:08:012756
Ari Chivukulaee503052024-08-30 20:33:532757 // Each window can have at most one open partitioned popin, and this will be a
2758 // pointer to it. If this is set `partitioned_popin_opener_` must be null as
2759 // no popin can open a popin.
2760 // See https://explainers-by-googlers.github.io/partitioned-popins/
Ari Chivukulaee503052024-08-30 20:33:532761 base::WeakPtr<WebContents> opened_partitioned_popin_;
2762
Aldo Culquicondor88fe3962025-01-21 16:04:262763#if BUILDFLAG(IS_ANDROID)
2764 bool supports_forward_transition_animation_ = true;
2765#endif // !BUILDFLAG(IS_ANDROID)
2766
Jeremy Roman3bca4bf2019-07-11 03:41:252767 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_{this};
2768 base::WeakPtrFactory<WebContentsImpl> weak_factory_{this};
[email protected]0dd3a0ab2011-02-18 08:17:442769};
2770
nickf9acfbe2014-12-23 19:12:372771// Dangerous methods which should never be made part of the public API, so we
2772// grant their use only to an explicit friend list (c++ attorney/client idiom).
benwells5e7260d2017-03-20 23:36:332773class CONTENT_EXPORT WebContentsImpl::FriendWrapper {
Avi Drissmana9114822018-03-23 18:25:552774 public:
2775 using CreatedCallback = base::RepeatingCallback<void(WebContents*)>;
2776
Peter Boström9b036532021-10-28 23:37:282777 FriendWrapper(const FriendWrapper&) = delete;
2778 FriendWrapper& operator=(const FriendWrapper&) = delete;
2779
nickf9acfbe2014-12-23 19:12:372780 private:
Elly Fong-Jones564de6262022-07-28 21:11:162781 friend base::CallbackListSubscription RegisterWebContentsCreationCallback(
2782 base::RepeatingCallback<void(WebContents*)>);
nickf9acfbe2014-12-23 19:12:372783
benwells5e7260d2017-03-20 23:36:332784 FriendWrapper(); // Not instantiable.
nickf9acfbe2014-12-23 19:12:372785
Elly Fong-Jones564de6262022-07-28 21:11:162786 // Adds a callback called on creation of each new WebContents.
2787 static base::CallbackListSubscription AddCreatedCallbackForTesting(
2788 const CreatedCallback& callback);
nickf9acfbe2014-12-23 19:12:372789};
2790
[email protected]8ff00d72012-10-23 19:12:212791} // namespace content
2792
[email protected]93ddb3c2012-04-11 21:44:292793#endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_