Browse Source

chore: more iwyu (#43063)

* chore: iwyu shell/browser/electron_pdf_document_helper_client.h

* chore: iwyu shell/browser/hid/electron_hid_delegate.h

* chore: iwyu content/public/browser/web_contents.h

* chore: iwyu shell/browser/usb/electron_usb_delegate.h

* chore: iwyu shell/browser/browser_observer.h

* chore: iwyu shell/browser/bluetooth/electron_bluetooth_delegate.h

* chore: iwyu shell/browser/serial/electron_serial_delegate.h

* chore: iwyu shell/browser/api/frame_subscriber.h

* chore: iwyu mojo/public/cpp/bindings/

* chore: iwyu components/

* chore: iwyu extensions/

* chore: iwyu shell/common/gin_helper/

* chore: iwyu v8/

* chore: iwyu base/containers/linked_list.h

* chore: iwyu shell/browser/native_window.h

* chore: iwyu shell/browser/api/electron_api_base_window.h

* chore: iwyu shell/common/node_includes.h

* chore: iwyu gin/handle.h

* chore: iwyu base/functional/callback.h

* chore: iwyu ui/gfx/

* chore: iwyu content/public/browser/render_frame_host.h

* fix: mac

* fix: mac

* fix: win

* chore: iwyu base/files/file_path.h

* chore: iwyu base/unguessable_token.h

* chore: iwyu ui/display/screen.h

* chore: iwyu chrome/browser/predictors/preconnect_manager.h

* chore: iwyu base/observer_list_types.h

* chore: iwyu content/public/browser/web_contents.h

* chore: iwyu chrome/browser/devtools/devtools_eye_dropper.h

* chore: iwyu shell/browser/ui/inspectable_web_contents.h

* chore: iwyu content/public/browser/keyboard_event_processing_result.h

* chore: iwyu net/cookies/canonical_cookie.h

* chore: iwyu net/base/address_list.h

* chore: iwyu net/cert/x509_certificate.h

* chore: iwyu net/cookies/cookie_change_dispatcher.h

* chore: iwyu net/dns/public/host_resolver_results.h

* fix: mac

* Revert "chore: iwyu net/cert/x509_certificate.h"

This reverts commit 002896f71146e90f1e29e090a1d6eede48cee11e.
Charles Kerr 8 months ago
parent
commit
e70ce89235
100 changed files with 378 additions and 127 deletions
  1. 0 1
      shell/app/electron_content_client.h
  2. 2 0
      shell/browser/api/electron_api_app.cc
  3. 10 4
      shell/browser/api/electron_api_app.h
  4. 1 0
      shell/browser/api/electron_api_auto_updater.cc
  5. 5 1
      shell/browser/api/electron_api_auto_updater.h
  6. 2 0
      shell/browser/api/electron_api_base_window.cc
  7. 14 5
      shell/browser/api/electron_api_base_window.h
  8. 2 0
      shell/browser/api/electron_api_browser_window.cc
  9. 4 1
      shell/browser/api/electron_api_browser_window.h
  10. 3 0
      shell/browser/api/electron_api_cookies.cc
  11. 10 6
      shell/browser/api/electron_api_cookies.h
  12. 1 0
      shell/browser/api/electron_api_data_pipe_holder.cc
  13. 5 1
      shell/browser/api/electron_api_data_pipe_holder.h
  14. 2 0
      shell/browser/api/electron_api_debugger.cc
  15. 7 2
      shell/browser/api/electron_api_debugger.h
  16. 1 0
      shell/browser/api/electron_api_desktop_capturer.cc
  17. 5 1
      shell/browser/api/electron_api_desktop_capturer.h
  18. 3 0
      shell/browser/api/electron_api_dialog.cc
  19. 1 0
      shell/browser/api/electron_api_download_item.cc
  20. 5 1
      shell/browser/api/electron_api_download_item.h
  21. 1 0
      shell/browser/api/electron_api_global_shortcut.cc
  22. 6 2
      shell/browser/api/electron_api_global_shortcut.h
  23. 1 0
      shell/browser/api/electron_api_in_app_purchase.cc
  24. 6 2
      shell/browser/api/electron_api_in_app_purchase.h
  25. 1 0
      shell/browser/api/electron_api_menu.cc
  26. 2 1
      shell/browser/api/electron_api_menu.h
  27. 6 2
      shell/browser/api/electron_api_menu_mac.h
  28. 1 0
      shell/browser/api/electron_api_menu_mac.mm
  29. 1 0
      shell/browser/api/electron_api_menu_views.cc
  30. 0 1
      shell/browser/api/electron_api_menu_views.h
  31. 5 1
      shell/browser/api/electron_api_native_theme.h
  32. 1 0
      shell/browser/api/electron_api_net_log.cc
  33. 9 3
      shell/browser/api/electron_api_net_log.h
  34. 1 0
      shell/browser/api/electron_api_notification.cc
  35. 4 1
      shell/browser/api/electron_api_notification.h
  36. 2 0
      shell/browser/api/electron_api_power_save_blocker.cc
  37. 7 2
      shell/browser/api/electron_api_power_save_blocker.h
  38. 1 0
      shell/browser/api/electron_api_protocol.cc
  39. 2 1
      shell/browser/api/electron_api_protocol.h
  40. 1 0
      shell/browser/api/electron_api_push_notifications.cc
  41. 5 1
      shell/browser/api/electron_api_push_notifications.h
  42. 1 0
      shell/browser/api/electron_api_screen.cc
  43. 4 1
      shell/browser/api/electron_api_screen.h
  44. 5 1
      shell/browser/api/electron_api_service_worker_context.h
  45. 3 0
      shell/browser/api/electron_api_session.cc
  46. 8 8
      shell/browser/api/electron_api_session.h
  47. 2 0
      shell/browser/api/electron_api_system_preferences.cc
  48. 9 3
      shell/browser/api/electron_api_system_preferences.h
  49. 1 0
      shell/browser/api/electron_api_system_preferences_mac.mm
  50. 2 0
      shell/browser/api/electron_api_tray.cc
  51. 9 4
      shell/browser/api/electron_api_tray.h
  52. 5 3
      shell/browser/api/electron_api_utility_process.h
  53. 1 0
      shell/browser/api/electron_api_view.cc
  54. 5 1
      shell/browser/api/electron_api_view.h
  55. 5 1
      shell/browser/api/electron_api_web_contents.cc
  56. 18 14
      shell/browser/api/electron_api_web_contents.h
  57. 1 0
      shell/browser/api/electron_api_web_contents_view.cc
  58. 1 0
      shell/browser/api/electron_api_web_frame_main.cc
  59. 7 4
      shell/browser/api/electron_api_web_frame_main.h
  60. 3 0
      shell/browser/api/electron_api_web_request.cc
  61. 10 3
      shell/browser/api/electron_api_web_request.h
  62. 1 0
      shell/browser/api/frame_subscriber.cc
  63. 7 4
      shell/browser/api/frame_subscriber.h
  64. 1 0
      shell/browser/api/gpuinfo_manager.cc
  65. 5 1
      shell/browser/api/gpuinfo_manager.h
  66. 8 0
      shell/browser/api/message_port.cc
  67. 6 3
      shell/browser/api/message_port.h
  68. 1 1
      shell/browser/api/save_page_handler.h
  69. 1 0
      shell/browser/api/views/electron_api_image_view.cc
  70. 9 1
      shell/browser/api/views/electron_api_image_view.h
  71. 8 0
      shell/browser/browser.cc
  72. 3 5
      shell/browser/browser.h
  73. 1 0
      shell/browser/browser_mac.mm
  74. 1 0
      shell/browser/browser_process_impl.cc
  75. 2 1
      shell/browser/browser_process_impl.h
  76. 1 1
      shell/browser/certificate_manager_model.h
  77. 1 1
      shell/browser/cookie_change_notifier.cc
  78. 5 1
      shell/browser/cookie_change_notifier.h
  79. 5 1
      shell/browser/electron_autofill_driver.h
  80. 4 0
      shell/browser/electron_browser_client.cc
  81. 9 6
      shell/browser/electron_browser_client.h
  82. 4 0
      shell/browser/electron_browser_context.cc
  83. 4 1
      shell/browser/electron_browser_context.h
  84. 1 1
      shell/browser/electron_browser_main_parts.cc
  85. 6 2
      shell/browser/electron_browser_main_parts.h
  86. 1 0
      shell/browser/electron_crypto_module_delegate_nss.cc
  87. 2 0
      shell/browser/electron_download_manager_delegate.cc
  88. 4 1
      shell/browser/electron_download_manager_delegate.h
  89. 1 0
      shell/browser/electron_permission_manager.cc
  90. 11 2
      shell/browser/electron_permission_manager.h
  91. 1 0
      shell/browser/extended_web_contents_observer.h
  92. 0 1
      shell/browser/extensions/electron_extensions_api_client.cc
  93. 7 1
      shell/browser/extensions/electron_extensions_browser_client.h
  94. 1 1
      shell/browser/file_system_access/file_system_access_permission_context.h
  95. 6 2
      shell/browser/hid/hid_chooser_context.h
  96. 2 0
      shell/browser/hid/hid_chooser_controller.cc
  97. 1 2
      shell/browser/hid/hid_chooser_controller.h
  98. 1 1
      shell/browser/lib/power_observer_linux.h
  99. 0 1
      shell/browser/native_window_mac.mm
  100. 0 2
      shell/browser/native_window_views.cc

+ 0 - 1
shell/app/electron_content_client.h

@@ -8,7 +8,6 @@
 #include <string_view>
 #include <vector>
 
-#include "base/files/file_path.h"
 #include "content/public/common/content_client.h"
 
 namespace electron {

+ 2 - 0
shell/browser/api/electron_api_app.cc

@@ -39,6 +39,7 @@
 #include "content/public/browser/network_service_instance.h"
 #include "content/public/browser/render_frame_host.h"
 #include "crypto/crypto_buildflags.h"
+#include "gin/handle.h"
 #include "media/audio/audio_manager.h"
 #include "net/dns/public/dns_over_https_config.h"
 #include "net/dns/public/dns_over_https_server_config.h"
@@ -72,6 +73,7 @@
 #include "shell/common/gin_converters/net_converter.h"
 #include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/language_util.h"
 #include "shell/common/node_includes.h"

+ 10 - 4
shell/browser/api/electron_api_app.h

@@ -17,7 +17,6 @@
 #include "content/public/browser/gpu_data_manager_observer.h"
 #include "content/public/browser/render_process_host.h"
 #include "crypto/crypto_buildflags.h"
-#include "gin/handle.h"
 #include "net/base/completion_once_callback.h"
 #include "net/base/completion_repeating_callback.h"
 #include "net/ssl/client_cert_identity.h"
@@ -25,9 +24,6 @@
 #include "shell/browser/browser_observer.h"
 #include "shell/browser/electron_browser_client.h"
 #include "shell/browser/event_emitter_mixin.h"
-#include "shell/common/gin_helper/dictionary.h"
-#include "shell/common/gin_helper/error_thrower.h"
-#include "shell/common/gin_helper/promise.h"
 
 #if BUILDFLAG(USE_NSS_CERTS)
 #include "shell/browser/certificate_manager_model.h"
@@ -41,6 +37,16 @@ namespace gfx {
 class Image;
 }
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
+namespace gin_helper {
+class Dictionary;
+class ErrorThrower;
+}  // namespace gin_helper
+
 namespace electron {
 
 struct ProcessMetric;

+ 1 - 0
shell/browser/api/electron_api_auto_updater.cc

@@ -5,6 +5,7 @@
 #include "shell/browser/api/electron_api_auto_updater.h"
 
 #include "base/time/time.h"
+#include "gin/handle.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/browser/native_window.h"
 #include "shell/browser/window_list.h"

+ 5 - 1
shell/browser/api/electron_api_auto_updater.h

@@ -7,12 +7,16 @@
 
 #include <string>
 
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/auto_updater.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/browser/window_list_observer.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class AutoUpdater : public gin::Wrappable<AutoUpdater>,

+ 2 - 0
shell/browser/api/electron_api_base_window.cc

@@ -14,10 +14,12 @@
 #include "content/public/common/color_parser.h"
 #include "electron/buildflags/buildflags.h"
 #include "gin/dictionary.h"
+#include "gin/handle.h"
 #include "shell/browser/api/electron_api_menu.h"
 #include "shell/browser/api/electron_api_view.h"
 #include "shell/browser/api/electron_api_web_contents.h"
 #include "shell/browser/javascript_environment.h"
+#include "shell/browser/native_window.h"
 #include "shell/common/color_util.h"
 #include "shell/common/gin_converters/callback_converter.h"
 #include "shell/common/gin_converters/file_path_converter.h"

+ 14 - 5
shell/browser/api/electron_api_base_window.h

@@ -14,14 +14,22 @@
 
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
-#include "gin/handle.h"
-#include "shell/browser/native_window.h"
 #include "shell/browser/native_window_observer.h"
 #include "shell/common/api/electron_api_native_image.h"
-#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/trackable_object.h"
 
-namespace electron::api {
+namespace gin_helper {
+class Arguments;
+class PersistentDictionary;
+template <typename T>
+class Handle;
+}  // namespace gin_helper
+
+namespace electron {
+
+class NativeWindow;
+
+namespace api {
 
 class View;
 
@@ -279,6 +287,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
   base::WeakPtrFactory<BaseWindow> weak_factory_{this};
 };
 
-}  // namespace electron::api
+}  // namespace api
+}  // namespace electron
 
 #endif  // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_

+ 2 - 0
shell/browser/api/electron_api_browser_window.cc

@@ -10,11 +10,13 @@
 #include "content/public/browser/render_view_host.h"
 #include "shell/browser/api/electron_api_web_contents_view.h"
 #include "shell/browser/browser.h"
+#include "shell/browser/native_window.h"
 #include "shell/browser/web_contents_preferences.h"
 #include "shell/browser/window_list.h"
 #include "shell/common/color_util.h"
 #include "shell/common/gin_helper/constructor.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/node_includes.h"
 #include "shell/common/options_switches.h"

+ 4 - 1
shell/browser/api/electron_api_browser_window.h

@@ -11,7 +11,10 @@
 #include "shell/browser/api/electron_api_base_window.h"
 #include "shell/browser/api/electron_api_web_contents.h"
 #include "shell/browser/ui/drag_util.h"
-#include "shell/common/gin_helper/error_thrower.h"
+
+namespace gin_helper {
+class ErrorThrower;
+}  // namespace gin_helper
 
 namespace electron::api {
 

+ 3 - 0
shell/browser/api/electron_api_cookies.cc

@@ -15,8 +15,10 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_partition.h"
 #include "gin/dictionary.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "net/cookies/canonical_cookie.h"
+#include "net/cookies/cookie_change_dispatcher.h"
 #include "net/cookies/cookie_inclusion_status.h"
 #include "net/cookies/cookie_store.h"
 #include "net/cookies/cookie_util.h"
@@ -27,6 +29,7 @@
 #include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/object_template_builder.h"
+#include "shell/common/gin_helper/promise.h"
 
 namespace gin {
 

+ 10 - 6
shell/browser/api/electron_api_cookies.h

@@ -10,16 +10,20 @@
 #include "base/callback_list.h"
 #include "base/memory/raw_ptr.h"
 #include "base/values.h"
-#include "gin/handle.h"
-#include "net/cookies/canonical_cookie.h"
-#include "net/cookies/cookie_change_dispatcher.h"
 #include "shell/browser/event_emitter_mixin.h"
-#include "shell/common/gin_helper/promise.h"
-#include "shell/common/gin_helper/trackable_object.h"
+
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
 
 namespace gin_helper {
 class Dictionary;
-}
+}  // namespace gin_helper
+
+namespace net {
+struct CookieChangeInfo;
+}  // namespace net
 
 namespace electron {
 

+ 1 - 0
shell/browser/api/electron_api_data_pipe_holder.cc

@@ -11,6 +11,7 @@
 #include "base/no_destructor.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/task/sequenced_task_runner.h"
+#include "gin/handle.h"
 #include "mojo/public/cpp/system/data_pipe.h"
 #include "mojo/public/cpp/system/simple_watcher.h"
 #include "net/base/net_errors.h"

+ 5 - 1
shell/browser/api/electron_api_data_pipe_holder.h

@@ -7,12 +7,16 @@
 
 #include <string>
 
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "services/network/public/cpp/data_element.h"
 #include "services/network/public/mojom/data_pipe_getter.mojom.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 // Retains reference to the data pipe.

+ 2 - 0
shell/browser/api/electron_api_debugger.cc

@@ -12,10 +12,12 @@
 #include "base/json/json_writer.h"
 #include "content/public/browser/devtools_agent_host.h"
 #include "content/public/browser/web_contents.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "gin/per_isolate_data.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/common/gin_converters/value_converter.h"
+#include "shell/common/gin_helper/promise.h"
 #include "shell/common/node_includes.h"
 
 using content::DevToolsAgentHost;

+ 7 - 2
shell/browser/api/electron_api_debugger.h

@@ -11,10 +11,8 @@
 #include "base/values.h"
 #include "content/public/browser/devtools_agent_host_client.h"
 #include "content/public/browser/web_contents_observer.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
-#include "shell/common/gin_helper/promise.h"
 
 namespace content {
 class DevToolsAgentHost;
@@ -25,6 +23,13 @@ namespace gin {
 class Arguments;
 }  // namespace gin
 
+namespace gin_helper {
+template <typename T>
+class Handle;
+template <typename T>
+class Promise;
+}  // namespace gin_helper
+
 namespace electron::api {
 
 class Debugger : public gin::Wrappable<Debugger>,

+ 1 - 0
shell/browser/api/electron_api_desktop_capturer.cc

@@ -17,6 +17,7 @@
 #include "chrome/browser/media/webrtc/thumbnail_capturer_mac.h"
 #include "chrome/browser/media/webrtc/window_icon_util.h"
 #include "content/public/browser/desktop_capture.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/common/api/electron_api_native_image.h"

+ 5 - 1
shell/browser/api/electron_api_desktop_capturer.h

@@ -11,10 +11,14 @@
 
 #include "chrome/browser/media/webrtc/desktop_media_list_observer.h"
 #include "chrome/browser/media/webrtc/native_desktop_media_list.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/common/gin_helper/pinnable.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,

+ 3 - 0
shell/browser/api/electron_api_dialog.cc

@@ -17,6 +17,9 @@
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/promise.h"
 #include "shell/common/node_includes.h"
+#include "v8/include/v8-isolate.h"
+#include "v8/include/v8-local-handle.h"
+#include "v8/include/v8-promise.h"
 
 namespace {
 

+ 1 - 0
shell/browser/api/electron_api_download_item.cc

@@ -7,6 +7,7 @@
 #include <memory>
 
 #include "base/strings/utf_string_conversions.h"
+#include "gin/handle.h"
 #include "net/base/filename_util.h"
 #include "shell/browser/electron_browser_main_parts.h"
 #include "shell/common/gin_converters/file_dialog_converter.h"

+ 5 - 1
shell/browser/api/electron_api_download_item.h

@@ -11,7 +11,6 @@
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "components/download/public/common/download_item.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/browser/ui/file_dialog.h"
@@ -19,6 +18,11 @@
 
 class GURL;
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class DownloadItem : public gin::Wrappable<DownloadItem>,

+ 1 - 0
shell/browser/api/electron_api_global_shortcut.cc

@@ -9,6 +9,7 @@
 #include "base/containers/contains.h"
 #include "extensions/common/command.h"
 #include "gin/dictionary.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "shell/browser/api/electron_api_system_preferences.h"
 #include "shell/browser/browser.h"

+ 6 - 2
shell/browser/api/electron_api_global_shortcut.h

@@ -8,12 +8,16 @@
 #include <map>
 #include <vector>
 
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "chrome/browser/extensions/global_shortcut_listener.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "ui/base/accelerators/accelerator.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class GlobalShortcut : private extensions::GlobalShortcutListener::Observer,

+ 1 - 0
shell/browser/api/electron_api_in_app_purchase.cc

@@ -8,6 +8,7 @@
 #include <utility>
 #include <vector>
 
+#include "gin/handle.h"
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/gin_helper/promise.h"

+ 6 - 2
shell/browser/api/electron_api_in_app_purchase.h

@@ -8,13 +8,17 @@
 #include <string>
 #include <vector>
 
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/browser/mac/in_app_purchase.h"
 #include "shell/browser/mac/in_app_purchase_observer.h"
 #include "shell/browser/mac/in_app_purchase_product.h"
-#include "v8/include/v8.h"
+#include "v8/include/v8-forward.h"
+
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
 
 namespace electron::api {
 

+ 1 - 0
shell/browser/api/electron_api_menu.cc

@@ -6,6 +6,7 @@
 
 #include <utility>
 
+#include "shell/browser/api/electron_api_base_window.h"
 #include "shell/browser/api/ui_event.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/browser/native_window.h"

+ 2 - 1
shell/browser/api/electron_api_menu.h

@@ -9,7 +9,6 @@
 #include <string>
 
 #include "base/memory/raw_ptr.h"
-#include "shell/browser/api/electron_api_base_window.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/browser/ui/electron_menu_model.h"
 #include "shell/common/gin_helper/constructible.h"
@@ -21,6 +20,8 @@ class Arguments;
 
 namespace electron::api {
 
+class BaseWindow;
+
 class Menu : public gin::Wrappable<Menu>,
              public gin_helper::EventEmitterMixin<Menu>,
              public gin_helper::Constructible<Menu>,

+ 6 - 2
shell/browser/api/electron_api_menu_mac.h

@@ -11,7 +11,10 @@
 
 #import "shell/browser/ui/cocoa/electron_menu_controller.h"
 
-namespace electron::api {
+namespace electron {
+class NativeWindow;
+
+namespace api {
 
 class MenuMac : public Menu {
  protected:
@@ -48,6 +51,7 @@ class MenuMac : public Menu {
   base::WeakPtrFactory<MenuMac> weak_factory_{this};
 };
 
-}  // namespace electron::api
+}  // namespace api
+}  // namespace electron
 
 #endif  // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_

+ 1 - 0
shell/browser/api/electron_api_menu_mac.mm

@@ -12,6 +12,7 @@
 #include "base/task/current_thread.h"
 #include "base/task/sequenced_task_runner.h"
 #include "content/public/browser/browser_task_traits.h"
+#include "shell/browser/api/electron_api_base_window.h"
 #include "shell/browser/native_window.h"
 #include "shell/common/keyboard_util.h"
 #include "shell/common/node_includes.h"

+ 1 - 0
shell/browser/api/electron_api_menu_views.cc

@@ -7,6 +7,7 @@
 #include <memory>
 #include <utility>
 
+#include "shell/browser/api/electron_api_base_window.h"
 #include "shell/browser/native_window_views.h"
 #include "ui/display/screen.h"
 

+ 0 - 1
shell/browser/api/electron_api_menu_views.h

@@ -10,7 +10,6 @@
 #include "base/containers/flat_map.h"
 #include "base/memory/weak_ptr.h"
 #include "shell/browser/api/electron_api_menu.h"
-#include "ui/display/screen.h"
 #include "ui/views/controls/menu/menu_runner.h"
 
 namespace electron::api {

+ 5 - 1
shell/browser/api/electron_api_native_theme.h

@@ -6,12 +6,16 @@
 #define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_NATIVE_THEME_H_
 
 #include "base/memory/raw_ptr.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/native_theme/native_theme_observer.h"
 
+namespace gin {
+template <typename T>
+class handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class NativeTheme : public gin::Wrappable<NativeTheme>,

+ 1 - 0
shell/browser/api/electron_api_net_log.cc

@@ -15,6 +15,7 @@
 #include "components/net_log/chrome_net_log.h"
 #include "content/public/browser/storage_partition.h"
 #include "electron/electron_version.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "net/log/net_log_capture_mode.h"
 #include "shell/browser/electron_browser_context.h"

+ 9 - 3
shell/browser/api/electron_api_net_log.h

@@ -7,20 +7,26 @@
 
 #include <optional>
 
-#include "base/files/file_path.h"
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/values.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "net/log/net_log_capture_mode.h"
 #include "services/network/public/mojom/net_log.mojom.h"
 #include "shell/common/gin_helper/promise.h"
 
+namespace base {
+class FilePath;
+class TaskRunner;
+}  // namespace base
+
 namespace gin {
 class Arguments;
-}
+
+template <typename T>
+class Handle;
+}  // namespace gin
 
 namespace electron {
 

+ 1 - 0
shell/browser/api/electron_api_notification.cc

@@ -11,6 +11,7 @@
 #include "shell/browser/electron_browser_client.h"
 #include "shell/common/gin_converters/image_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/node_includes.h"
 #include "url/gurl.h"

+ 4 - 1
shell/browser/api/electron_api_notification.h

@@ -16,7 +16,6 @@
 #include "shell/browser/notifications/notification_presenter.h"
 #include "shell/common/gin_helper/cleaned_up_at_exit.h"
 #include "shell/common/gin_helper/constructible.h"
-#include "shell/common/gin_helper/error_thrower.h"
 #include "ui/gfx/image/image.h"
 
 namespace gin {
@@ -25,6 +24,10 @@ template <typename T>
 class Handle;
 }  // namespace gin
 
+namespace gin_helper {
+class ErrorThrower;
+}  // namespace gin_helper
+
 namespace electron::api {
 
 class Notification : public gin::Wrappable<Notification>,

+ 2 - 0
shell/browser/api/electron_api_power_save_blocker.cc

@@ -11,6 +11,8 @@
 #include "content/public/browser/device_service.h"
 #include "gin/dictionary.h"
 #include "gin/function_template.h"
+#include "gin/handle.h"
+#include "gin/object_template_builder.h"
 #include "services/device/public/mojom/wake_lock_provider.mojom.h"
 #include "services/service_manager/public/cpp/connector.h"
 #include "shell/common/node_includes.h"

+ 7 - 2
shell/browser/api/electron_api_power_save_blocker.h

@@ -6,12 +6,17 @@
 #define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_
 
 #include "base/containers/flat_map.h"
-#include "gin/handle.h"
-#include "gin/object_template_builder.h"
 #include "gin/wrappable.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "services/device/public/mojom/wake_lock.mojom.h"
 
+namespace gin {
+class ObjectTemplateBuilder;
+
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {

+ 1 - 0
shell/browser/api/electron_api_protocol.cc

@@ -10,6 +10,7 @@
 #include "base/command_line.h"
 #include "content/common/url_schemes.h"
 #include "content/public/browser/child_process_security_policy.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "shell/browser/browser.h"
 #include "shell/browser/electron_browser_context.h"

+ 2 - 1
shell/browser/api/electron_api_protocol.h

@@ -10,13 +10,14 @@
 
 #include "base/memory/raw_ptr.h"
 #include "content/public/browser/content_browser_client.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/net/electron_url_loader_factory.h"
 #include "shell/common/gin_helper/constructible.h"
 
 namespace gin {
 class Arguments;
+template <typename T>
+class Handle;
 }  // namespace gin
 
 namespace electron {

+ 1 - 0
shell/browser/api/electron_api_push_notifications.cc

@@ -4,6 +4,7 @@
 
 #include "shell/browser/api/electron_api_push_notifications.h"
 
+#include "gin/handle.h"
 #include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/node_includes.h"

+ 5 - 1
shell/browser/api/electron_api_push_notifications.h

@@ -8,13 +8,17 @@
 #include <string>
 
 #include <vector>
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/browser_observer.h"
 #include "shell/browser/electron_browser_client.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/common/gin_helper/promise.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class PushNotifications

+ 1 - 0
shell/browser/api/electron_api_screen.cc

@@ -14,6 +14,7 @@
 #include "shell/common/gin_converters/gfx_converter.h"
 #include "shell/common/gin_converters/native_window_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/node_includes.h"
 #include "ui/display/display.h"

+ 4 - 1
shell/browser/api/electron_api_screen.h

@@ -10,7 +10,6 @@
 #include "base/memory/raw_ptr.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
-#include "shell/common/gin_helper/error_thrower.h"
 #include "ui/display/display_observer.h"
 #include "ui/display/screen.h"
 
@@ -20,6 +19,10 @@ class Rect;
 class Screen;
 }  // namespace gfx
 
+namespace gin_helper {
+class ErrorThrower;
+}  // namespace gin_helper
+
 namespace electron::api {
 
 class Screen : public gin::Wrappable<Screen>,

+ 5 - 1
shell/browser/api/electron_api_service_worker_context.h

@@ -8,10 +8,14 @@
 #include "base/memory/raw_ptr.h"
 #include "content/public/browser/service_worker_context.h"
 #include "content/public/browser/service_worker_context_observer.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron {
 
 class ElectronBrowserContext;

+ 3 - 0
shell/browser/api/electron_api_session.cc

@@ -21,6 +21,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/uuid.h"
 #include "chrome/browser/browser_process.h"
+#include "chrome/browser/predictors/preconnect_manager.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/pref_names.h"
 #include "components/download/public/common/download_danger_type.h"
@@ -41,6 +42,7 @@
 #include "content/public/browser/storage_partition.h"
 #include "gin/arguments.h"
 #include "gin/converter.h"
+#include "gin/handle.h"
 #include "mojo/public/cpp/bindings/pending_remote.h"
 #include "mojo/public/cpp/bindings/self_owned_receiver.h"
 #include "net/base/completion_repeating_callback.h"
@@ -80,6 +82,7 @@
 #include "shell/common/gin_converters/usb_protected_classes_converter.h"
 #include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/gin_helper/promise.h"
 #include "shell/common/node_includes.h"

+ 8 - 8
shell/browser/api/electron_api_session.h

@@ -15,7 +15,6 @@
 #include "base/values.h"
 #include "content/public/browser/download_manager.h"
 #include "electron/buildflags/buildflags.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "services/network/public/mojom/host_resolver.mojom.h"
 #include "services/network/public/mojom/ssl_config.mojom.h"
@@ -23,9 +22,7 @@
 #include "shell/browser/net/resolve_proxy_helper.h"
 #include "shell/common/gin_helper/cleaned_up_at_exit.h"
 #include "shell/common/gin_helper/constructible.h"
-#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/pinnable.h"
-#include "shell/common/gin_helper/promise.h"
 
 #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"  // nogncheck
@@ -42,13 +39,16 @@ namespace base {
 class FilePath;
 }
 
-namespace gin_helper {
-class Dictionary;
-}
-
 namespace gin {
 class Arguments;
-}
+template <typename T>
+class Handle;
+}  // namespace gin
+
+namespace gin_helper {
+class Dictionary;
+class ErrorThrower;
+}  // namespace gin_helper
 
 namespace net {
 class ProxyConfig;

+ 2 - 0
shell/browser/api/electron_api_system_preferences.cc

@@ -4,9 +4,11 @@
 
 #include "shell/browser/api/electron_api_system_preferences.h"
 
+#include "gin/handle.h"
 #include "shell/common/gin_converters/callback_converter.h"
 #include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/node_includes.h"
 #include "ui/gfx/animation/animation.h"
 

+ 9 - 3
shell/browser/api/electron_api_system_preferences.h

@@ -9,11 +9,8 @@
 #include <string>
 
 #include "base/values.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
-#include "shell/common/gin_helper/error_thrower.h"
-#include "shell/common/gin_helper/promise.h"
 
 #if BUILDFLAG(IS_WIN)
 #include "shell/browser/browser.h"
@@ -21,6 +18,15 @@
 #include "ui/gfx/sys_color_change_listener.h"
 #endif
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
+namespace gin_helper {
+class ErrorThrower;
+}  // namespace gin_helper
+
 namespace electron::api {
 
 #if BUILDFLAG(IS_MAC)

+ 1 - 0
shell/browser/api/electron_api_system_preferences_mac.mm

@@ -24,6 +24,7 @@
 #include "shell/common/color_util.h"
 #include "shell/common/gin_converters/gurl_converter.h"
 #include "shell/common/gin_converters/value_converter.h"
+#include "shell/common/gin_helper/promise.h"
 #include "shell/common/node_includes.h"
 #include "shell/common/process_util.h"
 #include "skia/ext/skia_utils_mac.h"

+ 2 - 0
shell/browser/api/electron_api_tray.cc

@@ -9,6 +9,7 @@
 
 #include "base/containers/fixed_flat_map.h"
 #include "gin/dictionary.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "shell/browser/api/electron_api_menu.h"
 #include "shell/browser/api/ui_event.h"
@@ -20,6 +21,7 @@
 #include "shell/common/gin_converters/guid_converter.h"
 #include "shell/common/gin_converters/image_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/node_includes.h"
 
 namespace gin {

+ 9 - 4
shell/browser/api/electron_api_tray.h

@@ -10,7 +10,6 @@
 #include <string>
 #include <vector>
 
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/browser/ui/tray_icon.h"
@@ -18,16 +17,22 @@
 #include "shell/common/gin_converters/guid_converter.h"
 #include "shell/common/gin_helper/cleaned_up_at_exit.h"
 #include "shell/common/gin_helper/constructible.h"
-#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/pinnable.h"
 
 namespace gfx {
 class Image;
-}
+class Image;
+}  // namespace gfx
+
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
 
 namespace gin_helper {
 class Dictionary;
-}
+class ErrorThrower;
+}  // namespace gin_helper
 
 namespace electron::api {
 

+ 5 - 3
shell/browser/api/electron_api_utility_process.h

@@ -15,14 +15,12 @@
 #include "base/process/process_handle.h"
 #include "content/public/browser/service_process_host.h"
 #include "gin/wrappable.h"
-#include "mojo/public/cpp/bindings/connector.h"
 #include "mojo/public/cpp/bindings/message.h"
-#include "mojo/public/cpp/bindings/receiver.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/common/gin_helper/pinnable.h"
 #include "shell/services/node/public/mojom/node_service.mojom.h"
-#include "v8/include/v8.h"
+#include "v8/include/v8-forward.h"
 
 namespace gin {
 class Arguments;
@@ -34,6 +32,10 @@ namespace base {
 class Process;
 }  // namespace base
 
+namespace mojo {
+class Connector;
+}  // namespace mojo
+
 namespace electron::api {
 
 class UtilityProcessWrapper

+ 1 - 0
shell/browser/api/electron_api_view.cc

@@ -12,6 +12,7 @@
 
 #include "ash/style/rounded_rect_cutout_path_builder.h"
 #include "gin/data_object_builder.h"
+#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/common/gin_converters/callback_converter.h"

+ 5 - 1
shell/browser/api/electron_api_view.h

@@ -8,13 +8,17 @@
 #include <optional>
 
 #include "base/memory/raw_ptr.h"
-#include "gin/handle.h"
 #include "shell/common/color_util.h"
 #include "shell/common/gin_helper/event_emitter.h"
 #include "ui/views/view.h"
 #include "ui/views/view_observer.h"
 #include "v8/include/v8-value.h"
 
+namespace gin {
+template <typename T>
+class Handle;
+}  // namespace gin
+
 namespace electron::api {
 
 class View : public gin_helper::EventEmitter<View>,

+ 5 - 1
shell/browser/api/electron_api_web_contents.cc

@@ -26,6 +26,7 @@
 #include "base/threading/scoped_blocking_call.h"
 #include "base/values.h"
 #include "chrome/browser/browser_process.h"
+#include "chrome/browser/devtools/devtools_eye_dropper.h"
 #include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
 #include "chrome/browser/ui/views/eye_dropper/eye_dropper.h"
@@ -48,6 +49,7 @@
 #include "content/public/browser/download_request_utils.h"
 #include "content/public/browser/favicon_status.h"
 #include "content/public/browser/file_select_listener.h"
+#include "content/public/browser/keyboard_event_processing_result.h"
 #include "content/public/browser/navigation_details.h"
 #include "content/public/browser/navigation_entry.h"
 #include "content/public/browser/navigation_handle.h"
@@ -83,6 +85,7 @@
 #include "shell/browser/api/electron_api_debugger.h"
 #include "shell/browser/api/electron_api_session.h"
 #include "shell/browser/api/electron_api_web_frame_main.h"
+#include "shell/browser/api/frame_subscriber.h"
 #include "shell/browser/api/message_port.h"
 #include "shell/browser/browser.h"
 #include "shell/browser/child_web_contents_tracker.h"
@@ -121,7 +124,9 @@
 #include "shell/common/gin_converters/optional_converter.h"
 #include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/object_template_builder.h"
+#include "shell/common/gin_helper/promise.h"
 #include "shell/common/language_util.h"
 #include "shell/common/node_includes.h"
 #include "shell/common/options_switches.h"
@@ -179,7 +184,6 @@
 
 #if BUILDFLAG(ENABLE_PDF_VIEWER)
 #include "components/pdf/browser/pdf_document_helper.h"  // nogncheck
-#include "shell/browser/electron_pdf_document_helper_client.h"
 #endif
 
 #if BUILDFLAG(ENABLE_PLUGINS)

+ 18 - 14
shell/browser/api/electron_api_web_contents.h

@@ -18,42 +18,33 @@
 #include "base/memory/raw_ptr_exclusion.h"
 #include "base/memory/weak_ptr.h"
 #include "base/observer_list.h"
-#include "base/observer_list_types.h"
 #include "base/task/thread_pool.h"
-#include "chrome/browser/devtools/devtools_eye_dropper.h"
 #include "chrome/browser/devtools/devtools_file_system_indexer.h"
 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"  // nogncheck
 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
 #include "content/common/frame.mojom.h"
 #include "content/public/browser/devtools_agent_host.h"
 #include "content/public/browser/javascript_dialog_manager.h"
-#include "content/public/browser/keyboard_event_processing_result.h"
 #include "content/public/browser/render_widget_host.h"
-#include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_delegate.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "electron/buildflags/buildflags.h"
 #include "electron/shell/common/api/api.mojom.h"
 #include "gin/handle.h"
 #include "gin/wrappable.h"
-#include "mojo/public/cpp/bindings/receiver_set.h"
 #include "printing/buildflags/buildflags.h"
-#include "shell/browser/api/frame_subscriber.h"
 #include "shell/browser/api/save_page_handler.h"
 #include "shell/browser/background_throttling_source.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/browser/extended_web_contents_observer.h"
-#include "shell/browser/ui/inspectable_web_contents.h"
 #include "shell/browser/ui/inspectable_web_contents_delegate.h"
 #include "shell/browser/ui/inspectable_web_contents_view_delegate.h"
 #include "shell/common/gin_helper/cleaned_up_at_exit.h"
 #include "shell/common/gin_helper/constructible.h"
-#include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/pinnable.h"
 #include "ui/base/models/image_model.h"
 
 #if BUILDFLAG(ENABLE_PRINTING)
-#include "components/printing/browser/print_to_pdf/pdf_print_result.h"
 #include "shell/browser/printing/print_view_manager_electron.h"
 #endif
 
@@ -70,22 +61,35 @@ struct DeviceEmulationParams;
 // enum class PermissionType;
 }  // namespace blink
 
+namespace content {
+enum class KeyboardEventProcessingResult;
+class WebContents;
+}  // namespace content
+
+namespace gin {
+class Arguments;
+}
+
 namespace gin_helper {
 class Dictionary;
-}
+class ErrorThrower;
+template <typename T>
+class Promise;
+}  // namespace gin_helper
 
 namespace network {
 class ResourceRequestBody;
 }
 
-namespace gin {
-class Arguments;
-}
+namespace print_to_pdf {
+enum class PdfPrintResult;
+}  // namespace print_to_pdf
 
 namespace ui {
 class Cursor;
 }
 
+class DevToolsEyeDropper;
 class SkRegion;
 
 namespace electron {
@@ -94,7 +98,6 @@ class ElectronBrowserContext;
 class InspectableWebContents;
 class WebContentsZoomController;
 class WebViewGuestDelegate;
-class FrameSubscriber;
 class WebDialogHelper;
 class NativeWindow;
 class OffScreenRenderWidgetHostView;
@@ -103,6 +106,7 @@ class OffScreenWebContentsView;
 namespace api {
 
 class BaseWindow;
+class FrameSubscriber;
 
 // Wrapper around the content::WebContents.
 class WebContents : public ExclusiveAccessContext,

+ 1 - 0
shell/browser/api/electron_api_web_contents_view.cc

@@ -9,6 +9,7 @@
 #include "shell/browser/api/electron_api_web_contents.h"
 #include "shell/browser/browser.h"
 #include "shell/browser/native_window.h"
+#include "shell/browser/ui/inspectable_web_contents.h"
 #include "shell/browser/ui/inspectable_web_contents_view.h"
 #include "shell/browser/web_contents_preferences.h"
 #include "shell/common/gin_converters/gfx_converter.h"

+ 1 - 0
shell/browser/api/electron_api_web_frame_main.cc

@@ -15,6 +15,7 @@
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/common/isolated_world_ids.h"
 #include "electron/shell/common/api/api.mojom.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "services/service_manager/public/cpp/interface_provider.h"
 #include "shell/browser/api/message_port.h"

+ 7 - 4
shell/browser/api/electron_api_web_frame_main.h

@@ -12,8 +12,8 @@
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/process/process.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
+#include "mojo/public/cpp/bindings/pending_receiver.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "shell/browser/event_emitter_mixin.h"
 #include "shell/common/gin_helper/constructible.h"
@@ -28,7 +28,10 @@ class RenderFrameHost;
 
 namespace gin {
 class Arguments;
-}
+
+template <typename T>
+class Handle;
+}  // namespace gin
 
 namespace electron::api {
 
@@ -78,8 +81,8 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
   void Destroyed();
 
   // Mark RenderFrameHost as disposed and to no longer access it. This can
-  // happen when the WebFrameMain v8 handle is GC'd or when a FrameTreeNode
-  // is removed.
+  // happen when the WebFrameMain v8-forward.handle is GC'd or when a
+  // FrameTreeNode is removed.
   void MarkRenderFrameDisposed();
 
   // Swap out the internal RFH when cross-origin navigation occurs.

+ 3 - 0
shell/browser/api/electron_api_web_request.cc

@@ -14,9 +14,12 @@
 #include "base/memory/raw_ptr.h"
 #include "base/task/sequenced_task_runner.h"
 #include "base/values.h"
+#include "extensions/browser/api/web_request/web_request_info.h"
 #include "extensions/browser/api/web_request/web_request_resource_type.h"
+#include "extensions/common/url_pattern.h"
 #include "gin/converter.h"
 #include "gin/dictionary.h"
+#include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "net/http/http_content_disposition.h"
 #include "shell/browser/api/electron_api_session.h"

+ 10 - 3
shell/browser/api/electron_api_web_request.h

@@ -9,18 +9,25 @@
 #include <set>
 
 #include "base/memory/raw_ptr.h"
-#include "extensions/common/url_pattern.h"
-#include "gin/handle.h"
 #include "gin/wrappable.h"
 #include "shell/browser/net/web_request_api_interface.h"
 
+class URLPattern;
+
 namespace content {
 class BrowserContext;
 }
 
+namespace extensions {
+enum class WebRequestResourceType : uint8_t;
+}  // namespace extensions
+
 namespace gin {
 class Arguments;
-}
+
+template <typename T>
+class Handle;
+}  // namespace gin
 
 namespace electron::api {
 

+ 1 - 0
shell/browser/api/frame_subscriber.cc

@@ -9,6 +9,7 @@
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host.h"
 #include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/web_contents.h"
 #include "media/capture/mojom/video_capture_buffer.mojom.h"
 #include "media/capture/mojom/video_capture_types.mojom.h"
 #include "mojo/public/cpp/bindings/remote.h"

+ 7 - 4
shell/browser/api/frame_subscriber.h

@@ -8,21 +8,24 @@
 #include <memory>
 #include <string>
 
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "components/viz/host/client_frame_sink_video_capturer.h"
-#include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "media/capture/mojom/video_capture_buffer.mojom-forward.h"
-#include "mojo/public/cpp/bindings/pending_remote.h"
-#include "v8/include/v8.h"
+#include "v8/include/v8-forward.h"
 
 namespace gfx {
 class Image;
 class Rect;
 }  // namespace gfx
 
+namespace mojo {
+template <typename T>
+class PendingRemote;
+}  // namespace mojo
+
 namespace electron::api {
 
 class WebContents;

+ 1 - 0
shell/browser/api/gpuinfo_manager.cc

@@ -11,6 +11,7 @@
 #include "gpu/config/gpu_info_collector.h"
 #include "shell/browser/api/gpu_info_enumerator.h"
 #include "shell/common/gin_converters/value_converter.h"
+#include "shell/common/gin_helper/promise.h"
 #include "shell/common/thread_restrictions.h"
 
 namespace electron {

+ 5 - 1
shell/browser/api/gpuinfo_manager.h

@@ -11,7 +11,11 @@
 #include "content/browser/gpu/gpu_data_manager_impl.h"  // nogncheck
 #include "content/public/browser/gpu_data_manager.h"
 #include "content/public/browser/gpu_data_manager_observer.h"
-#include "shell/common/gin_helper/promise.h"
+
+namespace gin_helper {
+template <typename T>
+class Promise;
+}  // namespace gin_helper
 
 namespace electron {
 

+ 8 - 0
shell/browser/api/message_port.cc

@@ -62,6 +62,14 @@ gin::Handle<MessagePort> MessagePort::Create(v8::Isolate* isolate) {
   return gin::CreateHandle(isolate, new MessagePort());
 }
 
+bool MessagePort::IsEntangled() const {
+  return !closed_ && !IsNeutered();
+}
+
+bool MessagePort::IsNeutered() const {
+  return !connector_ || !connector_->is_valid();
+}
+
 void MessagePort::PostMessage(gin::Arguments* args) {
   if (!IsEntangled())
     return;

+ 6 - 3
shell/browser/api/message_port.h

@@ -9,7 +9,6 @@
 #include <vector>
 
 #include "gin/wrappable.h"
-#include "mojo/public/cpp/bindings/connector.h"
 #include "mojo/public/cpp/bindings/message.h"
 #include "shell/common/gin_helper/cleaned_up_at_exit.h"
 #include "third_party/blink/public/common/messaging/message_port_channel.h"
@@ -21,6 +20,10 @@ template <typename T>
 class Handle;
 }  // namespace gin
 
+namespace mojo {
+class Connector;
+}  // namespace mojo
+
 namespace electron {
 
 // A non-blink version of blink::MessagePort.
@@ -40,8 +43,8 @@ class MessagePort : public gin::Wrappable<MessagePort>,
 
   blink::MessagePortChannel Disentangle();
 
-  bool IsEntangled() const { return !closed_ && !IsNeutered(); }
-  bool IsNeutered() const { return !connector_ || !connector_->is_valid(); }
+  [[nodiscard]] bool IsEntangled() const;
+  [[nodiscard]] bool IsNeutered() const;
 
   static std::vector<gin::Handle<MessagePort>> EntanglePorts(
       v8::Isolate* isolate,

+ 1 - 1
shell/browser/api/save_page_handler.h

@@ -10,7 +10,7 @@
 #include "content/public/browser/download_manager.h"
 #include "content/public/browser/save_page_type.h"
 #include "shell/common/gin_helper/promise.h"
-#include "v8/include/v8.h"
+#include "v8/include/v8-forward.h"
 
 namespace base {
 class FilePath;

+ 1 - 0
shell/browser/api/views/electron_api_image_view.cc

@@ -9,6 +9,7 @@
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/object_template_builder.h"
 #include "shell/common/node_includes.h"
+#include "ui/gfx/image/image.h"
 
 namespace electron::api {
 

+ 9 - 1
shell/browser/api/views/electron_api_image_view.h

@@ -7,9 +7,17 @@
 
 #include "gin/handle.h"
 #include "shell/browser/api/electron_api_view.h"
-#include "ui/gfx/image/image.h"
 #include "ui/views/controls/image_view.h"
 
+namespace gfx {
+class Image;
+}
+
+namespace gin_helper {
+class Arguments;
+class WrappableBase;
+}  // namespace gin_helper
+
 namespace electron::api {
 
 class ImageView : public View {

+ 8 - 0
shell/browser/browser.cc

@@ -59,6 +59,14 @@ Browser::~Browser() {
   WindowList::RemoveObserver(this);
 }
 
+void Browser::AddObserver(BrowserObserver* obs) {
+  observers_.AddObserver(obs);
+}
+
+void Browser::RemoveObserver(BrowserObserver* obs) {
+  observers_.RemoveObserver(obs);
+}
+
 // static
 Browser* Browser::Get() {
   return ElectronBrowserMainParts::Get()->browser();

+ 3 - 5
shell/browser/browser.h

@@ -14,13 +14,11 @@
 #include "base/observer_list.h"
 #include "base/task/cancelable_task_tracker.h"
 #include "base/values.h"
-#include "shell/browser/browser_observer.h"
 #include "shell/browser/window_list_observer.h"
 #include "shell/common/gin_helper/promise.h"
 
 #if BUILDFLAG(IS_WIN)
 #include <windows.h>
-#include "base/files/file_path.h"
 #include "shell/browser/ui/win/taskbar_host.h"
 #endif
 
@@ -40,6 +38,7 @@ class Arguments;
 
 namespace electron {
 
+class BrowserObserver;
 class ElectronMenuModel;
 
 #if BUILDFLAG(IS_WIN)
@@ -314,9 +313,8 @@ class Browser : private WindowListObserver {
   // instance is destroyed.
   void SetMainMessageLoopQuitClosure(base::OnceClosure quit_closure);
 
-  void AddObserver(BrowserObserver* obs) { observers_.AddObserver(obs); }
-
-  void RemoveObserver(BrowserObserver* obs) { observers_.RemoveObserver(obs); }
+  void AddObserver(BrowserObserver* obs);
+  void RemoveObserver(BrowserObserver* obs);
 
 #if BUILDFLAG(IS_MAC)
   // Returns whether secure input is enabled

+ 1 - 0
shell/browser/browser_mac.mm

@@ -20,6 +20,7 @@
 #include "chrome/browser/browser_process.h"
 #include "net/base/apple/url_conversions.h"
 #include "shell/browser/badging/badge_manager.h"
+#include "shell/browser/browser_observer.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/browser/mac/dict_util.h"
 #include "shell/browser/mac/electron_application.h"

+ 1 - 0
shell/browser/browser_process_impl.cc

@@ -21,6 +21,7 @@
 #include "components/prefs/overlay_user_pref_store.h"
 #include "components/prefs/pref_registry.h"
 #include "components/prefs/pref_registry_simple.h"
+#include "components/prefs/pref_service.h"
 #include "components/prefs/pref_service_factory.h"
 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
 #include "components/proxy_config/proxy_config_dictionary.h"

+ 2 - 1
shell/browser/browser_process_impl.h

@@ -15,7 +15,6 @@
 
 #include "chrome/browser/browser_process.h"
 #include "components/embedder_support/origin_trials/origin_trials_settings_storage.h"
-#include "components/prefs/pref_service.h"
 #include "components/prefs/value_map_pref_store.h"
 #include "printing/buildflags/buildflags.h"
 #include "services/network/public/cpp/network_quality_tracker.h"
@@ -26,6 +25,8 @@
 #include "components/os_crypt/sync/key_storage_util_linux.h"
 #endif
 
+class PrefService;
+
 namespace printing {
 class PrintJobManager;
 }

+ 1 - 1
shell/browser/certificate_manager_model.h

@@ -8,7 +8,7 @@
 #include <memory>
 #include <string>
 
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "base/memory/raw_ptr.h"
 #include "net/cert/nss_cert_database.h"
 

+ 1 - 1
shell/browser/cookie_change_notifier.cc

@@ -7,7 +7,7 @@
 #include "base/functional/bind.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_partition.h"
-#include "net/cookies/canonical_cookie.h"
+#include "net/cookies/cookie_change_dispatcher.h"
 #include "shell/browser/electron_browser_context.h"
 
 using content::BrowserThread;

+ 5 - 1
shell/browser/cookie_change_notifier.h

@@ -8,9 +8,13 @@
 #include "base/callback_list.h"
 #include "base/memory/raw_ptr.h"
 #include "mojo/public/cpp/bindings/receiver.h"
-#include "net/cookies/cookie_change_dispatcher.h"
 #include "services/network/public/mojom/cookie_manager.mojom.h"
 
+namespace net {
+class CoookieChangeInfo;
+class CookieChangeNotifier;
+}  // namespace net
+
 namespace electron {
 
 class ElectronBrowserContext;

+ 5 - 1
shell/browser/electron_autofill_driver.h

@@ -14,9 +14,13 @@
 
 #include "base/memory/raw_ptr.h"
 #include "mojo/public/cpp/bindings/associated_receiver.h"
-#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
 #include "shell/common/api/api.mojom.h"
 
+namespace mojo {
+template <typename T>
+class PendingAssociatedReceiver;
+}  // namespace mojo
+
 namespace electron {
 
 class AutofillDriver : public mojom::ElectronAutofillDriver {

+ 4 - 0
shell/browser/electron_browser_client.cc

@@ -16,6 +16,7 @@
 #include "base/command_line.h"
 #include "base/debug/crash_logging.h"
 #include "base/environment.h"
+#include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/no_destructor.h"
 #include "base/path_service.h"
@@ -78,6 +79,7 @@
 #include "shell/browser/api/electron_api_web_contents.h"
 #include "shell/browser/api/electron_api_web_request.h"
 #include "shell/browser/badging/badge_manager.h"
+#include "shell/browser/bluetooth/electron_bluetooth_delegate.h"
 #include "shell/browser/child_web_contents_tracker.h"
 #include "shell/browser/electron_api_ipc_handler_impl.h"
 #include "shell/browser/electron_autofill_driver_factory.h"
@@ -87,6 +89,7 @@
 #include "shell/browser/electron_speech_recognition_manager_delegate.h"
 #include "shell/browser/electron_web_contents_utility_handler_impl.h"
 #include "shell/browser/font_defaults.h"
+#include "shell/browser/hid/electron_hid_delegate.h"
 #include "shell/browser/javascript_environment.h"
 #include "shell/browser/login_handler.h"
 #include "shell/browser/media/media_capture_devices_dispatcher.h"
@@ -103,6 +106,7 @@
 #include "shell/browser/serial/electron_serial_delegate.h"
 #include "shell/browser/session_preferences.h"
 #include "shell/browser/ui/devtools_manager_delegate.h"
+#include "shell/browser/usb/electron_usb_delegate.h"
 #include "shell/browser/web_contents_permission_helper.h"
 #include "shell/browser/web_contents_preferences.h"
 #include "shell/browser/webauthn/electron_authenticator_request_delegate.h"

+ 9 - 6
shell/browser/electron_browser_client.h

@@ -13,7 +13,6 @@
 
 #include "base/containers/flat_map.h"
 #include "base/containers/flat_set.h"
-#include "base/files/file_path.h"
 #include "base/memory/raw_ptr.h"
 #include "base/synchronization/lock.h"
 #include "content/public/browser/content_browser_client.h"
@@ -22,12 +21,12 @@
 #include "electron/buildflags/buildflags.h"
 #include "net/ssl/client_cert_identity.h"
 #include "services/metrics/public/cpp/ukm_source_id.h"
-#include "shell/browser/bluetooth/electron_bluetooth_delegate.h"
-#include "shell/browser/hid/electron_hid_delegate.h"
-#include "shell/browser/serial/electron_serial_delegate.h"
-#include "shell/browser/usb/electron_usb_delegate.h"
 #include "third_party/blink/public/mojom/badging/badging.mojom-forward.h"
 
+namespace base {
+class FilePath;
+}  // namespace base
+
 namespace content {
 class ClientCertificateDelegate;
 class PlatformNotificationService;
@@ -40,10 +39,14 @@ class SSLCertRequestInfo;
 
 namespace electron {
 
+class ElectronBluetoothDelegate;
 class ElectronBrowserMainParts;
+class ElectronHidDelegate;
+class ElectronSerialDelegate;
+class ElectronUsbDelegate;
+class ElectronWebAuthenticationDelegate;
 class NotificationPresenter;
 class PlatformNotificationService;
-class ElectronWebAuthenticationDelegate;
 
 class ElectronBrowserClient : public content::ContentBrowserClient,
                               private content::RenderProcessHostObserver {

+ 4 - 0
shell/browser/electron_browser_context.cc

@@ -18,6 +18,7 @@
 #include "base/strings/escape.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
+#include "chrome/browser/predictors/preconnect_manager.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/pref_names.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -36,6 +37,7 @@
 #include "content/public/browser/shared_cors_origin_access_list.h"
 #include "content/public/browser/storage_partition.h"
 #include "content/public/browser/web_contents_media_capture_id.h"
+#include "gin/arguments.h"
 #include "media/audio/audio_device_description.h"
 #include "services/network/public/cpp/features.h"
 #include "services/network/public/cpp/url_loader_factory_builder.h"
@@ -49,6 +51,7 @@
 #include "shell/browser/file_system_access/file_system_access_permission_context_factory.h"
 #include "shell/browser/net/resolve_proxy_helper.h"
 #include "shell/browser/protocol_registry.h"
+#include "shell/browser/serial/serial_chooser_context.h"
 #include "shell/browser/special_storage_policy.h"
 #include "shell/browser/ui/inspectable_web_contents.h"
 #include "shell/browser/ui/webui/accessibility_ui.h"
@@ -59,6 +62,7 @@
 #include "shell/common/electron_constants.h"
 #include "shell/common/electron_paths.h"
 #include "shell/common/gin_converters/frame_converter.h"
+#include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/options_switches.h"
 #include "shell/common/thread_restrictions.h"

+ 4 - 1
shell/browser/electron_browser_context.h

@@ -15,7 +15,6 @@
 
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "chrome/browser/predictors/preconnect_manager.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/media_stream_request.h"
 #include "content/public/browser/resource_context.h"
@@ -37,6 +36,10 @@ namespace network {
 class SharedURLLoaderFactory;
 }
 
+namespace predictors {
+class PreconnectManager;
+}  // namespace predictors
+
 namespace storage {
 class SpecialStoragePolicy;
 }

+ 1 - 1
shell/browser/electron_browser_main_parts.cc

@@ -67,10 +67,10 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/ui_base_switches.h"
 #include "ui/color/color_provider_manager.h"
+#include "ui/display/screen.h"
 #include "url/url_util.h"
 
 #if defined(USE_AURA)
-#include "ui/display/screen.h"
 #include "ui/views/widget/desktop_aura/desktop_screen.h"
 #include "ui/wm/core/wm_state.h"
 #endif

+ 6 - 2
shell/browser/electron_browser_main_parts.h

@@ -9,14 +9,13 @@
 #include <optional>
 #include <string>
 
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "base/task/single_thread_task_runner.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/browser_main_parts.h"
 #include "electron/buildflags/buildflags.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "services/device/public/mojom/geolocation_control.mojom.h"
-#include "ui/display/screen.h"
 #include "ui/views/layout/layout_provider.h"
 
 class BrowserProcessImpl;
@@ -26,6 +25,11 @@ namespace base {
 class FieldTrialList;
 }
 
+namespace display {
+class Screen;
+class ScopedNativeScreen;
+}  // namespace display
+
 #if defined(USE_AURA)
 namespace wm {
 class WMState;

+ 1 - 0
shell/browser/electron_crypto_module_delegate_nss.cc

@@ -9,6 +9,7 @@
 #include "shell/browser/javascript_environment.h"
 #include "shell/common/gin_converters/callback_converter.h"
 #include "shell/common/gin_helper/callback.h"
+#include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/v8_value_serializer.h"
 
 ElectronNSSCryptoModuleDelegate::ElectronNSSCryptoModuleDelegate(

+ 2 - 0
shell/browser/electron_download_manager_delegate.cc

@@ -29,6 +29,8 @@
 #include "shell/browser/web_contents_preferences.h"
 #include "shell/common/gin_converters/callback_converter.h"
 #include "shell/common/gin_converters/file_path_converter.h"
+#include "shell/common/gin_helper/dictionary.h"
+#include "shell/common/gin_helper/promise.h"
 #include "shell/common/options_switches.h"
 #include "shell/common/thread_restrictions.h"
 

+ 4 - 1
shell/browser/electron_download_manager_delegate.h

@@ -9,12 +9,15 @@
 #include "base/memory/weak_ptr.h"
 #include "content/public/browser/download_manager_delegate.h"
 #include "shell/browser/ui/file_dialog.h"
-#include "shell/common/gin_helper/dictionary.h"
 
 namespace content {
 class DownloadManager;
 }
 
+namespace gin_helper {
+class Dictionary;
+}
+
 namespace electron {
 
 class ElectronDownloadManagerDelegate

+ 1 - 0
shell/browser/electron_permission_manager.cc

@@ -27,6 +27,7 @@
 #include "shell/common/gin_converters/frame_converter.h"
 #include "shell/common/gin_converters/usb_protected_classes_converter.h"
 #include "shell/common/gin_converters/value_converter.h"
+#include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/event_emitter_caller.h"
 #include "third_party/blink/public/common/permissions/permission_utils.h"
 

+ 11 - 2
shell/browser/electron_permission_manager.h

@@ -9,15 +9,24 @@
 #include <vector>
 
 #include "base/containers/id_map.h"
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "base/values.h"
 #include "content/public/browser/permission_controller_delegate.h"
-#include "shell/common/gin_helper/dictionary.h"
 
 namespace content {
 class WebContents;
 }
 
+namespace gin_helper {
+class Dictionary;
+}  // namespace gin_helper
+
+namespace v8 {
+class Object;
+template <typename T>
+class Local;
+}  // namespace v8
+
 namespace electron {
 
 class ElectronBrowserContext;

+ 1 - 0
shell/browser/extended_web_contents_observer.h

@@ -7,6 +7,7 @@
 
 #include <string>
 
+#include "base/observer_list_types.h"
 #include "electron/shell/common/api/api.mojom.h"
 
 namespace gfx {

+ 0 - 1
shell/browser/extensions/electron_extensions_api_client.cc

@@ -24,7 +24,6 @@
 
 #if BUILDFLAG(ENABLE_PDF_VIEWER)
 #include "components/pdf/browser/pdf_document_helper.h"  // nogncheck
-#include "shell/browser/electron_pdf_document_helper_client.h"
 #endif
 
 namespace extensions {

+ 7 - 1
shell/browser/extensions/electron_extensions_browser_client.h

@@ -11,7 +11,6 @@
 
 #include "extensions/browser/extensions_browser_client.h"
 #include "extensions/browser/kiosk/kiosk_delegate.h"
-#include "mojo/public/cpp/bindings/pending_remote.h"
 #include "services/network/public/cpp/resource_request.h"
 #include "services/network/public/mojom/fetch_api.mojom.h"
 #include "url/origin.h"
@@ -27,6 +26,13 @@ class ProcessMap;
 class ElectronComponentExtensionResourceManager;
 }  // namespace extensions
 
+namespace mojo {
+template <typename T>
+class PendingReceiver;
+template <typename T>
+class PendingRemote;
+}  // namespace mojo
+
 namespace electron {
 
 // An ExtensionsBrowserClient that supports a single content::BrowserContext

+ 1 - 1
shell/browser/file_system_access/file_system_access_permission_context.h

@@ -11,7 +11,7 @@
 #include <string>
 #include <vector>
 
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "base/memory/weak_ptr.h"
 #include "base/time/clock.h"
 #include "base/time/default_clock.h"

+ 6 - 2
shell/browser/hid/hid_chooser_context.h

@@ -14,11 +14,10 @@
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/observer_list.h"
+#include "base/observer_list_types.h"
 #include "base/scoped_observation_traits.h"
-#include "base/unguessable_token.h"
 #include "components/keyed_service/core/keyed_service.h"
 #include "mojo/public/cpp/bindings/associated_receiver.h"
-#include "mojo/public/cpp/bindings/pending_remote.h"
 #include "mojo/public/cpp/bindings/remote.h"
 #include "services/device/public/mojom/hid.mojom.h"
 #include "url/origin.h"
@@ -27,6 +26,11 @@ namespace base {
 class Value;
 }
 
+namespace mojo {
+template <typename T>
+class PendingRemote;
+}  // namespace mojo
+
 namespace electron {
 
 class ElectronBrowserContext;

+ 2 - 0
shell/browser/hid/hid_chooser_controller.cc

@@ -10,10 +10,12 @@
 #include "base/containers/contains.h"
 #include "base/functional/bind.h"
 #include "base/ranges/algorithm.h"
+#include "content/public/browser/web_contents.h"
 #include "gin/data_object_builder.h"
 #include "services/device/public/cpp/hid/hid_blocklist.h"
 #include "services/device/public/cpp/hid/hid_switches.h"
 #include "shell/browser/api/electron_api_session.h"
+#include "shell/browser/hid/electron_hid_delegate.h"
 #include "shell/browser/hid/hid_chooser_context.h"
 #include "shell/browser/hid/hid_chooser_context_factory.h"
 #include "shell/browser/javascript_environment.h"

+ 1 - 2
shell/browser/hid/hid_chooser_controller.h

@@ -14,10 +14,8 @@
 #include "content/public/browser/global_routing_id.h"
 #include "content/public/browser/hid_chooser.h"
 #include "content/public/browser/weak_document_ptr.h"
-#include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "services/device/public/mojom/hid.mojom-forward.h"
-#include "shell/browser/hid/electron_hid_delegate.h"
 #include "shell/browser/hid/hid_chooser_context.h"
 #include "shell/common/gin_converters/frame_converter.h"
 #include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
@@ -25,6 +23,7 @@
 
 namespace content {
 class RenderFrameHost;
+class WebContents;
 }  // namespace content
 
 namespace gin {

+ 1 - 1
shell/browser/lib/power_observer_linux.h

@@ -7,7 +7,7 @@
 
 #include <string>
 
-#include "base/functional/callback.h"
+#include "base/functional/callback_forward.h"
 #include "base/memory/raw_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/power_monitor/power_observer.h"

+ 0 - 1
shell/browser/native_window_mac.mm

@@ -33,7 +33,6 @@
 #include "shell/browser/ui/cocoa/root_view_mac.h"
 #include "shell/browser/ui/cocoa/window_buttons_proxy.h"
 #include "shell/browser/ui/drag_util.h"
-#include "shell/browser/ui/inspectable_web_contents.h"
 #include "shell/browser/window_list.h"
 #include "shell/common/gin_converters/gfx_converter.h"
 #include "shell/common/gin_helper/dictionary.h"

+ 0 - 2
shell/browser/native_window_views.cc

@@ -26,8 +26,6 @@
 #include "content/public/browser/desktop_media_id.h"
 #include "content/public/common/color_parser.h"
 #include "shell/browser/api/electron_api_web_contents.h"
-#include "shell/browser/ui/inspectable_web_contents.h"
-#include "shell/browser/ui/views/inspectable_web_contents_view_views.h"
 #include "shell/browser/ui/views/root_view.h"
 #include "shell/browser/web_contents_preferences.h"
 #include "shell/browser/web_view_manager.h"

Some files were not shown because too many files changed in this diff