diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 744ac993c..dfe19a5b1 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/131.0.6778.0' + 'chromium_checkout': 'refs/tags/132.0.6834.0' } diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index 2b8d04db2..826c78c2f 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -24,7 +24,7 @@ #include "content/public/browser/render_widget_host_view.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" -#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h" +#include "third_party/blink/public/mojom/input/focus_type.mojom.h" #include "third_party/blink/public/mojom/page/draggable_region.mojom.h" #include "third_party/blink/public/mojom/widget/platform_widget.mojom-test-utils.h" @@ -621,7 +621,7 @@ void CefBrowserContentsDelegate::OnWebContentsFocused( void CefBrowserContentsDelegate::OnFocusChangedInPage( content::FocusedNodeDetails* details) { focus_on_editable_field_ = - details->focus_type != blink::mojom::blink::FocusType::kNone && + details->focus_type != blink::mojom::FocusType::kNone && details->is_editable_node; } diff --git a/libcef/browser/image_impl.cc b/libcef/browser/image_impl.cc index 576db681a..047aa3910 100644 --- a/libcef/browser/image_impl.cc +++ b/libcef/browser/image_impl.cc @@ -47,9 +47,8 @@ SkAlphaType GetSkAlphaType(cef_alpha_type_t alpha_type) { } // Compress as PNG. Requires post-multiplied alpha. -bool PNGMethod(bool with_transparency, - const SkBitmap& bitmap, - std::vector* compressed) { +std::optional> PNGMethod(bool with_transparency, + const SkBitmap& bitmap) { return gfx::PNGCodec::Encode( reinterpret_cast(bitmap.getPixels()), bitmap.colorType() == kBGRA_8888_SkColorType ? gfx::PNGCodec::FORMAT_BGRA @@ -57,15 +56,14 @@ bool PNGMethod(bool with_transparency, gfx::Size(bitmap.width(), bitmap.height()), static_cast(bitmap.rowBytes()), bitmap.alphaType() == kOpaque_SkAlphaType || !with_transparency, - std::vector(), compressed); + std::vector()); } // Compress as JPEG. This internally uses JCS_EXT_RGBX or JCS_EXT_BGRX which // causes the alpha channel to be ignored. Requires post-multiplied alpha. -bool JPEGMethod(int quality, - const SkBitmap& bitmap, - std::vector* compressed) { - return gfx::JPEGCodec::Encode(bitmap, quality, compressed); +std::optional> JPEGMethod(int quality, + const SkBitmap& bitmap) { + return gfx::JPEGCodec::Encode(bitmap, quality); } } // namespace @@ -132,9 +130,9 @@ bool CefImageImpl::AddBitmap(float scale_factor, bool CefImageImpl::AddPNG(float scale_factor, const void* png_data, size_t png_data_size) { - SkBitmap bitmap; - if (!gfx::PNGCodec::Decode(static_cast(png_data), - png_data_size, &bitmap)) { + const SkBitmap& bitmap = gfx::PNGCodec::Decode( + base::span(static_cast(png_data), png_data_size)); + if (bitmap.isNull()) { return false; } @@ -144,13 +142,13 @@ bool CefImageImpl::AddPNG(float scale_factor, bool CefImageImpl::AddJPEG(float scale_factor, const void* jpeg_data, size_t jpeg_data_size) { - std::unique_ptr bitmap(gfx::JPEGCodec::Decode( - static_cast(jpeg_data), jpeg_data_size)); - if (!bitmap.get()) { + const SkBitmap& bitmap = gfx::JPEGCodec::Decode( + base::span(static_cast(jpeg_data), jpeg_data_size)); + if (bitmap.isNull()) { return false; } - return AddBitmap(scale_factor, *bitmap); + return AddBitmap(scale_factor, bitmap); } size_t CefImageImpl::GetWidth() { @@ -243,10 +241,11 @@ CefRefPtr CefImageImpl::GetAsPNG(float scale_factor, return nullptr; } - std::vector compressed; - if (!WritePNG(*bitmap, &compressed, with_transparency)) { + const auto& result = WritePNG(*bitmap, with_transparency); + if (!result.has_value()) { return nullptr; } + const auto& compressed = *result; pixel_width = bitmap->width(); pixel_height = bitmap->height(); @@ -264,10 +263,11 @@ CefRefPtr CefImageImpl::GetAsJPEG(float scale_factor, return nullptr; } - std::vector compressed; - if (!WriteJPEG(*bitmap, &compressed, quality)) { + const auto& result = WriteJPEG(*bitmap, quality); + if (!result.has_value()) { return nullptr; } + const auto& compressed = *result; pixel_width = bitmap->width(); pixel_height = bitmap->height(); @@ -385,16 +385,16 @@ bool CefImageImpl::ConvertBitmap(const SkBitmap& src_bitmap, } // static -bool CefImageImpl::WriteCompressedFormat(const SkBitmap& bitmap, - std::vector* compressed, - CompressionMethod method) { +std::optional> CefImageImpl::WriteCompressedFormat( + const SkBitmap& bitmap, + CompressionMethod method) { const SkBitmap* bitmap_ptr = nullptr; SkBitmap bitmap_postalpha; if (bitmap.alphaType() == kPremul_SkAlphaType) { // Compression methods require post-multiplied alpha values. if (!ConvertBitmap(bitmap, &bitmap_postalpha, bitmap.colorType(), kUnpremul_SkAlphaType)) { - return false; + return std::nullopt; } bitmap_ptr = &bitmap_postalpha; } else { @@ -407,21 +407,20 @@ bool CefImageImpl::WriteCompressedFormat(const SkBitmap& bitmap, DCHECK(bitmap_ptr->alphaType() == kOpaque_SkAlphaType || bitmap_ptr->alphaType() == kUnpremul_SkAlphaType); - return std::move(method).Run(*bitmap_ptr, compressed); + return std::move(method).Run(*bitmap_ptr); } // static -bool CefImageImpl::WritePNG(const SkBitmap& bitmap, - std::vector* compressed, - bool with_transparency) { - return WriteCompressedFormat(bitmap, compressed, +std::optional> CefImageImpl::WritePNG( + const SkBitmap& bitmap, + bool with_transparency) { + return WriteCompressedFormat(bitmap, base::BindOnce(PNGMethod, with_transparency)); } // static -bool CefImageImpl::WriteJPEG(const SkBitmap& bitmap, - std::vector* compressed, - int quality) { - return WriteCompressedFormat(bitmap, compressed, - base::BindOnce(JPEGMethod, quality)); +std::optional> CefImageImpl::WriteJPEG( + const SkBitmap& bitmap, + int quality) { + return WriteCompressedFormat(bitmap, base::BindOnce(JPEGMethod, quality)); } diff --git a/libcef/browser/image_impl.h b/libcef/browser/image_impl.h index 17de21437..b0509ce42 100644 --- a/libcef/browser/image_impl.h +++ b/libcef/browser/image_impl.h @@ -6,6 +6,9 @@ #define CEF_LIBCEF_BROWSER_IMAGE_IMPL_H_ #pragma once +#include +#include + #include "cef/include/cef_image.h" #include "cef/libcef/browser/thread_util.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -96,26 +99,26 @@ class CefImageImpl : public CefImage { SkAlphaType target_at); // The |bitmap| argument will be RGBA or BGRA and either opaque or transparent - // with post-multiplied alpha. Writes the compressed output into |compressed|. + // with post-multiplied alpha. Returns the compressed output or std::nullopt. using CompressionMethod = - base::OnceCallback* /*compressed*/)>; + base::OnceCallback>( + const SkBitmap& /*bitmap*/)>; - // Write |bitmap| into |compressed| using |method|. - static bool WriteCompressedFormat(const SkBitmap& bitmap, - std::vector* compressed, - CompressionMethod method); + // Write |bitmap| using |method|. Returns the compressed output or + // std::nullopt. + static std::optional> WriteCompressedFormat( + const SkBitmap& bitmap, + CompressionMethod method); - // Write |bitmap| into |compressed| using PNG encoding. - static bool WritePNG(const SkBitmap& bitmap, - std::vector* compressed, - bool with_transparency); + // Write |bitmap|using PNG encoding. Returns the compressed output or + // std::nullopt. + static std::optional> WritePNG(const SkBitmap& bitmap, + bool with_transparency); - // Write |bitmap| into |compressed| using JPEG encoding. The alpha channel - // will be ignored. - static bool WriteJPEG(const SkBitmap& bitmap, - std::vector* compressed, - int quality); + // Write |bitmap| using JPEG encoding. The alpha channel will be ignored. + // Returns the compressed output or std::nullopt. + static std::optional> WriteJPEG(const SkBitmap& bitmap, + int quality); mutable base::Lock lock_; diff --git a/libcef/browser/native/menu_runner_mac.mm b/libcef/browser/native/menu_runner_mac.mm index 00623a009..323fd6166 100644 --- a/libcef/browser/native/menu_runner_mac.mm +++ b/libcef/browser/native/menu_runner_mac.mm @@ -7,8 +7,8 @@ #import "base/mac/scoped_sending_event.h" #include "base/task/current_thread.h" #include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" -#import "ui/base/cocoa/menu_controller.h" #include "ui/gfx/geometry/point.h" +#import "ui/menus/cocoa/menu_controller.h" CefMenuRunnerMac::CefMenuRunnerMac() {} diff --git a/libcef/browser/native/menu_runner_views_aura.cc b/libcef/browser/native/menu_runner_views_aura.cc index 8a8944973..7f18a011c 100644 --- a/libcef/browser/native/menu_runner_views_aura.cc +++ b/libcef/browser/native/menu_runner_views_aura.cc @@ -8,6 +8,7 @@ #include "base/strings/string_util.h" #include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" +#include "ui/base/mojom/menu_source_type.mojom.h" #include "ui/gfx/geometry/point.h" CefMenuRunnerViewsAura::CefMenuRunnerViewsAura() = default; @@ -35,7 +36,8 @@ bool CefMenuRunnerViewsAura::RunContextMenu( gfx::Point(params.x, params.y), /*want_dip_coords=*/true); menu_->RunMenuAt(widget, nullptr, gfx::Rect(screen_point, gfx::Size()), - views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE, + views::MenuAnchorPosition::kTopRight, + ui::mojom::MenuSourceType::kNone, /*native_view_for_gestures=*/nullptr, parent_widget); return true; diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index 7b88f9f72..09b3fe4d8 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -43,11 +43,10 @@ const void* const kResourceContextUserDataKey = &kResourceContextUserDataKey; std::optional GetHeaderString( const net::HttpResponseHeaders* headers, const std::string& header_name) { - std::string header_value; - if (!headers || !headers->GetNormalizedHeader(header_name, &header_value)) { - return std::nullopt; + if (headers) { + return headers->GetNormalizedHeader(header_name); } - return header_value; + return std::nullopt; } void CreateProxyHelper( diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 11b63c2f0..e9338937b 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -24,6 +24,7 @@ #include "cef/libcef/browser/thread_util.h" #include "components/input/cursor_manager.h" #include "components/input/render_widget_host_input_event_router.h" +#include "components/input/switches.h" #include "components/viz/common/features.h" #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/frame_sinks/copy_output_request.h" @@ -38,7 +39,6 @@ #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/common/content_switches_internal.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/context_factory.h" @@ -210,7 +210,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( render_widget_host_(content::RenderWidgetHostImpl::From(widget)), has_parent_(parent_host_view != nullptr), parent_host_view_(parent_host_view), - pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), + pinch_zoom_enabled_(input::switches::IsPinchToZoomEnabled()), mouse_wheel_phase_handler_(this), gesture_provider_(CreateGestureProviderConfig(), this), weak_ptr_factory_(this) { diff --git a/libcef/browser/osr/touch_selection_controller_client_osr.cc b/libcef/browser/osr/touch_selection_controller_client_osr.cc index 424587805..df797a612 100644 --- a/libcef/browser/osr/touch_selection_controller_client_osr.cc +++ b/libcef/browser/osr/touch_selection_controller_client_osr.cc @@ -17,9 +17,10 @@ #include "content/public/browser/render_view_host.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/data_transfer_policy/data_transfer_endpoint.h" -#include "ui/base/pointer/touch_editing_controller.h" +#include "ui/base/mojom/menu_source_type.mojom-forward.h" #include "ui/gfx/geometry/point_conversions.h" #include "ui/gfx/geometry/size_conversions.h" +#include "ui/touch_selection/touch_editing_controller.h" namespace { @@ -146,8 +147,8 @@ void CefTouchSelectionControllerClientOSR::OnScrollCompleted() { bool CefTouchSelectionControllerClientOSR::HandleContextMenu( const content::ContextMenuParams& params) { - if ((params.source_type == ui::MENU_SOURCE_LONG_PRESS || - params.source_type == ui::MENU_SOURCE_LONG_TAP) && + if ((params.source_type == ui::mojom::MenuSourceType::kLongPress || + params.source_type == ui::mojom::MenuSourceType::kLongTap) && params.is_editable && params.selection_text.empty() && IsQuickMenuAvailable()) { quick_menu_requested_ = true; @@ -155,9 +156,10 @@ bool CefTouchSelectionControllerClientOSR::HandleContextMenu( return true; } - const bool from_touch = params.source_type == ui::MENU_SOURCE_LONG_PRESS || - params.source_type == ui::MENU_SOURCE_LONG_TAP || - params.source_type == ui::MENU_SOURCE_TOUCH; + const bool from_touch = + params.source_type == ui::mojom::MenuSourceType::kLongPress || + params.source_type == ui::mojom::MenuSourceType::kLongTap || + params.source_type == ui::mojom::MenuSourceType::kTouch; if (from_touch && !params.selection_text.empty()) { return true; } @@ -530,8 +532,9 @@ void CefTouchSelectionControllerClientOSR::RunContextMenu() { rwhv_->selection_controller()->GetVisibleRectBetweenBounds(); const gfx::PointF anchor_point = gfx::PointF(anchor_rect.CenterPoint().x(), anchor_rect.y()); - rwhv_->host()->ShowContextMenuAtPoint(gfx::ToRoundedPoint(anchor_point), - ui::MENU_SOURCE_TOUCH_EDIT_MENU); + rwhv_->host()->ShowContextMenuAtPoint( + gfx::ToRoundedPoint(anchor_point), + ui::mojom::MenuSourceType::kTouchEditMenu); // Hide selection handles after getting rect-between-bounds from touch // selection controller; otherwise, rect would be empty and the above diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index 458e8143a..a15854369 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -65,6 +65,7 @@ class CefWebContentsViewOSR : public content::WebContentsView, GetBackForwardTransitionAnimationManager() override { return nullptr; } + void DestroyBackForwardTransitionAnimationManager() override {} #if BUILDFLAG(IS_MAC) bool CloseTabAfterEventTrackingIfNeeded() override { return false; } diff --git a/libcef/browser/simple_menu_model_impl.h b/libcef/browser/simple_menu_model_impl.h index 71e4ac200..9332f7524 100644 --- a/libcef/browser/simple_menu_model_impl.h +++ b/libcef/browser/simple_menu_model_impl.h @@ -13,7 +13,7 @@ #include "base/memory/raw_ptr.h" #include "base/threading/platform_thread.h" #include "cef/include/cef_menu_model.h" -#include "ui/base/models/simple_menu_model.h" +#include "ui/menus/simple_menu_model.h" // Implementation of CefMenuModel that wraps an existing ui::SimpleMenuModel. class CefSimpleMenuModelImpl : public CefMenuModel { diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index 40e236030..5df3bc057 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -18,6 +18,7 @@ #include "cef/libcef/browser/views/widget.h" #include "cef/libcef/browser/views/window_view.h" #include "components/constrained_window/constrained_window_views.h" +#include "ui/base/mojom/menu_source_type.mojom.h" #include "ui/base/test/ui_controls.h" #include "ui/compositor/compositor.h" #include "ui/gfx/geometry/rect.h" @@ -554,7 +555,7 @@ void CefWindowImpl::ShowMenu(views::MenuButton* menu_button, widget_, menu_button ? menu_button->button_controller() : nullptr, gfx::Rect(gfx::Point(screen_point.x, screen_point.y), gfx::Size()), static_cast(anchor_position), - ui::MENU_SOURCE_NONE); + ui::mojom::MenuSourceType::kNone); } void CefWindowImpl::MenuClosed() { diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index c2acbddeb..cd7486202 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -24,6 +24,11 @@ gfx::Image CefResourceBundleDelegate::GetNativeImageNamed(int resource_id) { return gfx::Image(); } +bool CefResourceBundleDelegate::HasDataResource(int resource_id) const { + // This has no impact on the loading of resources in ResourceBundle. + return false; +} + base::RefCountedMemory* CefResourceBundleDelegate::LoadDataResourceBytes( int resource_id, ui::ResourceScaleFactor scale_factor) { diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index e0822cfb9..33a55f84f 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -26,6 +26,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { const std::string& locale) override; gfx::Image GetImageNamed(int resource_id) override; gfx::Image GetNativeImageNamed(int resource_id) override; + bool HasDataResource(int resource_id) const override; base::RefCountedMemory* LoadDataResourceBytes( int resource_id, ui::ResourceScaleFactor scale_factor) override; diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index dec0b1ae9..f039bfbb6 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -34,8 +34,6 @@ #include "cef/libcef/renderer/thread_util.h" #include "cef/libcef/renderer/v8_impl.h" #include "content/renderer/render_frame_impl.h" -#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h" -#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h" #include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h" #include "third_party/blink/public/platform/web_data.h" #include "third_party/blink/public/platform/web_string.h" diff --git a/patch/patch.cfg b/patch/patch.cfg index 1fd69b908..220446549 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -546,14 +546,6 @@ patches = [ # https://github.com/chromiumembedded/cef/issues/3105 'name': 'browser_security_policy_1081397', }, - { - # Fix build errors with enable_background_mode=false. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1100085 - # - # Changes to support the Chrome runtime in CEF (app_controller_mac.mm). - # https://github.com/chromiumembedded/cef/issues/2969 - 'name': 'chrome_browser_background_mode_1100085', - }, { # Linux: Fix ATK assertion error when generating ARM build config. # https://bugs.chromium.org/p/chromium/issues/detail?id=1123214 @@ -743,5 +735,16 @@ patches = [ # linux: Fix cannot allocate memory in static TLS block in dlopen libcef.so # https://github.com/chromiumembedded/cef/issues/3616 'name': 'third_party_sentencepiece_3616' + }, + { + # linux: Fix error: invalid operands to binary expression. + 'name': 'ui_base_x11_util' + }, + { + # Add v8_used_in_shared_library GN arg to configure the + # V8_TLS_USED_IN_LIBRARY define. + # https://issues.chromium.org/issues/336738728 + 'name': 'v8_build', + 'path': 'v8' } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index afcbf7efb..2a817812b 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,8 +1,8 @@ diff --git base/BUILD.gn base/BUILD.gn -index 4c0e4645f64e3..4ace56138209d 100644 +index 5dee8a9226d24..a8215969e3494 100644 --- base/BUILD.gn +++ base/BUILD.gn -@@ -41,6 +41,7 @@ import("//build/nocompile.gni") +@@ -43,6 +43,7 @@ import("//build/rust/rust_static_library.gni") import("//build/timestamp.gni") import("//build/util/process_version.gni") import("//build_overrides/build.gni") @@ -10,7 +10,7 @@ index 4c0e4645f64e3..4ace56138209d 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") -@@ -1503,7 +1504,11 @@ component("base") { +@@ -1483,7 +1484,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 4c0e4645f64e3..4ace56138209d 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1934,6 +1939,12 @@ component("base") { +@@ -1916,6 +1921,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } @@ -110,7 +110,7 @@ index 83e3cee2579ab..8238767ab9126 100644 if (data.empty()) { return sum; diff --git base/rand_util.h base/rand_util.h -index 746166bf75df7..7192a939e4fec 100644 +index b198a7198aab9..01bc8e9b6ad1f 100644 --- base/rand_util.h +++ base/rand_util.h @@ -17,8 +17,9 @@ @@ -124,7 +124,7 @@ index 746166bf75df7..7192a939e4fec 100644 #include "third_party/boringssl/src/include/openssl/rand.h" #endif -@@ -123,7 +124,7 @@ class RandomBitGenerator { +@@ -117,7 +118,7 @@ class RandomBitGenerator { ~RandomBitGenerator() = default; }; diff --git a/patch/patches/base_test_4396276.patch b/patch/patches/base_test_4396276.patch index 1ff7565fe..b1919aa70 100644 --- a/patch/patches/base_test_4396276.patch +++ b/patch/patches/base_test_4396276.patch @@ -1,8 +1,8 @@ diff --git base/test/BUILD.gn base/test/BUILD.gn -index c37ba6534270c..e1a9443a746cd 100644 +index ddf58b1d496e0..8a6c409b452f3 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn -@@ -199,11 +199,6 @@ static_library("test_support") { +@@ -210,11 +210,6 @@ static_library("test_support") { if (enable_base_tracing) { public_deps += [ "//third_party/perfetto:perfetto_test_support" ] @@ -14,7 +14,7 @@ index c37ba6534270c..e1a9443a746cd 100644 deps += [ ":amalgamated_perfetto_sql_stdlib", ":gen_cc_chrome_track_event_descriptor", -@@ -597,7 +592,7 @@ if (enable_base_tracing) { +@@ -609,7 +604,7 @@ if (enable_base_tracing) { # processor depends on dev_sqlite. The two share the same symbols but have # different implementations, so we need to hide dev_sqlite in this shared # library even in non-component builds to prevent duplicate symbols. @@ -23,7 +23,7 @@ index c37ba6534270c..e1a9443a746cd 100644 if (is_ios) { _target_type = "ios_framework_bundle" } -@@ -606,6 +601,8 @@ if (enable_base_tracing) { +@@ -618,6 +613,8 @@ if (enable_base_tracing) { defines = [ "TEST_TRACE_PROCESSOR_IMPL" ] testonly = true sources = [ @@ -32,7 +32,7 @@ index c37ba6534270c..e1a9443a746cd 100644 "test_trace_processor_export.h", "test_trace_processor_impl.cc", "test_trace_processor_impl.h", -@@ -623,33 +620,6 @@ if (enable_base_tracing) { +@@ -635,33 +632,6 @@ if (enable_base_tracing) { output_name = "TestTraceProcessor" bundle_deps_filter = [ "//third_party/icu:icudata" ] } @@ -88,10 +88,10 @@ index f5191b804bc07..aadb7d66ba4c3 100644 + #endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_ diff --git content/shell/BUILD.gn content/shell/BUILD.gn -index 7adc7cdd12c30..0e93b2dfe2f25 100644 +index 14192d15579a2..d6affd97970d5 100644 --- content/shell/BUILD.gn +++ content/shell/BUILD.gn -@@ -913,7 +913,6 @@ if (is_mac) { +@@ -914,7 +914,6 @@ if (is_mac) { # Specify a sensible install_name for static builds. The library is # dlopen()ed so this is not used to resolve the module. ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ] diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 0cad744fa..edc8aa3bf 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,8 +1,8 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index 9572bef1de74f..8d67dc7ceca2e 100644 +index 0cc947d5ba1c6..4cb8ee3b1544b 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc -@@ -209,7 +209,7 @@ BrowserTaskExecutor::OnUserInputStart() { +@@ -208,7 +208,7 @@ BrowserTaskExecutor::OnUserInputStart() { // static void BrowserTaskExecutor::Shutdown() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index fb15dcaad..248b61aed 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index eae60792ce033..6f6641e3fd3dd 100644 +index d4d1572304587..35fa3abc12213 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -2043,6 +2043,16 @@ bool ChildProcessSecurityPolicyImpl::PerformJailAndCitadelChecks( +@@ -2134,6 +2134,16 @@ bool ChildProcessSecurityPolicyImpl::PerformJailAndCitadelChecks( if (actual_process_lock.matches_scheme(url::kDataScheme)) { return true; } @@ -20,10 +20,10 @@ index eae60792ce033..6f6641e3fd3dd 100644 // Make an exception to allow most visited tiles to commit in third-party diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 53bba48293111..78fbed7d2c507 100644 +index f8e18b15a1951..68c9991a962f7 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -8245,10 +8245,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( +@@ -8255,10 +8255,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( bool use_opaque_origin = (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == network::mojom::WebSandboxFlags::kOrigin; @@ -47,7 +47,7 @@ index 53bba48293111..78fbed7d2c507 100644 } return origin_and_debug_info; -@@ -8356,11 +8368,20 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -8366,11 +8378,20 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { DetermineInitiatorRelationship(initiator_rfh, frame_tree_node_->current_frame_host())); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index fb2001cef..b9bdaeec0 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,5 +1,5 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index f1627512b3212..b9bdd63daae7d 100644 +index f58320b88f207..261181781fc72 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn @@ -133,6 +133,9 @@ declare_args() { @@ -12,13 +12,15 @@ index f1627512b3212..b9bdd63daae7d 100644 # Initialize all local variables with a pattern. This flag will fill # uninitialized floating-point types (and 32-bit pointers) with 0xFF and the # rest with 0xAA. This makes behavior of uninitialized memory bugs consistent, -@@ -2268,11 +2271,13 @@ config("export_dynamic") { +@@ -2306,6 +2309,7 @@ config("export_dynamic") { + # 2. Remove the thin_archive config, so that the .a file actually contains all + # .o files, instead of just references to .o files in the build directoy config("thin_archive") { - # The macOS and iOS default linker ld64 does not support reading thin - # archives. + if (use_thin_archives) { - if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { - arflags = [ "-T" ] + if ((is_apple && use_lld) || (is_linux && !is_clang)) { + # The macOS and iOS linker ld64.ldd doesn't support thin archive without + # symbol table, gcc on linux also throws the error `archive has no index`. +@@ -2323,6 +2327,7 @@ config("thin_archive") { } else if (is_win && use_lld) { arflags = [ "/llvmlibthin" ] } diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index c0ff73245..3c454c16f 100644 --- a/patch/patches/chrome_browser.patch +++ b/patch/patches/chrome_browser.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn -index d64fdb1c1bf43..954280f1c02e5 100644 +index 1a136cdeb8aea..27238c9fccc56 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -10,7 +10,7 @@ index d64fdb1c1bf43..954280f1c02e5 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/browser/request_header_integrity/buildflags.gni") -@@ -1849,6 +1850,7 @@ static_library("browser") { +@@ -1835,6 +1836,7 @@ static_library("browser") { "//build/config/chromebox_for_meetings:buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,8 +18,8 @@ index d64fdb1c1bf43..954280f1c02e5 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2522,6 +2524,10 @@ static_library("browser") { - ] +@@ -2508,6 +2510,10 @@ static_library("browser") { + sources += [ "net/net_error_diagnostics_dialog_stub.cc" ] } + if (enable_cef) { diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch deleted file mode 100644 index 3662321af..000000000 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index b7abca02f48f8..b595e9daa40eb 100644 ---- chrome/browser/browser_process.h -+++ chrome/browser/browser_process.h -@@ -221,9 +221,9 @@ class BrowserProcess { - virtual DownloadStatusUpdater* download_status_updater() = 0; - virtual DownloadRequestLimiter* download_request_limiter() = 0; - -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - // Returns the object that manages background applications. - virtual BackgroundModeManager* background_mode_manager() = 0; --#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - virtual void set_background_mode_manager_for_test( - std::unique_ptr manager) = 0; - #endif -diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 1c3e30115e006..c9b25fce563e6 100644 ---- chrome/browser/browser_process_impl.cc -+++ chrome/browser/browser_process_impl.cc -@@ -1142,18 +1142,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { - return download_request_limiter_.get(); - } - --BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { - #if BUILDFLAG(ENABLE_BACKGROUND_MODE) -+BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!background_mode_manager_) - CreateBackgroundModeManager(); - return background_mode_manager_.get(); --#else -- return nullptr; --#endif - } - --#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - void BrowserProcessImpl::set_background_mode_manager_for_test( - std::unique_ptr manager) { - background_mode_manager_ = std::move(manager); -diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index 9b6380d7fe36c..839558f24a06e 100644 ---- chrome/browser/browser_process_impl.h -+++ chrome/browser/browser_process_impl.h -@@ -193,8 +193,8 @@ class BrowserProcessImpl : public BrowserProcess, - void SetApplicationLocale(const std::string& actual_locale) override; - DownloadStatusUpdater* download_status_updater() override; - DownloadRequestLimiter* download_request_limiter() override; -- BackgroundModeManager* background_mode_manager() override; - #if BUILDFLAG(ENABLE_BACKGROUND_MODE) -+ BackgroundModeManager* background_mode_manager() override; - void set_background_mode_manager_for_test( - std::unique_ptr manager) override; - #endif -diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc -index 173f85fa144a1..43b8f2e2a18db 100644 ---- chrome/browser/lifetime/browser_close_manager.cc -+++ chrome/browser/lifetime/browser_close_manager.cc -@@ -158,6 +158,7 @@ void BrowserCloseManager::CloseBrowsers() { - // exit can restore all browsers open before exiting. - ProfileManager::ShutdownSessionServices(); - #endif -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - if (!browser_shutdown::IsTryingToQuit()) { - BackgroundModeManager* background_mode_manager = - g_browser_process->background_mode_manager(); -@@ -165,6 +166,7 @@ void BrowserCloseManager::CloseBrowsers() { - background_mode_manager->SuspendBackgroundMode(); - } - } -+#endif - - // Make a copy of the BrowserList to simplify the case where we need to - // destroy a Browser during the loop. diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index 7114f421c..193fc3508 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,7 +13,7 @@ index 2480282a19d12..dbd1fbf8a15b5 100644 return false; } diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc -index 2900434a50cf1..a2e8c6161ced2 100644 +index faead4388ac00..ce1cc050c94b0 100644 --- chrome/browser/devtools/devtools_window.cc +++ chrome/browser/devtools/devtools_window.cc @@ -38,6 +38,7 @@ @@ -38,7 +38,7 @@ index 2900434a50cf1..a2e8c6161ced2 100644 } // Create WebContents with devtools. -@@ -1691,9 +1699,13 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) { +@@ -1689,9 +1697,13 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) { if (!inspected_web_contents || !inspected_web_contents->OpenURL(params, /*navigation_handle_callback=*/{})) { @@ -52,7 +52,7 @@ index 2900434a50cf1..a2e8c6161ced2 100644 } } -@@ -1856,12 +1868,28 @@ void DevToolsWindow::CreateDevToolsBrowser() { +@@ -1854,12 +1866,28 @@ void DevToolsWindow::CreateDevToolsBrowser() { Browser::CreationStatus::kOk) { return; } @@ -88,7 +88,7 @@ index 2900434a50cf1..a2e8c6161ced2 100644 } diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 33631fd4086bf..25f16fe25b14e 100644 +index df9b0eed07761..a984511be272a 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni") @@ -99,7 +99,7 @@ index 33631fd4086bf..25f16fe25b14e 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/ash/components/assistant/assistant.gni") -@@ -311,6 +312,10 @@ static_library("ui") { +@@ -297,6 +298,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -110,7 +110,7 @@ index 33631fd4086bf..25f16fe25b14e 100644 public_deps = [ # WARNING WARNING WARNING # New dependencies outside of //chrome/browser should be added to -@@ -337,6 +342,7 @@ static_library("ui") { +@@ -323,6 +328,7 @@ static_library("ui") { "//build:chromeos_buildflags", "//build/config/chromebox_for_meetings:buildflags", "//cc/paint", @@ -118,7 +118,7 @@ index 33631fd4086bf..25f16fe25b14e 100644 "//chrome:resources", "//chrome:strings", "//chrome/app:chrome_dll_resources", -@@ -694,6 +700,10 @@ static_library("ui") { +@@ -688,6 +694,10 @@ static_library("ui") { deps += [ "//components/plus_addresses/resources:vector_icons" ] } @@ -129,7 +129,7 @@ index 33631fd4086bf..25f16fe25b14e 100644 # TODO(crbug.com/41437292): Remove this circular dependency. # Any circular includes must depend on the target "//chrome/browser:browser_public_dependencies". # These are all-platform circular includes. -@@ -5509,6 +5519,7 @@ static_library("ui") { +@@ -5479,6 +5489,7 @@ static_library("ui") { if (enable_printing) { deps += [ "//components/printing/browser", @@ -138,10 +138,10 @@ index 33631fd4086bf..25f16fe25b14e 100644 ] } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index e87612be40627..41f088fd227b7 100644 +index f313979ca1b0a..d69cbf3411173 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -273,6 +273,25 @@ +@@ -270,6 +270,25 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -167,7 +167,7 @@ index e87612be40627..41f088fd227b7 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -537,6 +556,10 @@ Browser::Browser(const CreateParams& params) +@@ -559,6 +578,10 @@ Browser::Browser(const CreateParams& params) type_(params.type), profile_(params.profile), window_(nullptr), @@ -178,7 +178,7 @@ index e87612be40627..41f088fd227b7 100644 tab_strip_model_delegate_( std::make_unique(this)), tab_strip_model_(std::make_unique( -@@ -767,6 +790,12 @@ Browser::~Browser() { +@@ -789,6 +812,12 @@ Browser::~Browser() { // away so they don't try and call back to us. if (select_file_dialog_.get()) select_file_dialog_->ListenerDestroyed(); @@ -191,7 +191,7 @@ index e87612be40627..41f088fd227b7 100644 } /////////////////////////////////////////////////////////////////////////////// -@@ -1329,6 +1358,8 @@ void Browser::WindowFullscreenStateChanged() { +@@ -1375,6 +1404,8 @@ void Browser::WindowFullscreenStateChanged() { ->WindowFullscreenStateChanged(); command_controller_->FullscreenStateChanged(); UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); @@ -200,7 +200,7 @@ index e87612be40627..41f088fd227b7 100644 } void Browser::FullscreenTopUIStateChanged() { -@@ -1659,6 +1690,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1694,6 +1725,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -215,7 +215,7 @@ index e87612be40627..41f088fd227b7 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1666,8 +1705,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1701,8 +1740,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -236,7 +236,7 @@ index e87612be40627..41f088fd227b7 100644 } bool Browser::TabsNeedBeforeUnloadFired() const { -@@ -1822,6 +1871,14 @@ WebContents* Browser::OpenURLFromTab( +@@ -1857,6 +1906,14 @@ WebContents* Browser::OpenURLFromTab( std::move(navigation_handle_callback)); } @@ -251,7 +251,7 @@ index e87612be40627..41f088fd227b7 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1988,6 +2045,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -2023,6 +2080,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool should_show_loading_ui) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); @@ -260,7 +260,7 @@ index e87612be40627..41f088fd227b7 100644 } void Browser::CloseContents(WebContents* source) { -@@ -2016,6 +2075,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -2051,6 +2110,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -269,7 +269,7 @@ index e87612be40627..41f088fd227b7 100644 if (!GetStatusBubble()) return; -@@ -2023,6 +2084,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -2058,6 +2119,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -287,7 +287,7 @@ index e87612be40627..41f088fd227b7 100644 void Browser::ContentsMouseEvent(WebContents* source, const ui::Event& event) { const ui::EventType type = event.type(); const bool exited = type == ui::EventType::kMouseExited; -@@ -2051,6 +2123,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { +@@ -2086,6 +2158,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { return false; } @@ -307,7 +307,7 @@ index e87612be40627..41f088fd227b7 100644 void Browser::BeforeUnloadFired(WebContents* web_contents, bool proceed, bool* proceed_to_fire_unload) { -@@ -2150,12 +2235,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -2185,12 +2270,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -332,7 +332,7 @@ index e87612be40627..41f088fd227b7 100644 // Don't show the page hung dialog when a HTML popup hangs because // the dialog will take the focus and immediately close the popup. RenderWidgetHostView* view = render_widget_host->GetView(); -@@ -2168,6 +2265,13 @@ void Browser::RendererUnresponsive( +@@ -2203,6 +2300,13 @@ void Browser::RendererUnresponsive( void Browser::RendererResponsive( WebContents* source, content::RenderWidgetHost* render_widget_host) { @@ -346,7 +346,7 @@ index e87612be40627..41f088fd227b7 100644 RenderWidgetHostView* view = render_widget_host->GetView(); if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) { TabDialogs::FromWebContents(source)->HideHungRendererDialog( -@@ -2177,6 +2281,15 @@ void Browser::RendererResponsive( +@@ -2212,6 +2316,15 @@ void Browser::RendererResponsive( content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( WebContents* source) { @@ -362,7 +362,7 @@ index e87612be40627..41f088fd227b7 100644 return javascript_dialogs::TabModalDialogManager::FromWebContents(source); } -@@ -2212,6 +2325,11 @@ void Browser::DraggableRegionsChanged( +@@ -2247,6 +2360,11 @@ void Browser::DraggableRegionsChanged( if (app_controller_) { app_controller_->DraggableRegionsChanged(regions, contents); } @@ -374,7 +374,7 @@ index e87612be40627..41f088fd227b7 100644 } void Browser::DidFinishNavigation( -@@ -2292,11 +2410,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -2327,11 +2445,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -390,7 +390,7 @@ index e87612be40627..41f088fd227b7 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2499,6 +2621,15 @@ void Browser::RequestMediaAccessPermission( +@@ -2534,6 +2656,15 @@ void Browser::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, content::MediaResponseCallback callback) { @@ -406,7 +406,7 @@ index e87612be40627..41f088fd227b7 100644 const extensions::Extension* extension = GetExtensionForOrigin(profile_, request.security_origin); MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( -@@ -3059,9 +3190,10 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { +@@ -3086,9 +3217,10 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { // Browser, Getters for UI (private): StatusBubble* Browser::GetStatusBubble() { @@ -418,7 +418,7 @@ index e87612be40627..41f088fd227b7 100644 } // We hide the status bar for web apps windows as this matches native -@@ -3069,6 +3201,12 @@ StatusBubble* Browser::GetStatusBubble() { +@@ -3096,6 +3228,12 @@ StatusBubble* Browser::GetStatusBubble() { // mode, as the minimal browser UI includes the status bar. if (web_app::AppBrowserController::IsWebApp(this) && !app_controller()->HasMinimalUiButtons()) { @@ -431,7 +431,7 @@ index e87612be40627..41f088fd227b7 100644 return nullptr; } -@@ -3218,6 +3356,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -3241,6 +3379,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); web_contents_collection_.StopObserving(web_contents); } @@ -440,7 +440,7 @@ index e87612be40627..41f088fd227b7 100644 } void Browser::TabDetachedAtImpl(content::WebContents* contents, -@@ -3372,6 +3512,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( +@@ -3398,6 +3538,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, bool check_can_support) const { @@ -456,11 +456,11 @@ index e87612be40627..41f088fd227b7 100644 case TYPE_NORMAL: return NormalBrowserSupportsWindowFeature(feature, check_can_support); diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 86ea151056ca1..680d143eecb16 100644 +index 8057f6fcc87c4..14bf2073b170b 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h -@@ -24,6 +24,7 @@ - #include "base/timer/elapsed_timer.h" +@@ -25,6 +25,7 @@ + #include "base/types/expected.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/features.h" @@ -478,7 +478,7 @@ index 86ea151056ca1..680d143eecb16 100644 #if BUILDFLAG(IS_ANDROID) #error This file should only be included on desktop. #endif -@@ -340,6 +345,15 @@ class Browser : public TabStripModelObserver, +@@ -339,6 +344,15 @@ class Browser : public TabStripModelObserver, // Document Picture in Picture options, specific to TYPE_PICTURE_IN_PICTURE. std::optional pip_options; @@ -494,7 +494,7 @@ index 86ea151056ca1..680d143eecb16 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -423,6 +437,13 @@ class Browser : public TabStripModelObserver, +@@ -422,6 +436,13 @@ class Browser : public TabStripModelObserver, update_ui_immediately_for_testing_ = true; } @@ -508,7 +508,7 @@ index 86ea151056ca1..680d143eecb16 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -524,6 +545,12 @@ class Browser : public TabStripModelObserver, +@@ -523,6 +544,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); base::WeakPtr AsWeakPtr() const; @@ -521,7 +521,7 @@ index 86ea151056ca1..680d143eecb16 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -956,10 +983,18 @@ class Browser : public TabStripModelObserver, +@@ -961,10 +988,18 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -540,7 +540,7 @@ index 86ea151056ca1..680d143eecb16 100644 void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; -@@ -1296,6 +1331,10 @@ class Browser : public TabStripModelObserver, +@@ -1303,6 +1338,10 @@ class Browser : public TabStripModelObserver, // This Browser's window. raw_ptr window_; @@ -551,7 +551,7 @@ index 86ea151056ca1..680d143eecb16 100644 std::unique_ptr const tab_strip_model_delegate_; std::unique_ptr const tab_strip_model_; -@@ -1362,6 +1401,8 @@ class Browser : public TabStripModelObserver, +@@ -1369,6 +1408,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -561,10 +561,10 @@ index 86ea151056ca1..680d143eecb16 100644 UnloadController unload_controller_; diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 70d7f4fbda71c..103e9c1b2a8f2 100644 +index 61a46e74464e0..d5978661b222e 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc -@@ -272,6 +272,10 @@ std::tuple GetBrowserAndTabForDisposition( +@@ -271,6 +271,10 @@ std::tuple GetBrowserAndTabForDisposition( browser_params.pip_options = pip_options; @@ -575,7 +575,7 @@ index 70d7f4fbda71c..103e9c1b2a8f2 100644 const BrowserWindow* const browser_window = params.browser->window(); const gfx::NativeWindow native_window = browser_window ? browser_window->GetNativeWindow() -@@ -560,6 +564,13 @@ std::unique_ptr CreateTargetContents( +@@ -561,6 +565,13 @@ std::unique_ptr CreateTargetContents( std::unique_ptr target_contents = WebContents::Create(create_params); @@ -590,7 +590,7 @@ index 70d7f4fbda71c..103e9c1b2a8f2 100644 // tab helpers, so the entire set of tab helpers needs to be set up // immediately. diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc -index e4b6094c5197e..4d2d12ae5725e 100644 +index 1f84235515463..82942fb06b5f3 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc @@ -33,9 +33,13 @@ content::WebContents* AddAndReturnTabAt( @@ -608,7 +608,7 @@ index e4b6094c5197e..4d2d12ae5725e 100644 params.disposition = foreground ? WindowOpenDisposition::NEW_FOREGROUND_TAB : WindowOpenDisposition::NEW_BACKGROUND_TAB; params.tabstrip_index = idx; -@@ -82,6 +86,16 @@ content::WebContents* AddWebContents( +@@ -84,6 +88,16 @@ content::WebContents* AddWebContents( // Can't create a new contents for the current tab - invalid case. DCHECK(disposition != WindowOpenDisposition::CURRENT_TAB); diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index f755178df..ad98adc83 100644 --- a/patch/patches/chrome_browser_context_menus.patch +++ b/patch/patches/chrome_browser_context_menus.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc -index db228a497bd28..94e04bca7e28d 100644 +index a1564ffe50f30..bfafcad73a2a2 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -360,6 +360,18 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -359,6 +359,18 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -21,7 +21,7 @@ index db228a497bd28..94e04bca7e28d 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -628,6 +640,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -627,6 +639,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { return 1; } @@ -32,7 +32,7 @@ index db228a497bd28..94e04bca7e28d 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -909,6 +925,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -908,6 +924,14 @@ RenderViewContextMenu::RenderViewContextMenu( : nullptr; #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -47,7 +47,7 @@ index db228a497bd28..94e04bca7e28d 100644 observers_.AddObserver(&autofill_context_menu_manager_); } -@@ -1365,6 +1389,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1364,6 +1388,12 @@ void RenderViewContextMenu::InitMenu() { autofill_client->HideAutofillSuggestions( autofill::SuggestionHidingReason::kContextMenuOpened); } @@ -60,7 +60,7 @@ index db228a497bd28..94e04bca7e28d 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -3648,6 +3678,26 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( +@@ -3630,6 +3660,26 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( execute_plugin_action_callback_ = std::move(cb); } @@ -88,7 +88,7 @@ index db228a497bd28..94e04bca7e28d 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers = diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h -index 0266119ae4010..d7e04a4e3804d 100644 +index b9ab5b1295599..7ad5bcb00ff8b 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h @@ -153,7 +153,21 @@ class RenderViewContextMenu @@ -113,7 +113,7 @@ index 0266119ae4010..d7e04a4e3804d 100644 Profile* GetProfile() const; // This may return nullptr (e.g. for WebUI dialogs). Virtual to allow tests to -@@ -477,6 +491,9 @@ class RenderViewContextMenu +@@ -475,6 +489,9 @@ class RenderViewContextMenu // built. bool is_protocol_submenu_valid_ = false; @@ -136,7 +136,7 @@ index cb51224f9892c..b5a3946999d8f 100644 private: // RenderViewContextMenuViewsMac: diff --git chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa.mm chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa.mm -index b130e9768c2d6..3e46b2fe18d0a 100644 +index 9070be4403de1..a449c46246acd 100644 --- chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa.mm +++ chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa.mm @@ -68,6 +68,10 @@ RenderViewContextMenuMacCocoa::~RenderViewContextMenuMacCocoa() { @@ -189,10 +189,10 @@ index 9f6c5fd44f206..dc50bc909897f 100644 runner_->Cancel(); } diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -index 5e34ee23fa791..36be094844276 100644 +index a269d358300b8..bf31a3cecdee7 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -@@ -149,6 +149,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, +@@ -150,6 +150,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, bool RenderViewContextMenuViews::GetAcceleratorForCommandId( int command_id, ui::Accelerator* accel) const { @@ -202,7 +202,7 @@ index 5e34ee23fa791..36be094844276 100644 // There are no formally defined accelerators we can query so we assume // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { -@@ -385,6 +388,10 @@ void RenderViewContextMenuViews::AppendPlatformEditableItems() { +@@ -386,6 +389,10 @@ void RenderViewContextMenuViews::AppendPlatformEditableItems() { } void RenderViewContextMenuViews::Show() { @@ -213,7 +213,7 @@ index 5e34ee23fa791..36be094844276 100644 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) return; -@@ -427,6 +434,11 @@ void RenderViewContextMenuViews::Show() { +@@ -428,6 +435,11 @@ void RenderViewContextMenuViews::Show() { } } @@ -226,7 +226,7 @@ index 5e34ee23fa791..36be094844276 100644 return views::Widget::GetTopLevelWidgetForNativeView(GetActiveNativeView()); } diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h -index 55ba34c417e4a..e92f668868e74 100644 +index 8433cdc9c88b7..aea62cda5cd22 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h @@ -45,6 +45,7 @@ class RenderViewContextMenuViews : public RenderViewContextMenu { @@ -305,10 +305,10 @@ index 042428f77f4ad..e4efd98ca45d5 100644 raw_ptr web_contents_ = nullptr; }; diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index 01a7fe089662d..5b67b639e3f09 100644 +index edf3c0f19409e..3a194411201fe 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc -@@ -380,6 +380,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { +@@ -392,6 +392,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { return false; } @@ -327,7 +327,7 @@ index 01a7fe089662d..5b67b639e3f09 100644 command_executed_ = true; RecordUsedItem(id); diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h -index b607544ab0a48..a389e96cf5182 100644 +index cd028ee83b6e8..c5d382eb8a2ce 100644 --- components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h @@ -85,8 +85,13 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, @@ -392,10 +392,10 @@ index 05efbd822ab0a..f3dff27cdfd19 100644 // only called when the observer returns true for IsCommandIdSupported() // for that |command_id|. diff --git components/renderer_context_menu/views/toolkit_delegate_views.cc components/renderer_context_menu/views/toolkit_delegate_views.cc -index 823f044316527..85439bf7ad2eb 100644 +index 0be2640c8173c..8bfdc6185690f 100644 --- components/renderer_context_menu/views/toolkit_delegate_views.cc +++ components/renderer_context_menu/views/toolkit_delegate_views.cc -@@ -30,6 +30,10 @@ void ToolkitDelegateViews::RunMenuAt(views::Widget* parent, +@@ -31,6 +31,10 @@ void ToolkitDelegateViews::RunMenuAt(views::Widget* parent, anchor_position, type); } @@ -407,12 +407,12 @@ index 823f044316527..85439bf7ad2eb 100644 menu_adapter_ = std::make_unique(menu_model); std::unique_ptr menu_view = menu_adapter_->CreateMenu(); diff --git components/renderer_context_menu/views/toolkit_delegate_views.h components/renderer_context_menu/views/toolkit_delegate_views.h -index eacdc12813204..9084effdaa121 100644 +index 7762b3e6673d9..5bd1544aaaa62 100644 --- components/renderer_context_menu/views/toolkit_delegate_views.h +++ components/renderer_context_menu/views/toolkit_delegate_views.h @@ -39,6 +39,7 @@ class ToolkitDelegateViews : public RenderViewContextMenuBase::ToolkitDelegate { const gfx::Point& point, - ui::MenuSourceType type); + ui::mojom::MenuSourceType type); views::MenuItemView* menu_view() { return menu_view_; } + bool IsMenuRunning() const; diff --git a/patch/patches/chrome_browser_devtools_osr.patch b/patch/patches/chrome_browser_devtools_osr.patch index c13abebf1..9404d3eac 100644 --- a/patch/patches/chrome_browser_devtools_osr.patch +++ b/patch/patches/chrome_browser_devtools_osr.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/devtools/chrome_devtools_manager_delegate.cc chrome/browser/devtools/chrome_devtools_manager_delegate.cc -index e84932c53009d..0e64ca8105f82 100644 +index 8c8d53b351c2f..c1fa3cd901335 100644 --- chrome/browser/devtools/chrome_devtools_manager_delegate.cc +++ chrome/browser/devtools/chrome_devtools_manager_delegate.cc @@ -15,6 +15,7 @@ @@ -21,7 +21,7 @@ index e84932c53009d..0e64ca8105f82 100644 using content::DevToolsAgentHost; const char ChromeDevToolsManagerDelegate::kTypeApp[] = "app"; -@@ -285,6 +290,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType( +@@ -283,6 +288,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType( return DevToolsAgentHost::kTypePage; } diff --git a/patch/patches/chrome_browser_dialogs_native.patch b/patch/patches/chrome_browser_dialogs_native.patch index 3db1a2d13..03ebd415b 100644 --- a/patch/patches/chrome_browser_dialogs_native.patch +++ b/patch/patches/chrome_browser_dialogs_native.patch @@ -1,22 +1,21 @@ diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc -index 50fca3503b2a9..89a58b139af4a 100644 +index 5d563a5311ec1..7c8c70393ed4b 100644 --- chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc -@@ -239,6 +239,13 @@ void FileSelectHelper::OnListFile( - void FileSelectHelper::LaunchConfirmationDialog( - const base::FilePath& path, - std::vector selected_files) { -+ if (run_from_cef_) { -+ // Don't show the upload confirmation dialog when triggered via CEF -+ // (initially or recursively). -+ ConvertToFileChooserFileInfoList(selected_files); -+ return; -+ } -+ - ShowFolderUploadConfirmationDialog( - path, - base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this), -@@ -466,31 +473,51 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -313,6 +313,12 @@ void FileSelectHelper::OnListDone(int error) { + } + + if (dialog_type_ == ui::SelectFileDialog::SELECT_UPLOAD_FOLDER) { ++ if (run_from_cef_) { ++ // Don't show the upload confirmation dialog when triggered via CEF ++ // (initially or recursively). ++ PerformContentAnalysisIfNeeded(std::move(chooser_files)); ++ return; ++ } + auto model = CreateConfirmationDialog( + entry->display_name_, std::move(chooser_files), + base::BindOnce(&FileSelectHelper::PerformContentAnalysisIfNeeded, +@@ -511,31 +517,51 @@ FileSelectHelper::GetFileTypesFromAcceptType( std::vector* extensions = &file_type->extensions.back(); @@ -72,7 +71,7 @@ index 50fca3503b2a9..89a58b139af4a 100644 if (extensions->size() > old_extension_size) valid_type_count++; } -@@ -507,12 +534,28 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -552,12 +578,28 @@ FileSelectHelper::GetFileTypesFromAcceptType( // dialog uses the first extension in the list to form the description, // like "EHTML Files". This is not what we want. if (valid_type_count > 1 || @@ -105,7 +104,7 @@ index 50fca3503b2a9..89a58b139af4a 100644 } return file_type; -@@ -522,7 +565,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -567,7 +609,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( void FileSelectHelper::RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, @@ -115,7 +114,7 @@ index 50fca3503b2a9..89a58b139af4a 100644 Profile* profile = Profile::FromBrowserContext( render_frame_host->GetProcess()->GetBrowserContext()); -@@ -530,6 +574,7 @@ void FileSelectHelper::RunFileChooser( +@@ -575,6 +618,7 @@ void FileSelectHelper::RunFileChooser( // message. scoped_refptr file_select_helper( new FileSelectHelper(profile)); @@ -124,10 +123,10 @@ index 50fca3503b2a9..89a58b139af4a 100644 params.Clone()); } diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h -index 138889a07790b..73d480d4f2525 100644 +index 921b36076c3f3..d61248be1997b 100644 --- chrome/browser/file_select_helper.h +++ chrome/browser/file_select_helper.h -@@ -63,7 +63,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< +@@ -64,7 +64,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< static void RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, @@ -137,7 +136,7 @@ index 138889a07790b..73d480d4f2525 100644 // Enumerates all the files in directory. static void EnumerateDirectory( -@@ -330,6 +331,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< +@@ -336,6 +337,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< scoped_disallow_picture_in_picture_; #endif // !BUILDFLAG(IS_ANDROID) @@ -257,7 +256,7 @@ index c7acd9b05fbb8..3e95e4125fa24 100644 } // namespace ui diff --git ui/shell_dialogs/select_file_dialog_mac.mm ui/shell_dialogs/select_file_dialog_mac.mm -index 72f687be6fb42..4fa78758dd4df 100644 +index 416c1bb5503ef..a6705c94c0dc2 100644 --- ui/shell_dialogs/select_file_dialog_mac.mm +++ ui/shell_dialogs/select_file_dialog_mac.mm @@ -104,6 +104,10 @@ void SelectFileDialogImpl::SelectFileImpl( @@ -272,7 +271,7 @@ index 72f687be6fb42..4fa78758dd4df 100644 std::make_unique(ns_window), std::move(receiver)); diff --git ui/shell_dialogs/select_file_dialog_win.cc ui/shell_dialogs/select_file_dialog_win.cc -index ed343dc032789..a7105f4c78a1c 100644 +index e3bd03f336edd..afc421d99112f 100644 --- ui/shell_dialogs/select_file_dialog_win.cc +++ ui/shell_dialogs/select_file_dialog_win.cc @@ -251,6 +251,8 @@ void SelectFileDialogImpl::SelectFileImpl( diff --git a/patch/patches/chrome_browser_dialogs_widget.patch b/patch/patches/chrome_browser_dialogs_widget.patch index f091a9f94..a5d9fce65 100644 --- a/patch/patches/chrome_browser_dialogs_widget.patch +++ b/patch/patches/chrome_browser_dialogs_widget.patch @@ -279,7 +279,7 @@ index bc119f10f749e..d81c1ce4e786f 100644 // Web-modal (ui::mojom::ModalType::kChild) dialogs with parents are marked as // child widgets to prevent top-level window behavior (independent movement, diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h -index d64117586a5c3..c37d7a59c134e 100644 +index 0777e2fe71f04..546994cad2b14 100644 --- ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h @@ -106,13 +106,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { diff --git a/patch/patches/chrome_browser_download.patch b/patch/patches/chrome_browser_download.patch index c989ac8c0..08748c7cb 100644 --- a/patch/patches/chrome_browser_download.patch +++ b/patch/patches/chrome_browser_download.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/chrome_download_manager_delegate.cc chrome/browser/download/chrome_download_manager_delegate.cc -index 6b356ae53968e..da22286db5a3f 100644 +index e07f9d6b5aabd..f57b5da7e9364 100644 --- chrome/browser/download/chrome_download_manager_delegate.cc +++ chrome/browser/download/chrome_download_manager_delegate.cc @@ -31,6 +31,7 @@ @@ -21,7 +21,7 @@ index 6b356ae53968e..da22286db5a3f 100644 using content::BrowserThread; using content::DownloadManager; using download::DownloadItem; -@@ -520,6 +525,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) +@@ -517,6 +522,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) download_dialog_bridge_ = std::make_unique(); download_message_bridge_ = std::make_unique(); #endif @@ -33,7 +33,7 @@ index 6b356ae53968e..da22286db5a3f 100644 } ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { -@@ -579,6 +589,9 @@ void ChromeDownloadManagerDelegate::Shutdown() { +@@ -576,6 +586,9 @@ void ChromeDownloadManagerDelegate::Shutdown() { download_manager_->RemoveObserver(this); download_manager_ = nullptr; } @@ -43,7 +43,7 @@ index 6b356ae53968e..da22286db5a3f 100644 } void ChromeDownloadManagerDelegate::OnDownloadCanceledAtShutdown( -@@ -647,6 +660,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget( +@@ -644,6 +657,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget( ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload); } @@ -56,7 +56,7 @@ index 6b356ae53968e..da22286db5a3f 100644 DownloadTargetDeterminer::CompletionCallback target_determined_callback = base::BindOnce(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined, weak_ptr_factory_.GetWeakPtr(), download->GetId(), -@@ -1080,8 +1099,11 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { +@@ -1119,8 +1138,11 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { Browser* browser = web_contents ? chrome::FindBrowserWithTab(web_contents) : nullptr; std::unique_ptr browser_displayer; @@ -71,7 +71,7 @@ index 6b356ae53968e..da22286db5a3f 100644 std::make_unique(profile_); browser = browser_displayer->browser(); diff --git chrome/browser/download/chrome_download_manager_delegate.h chrome/browser/download/chrome_download_manager_delegate.h -index 32d23a0c98061..be6a99a33bdeb 100644 +index 7ae09b406f344..801d6c846e744 100644 --- chrome/browser/download/chrome_download_manager_delegate.h +++ chrome/browser/download/chrome_download_manager_delegate.h @@ -19,6 +19,7 @@ @@ -82,7 +82,7 @@ index 32d23a0c98061..be6a99a33bdeb 100644 #include "chrome/browser/download/download_completion_blocker.h" #include "chrome/browser/download/download_target_determiner_delegate.h" #include "components/download/public/common/download_danger_type.h" -@@ -57,6 +58,12 @@ class CrxInstallError; +@@ -58,6 +59,12 @@ class CrxInstallError; } #endif @@ -95,7 +95,7 @@ index 32d23a0c98061..be6a99a33bdeb 100644 // This is the Chrome side helper for the download system. class ChromeDownloadManagerDelegate : public content::DownloadManagerDelegate, -@@ -393,6 +400,10 @@ class ChromeDownloadManagerDelegate +@@ -401,6 +408,10 @@ class ChromeDownloadManagerDelegate // Whether a file picker dialog is showing. bool is_file_picker_showing_; diff --git a/patch/patches/chrome_browser_extensions.patch b/patch/patches/chrome_browser_extensions.patch index a46417528..3287476f9 100644 --- a/patch/patches/chrome_browser_extensions.patch +++ b/patch/patches/chrome_browser_extensions.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/extensions/api/chrome_extensions_api_client.cc chrome/browser/extensions/api/chrome_extensions_api_client.cc -index 66ea000f8c048..02eeb15adceed 100644 +index da9c9d7c0f458..a97fc4e019775 100644 --- chrome/browser/extensions/api/chrome_extensions_api_client.cc +++ chrome/browser/extensions/api/chrome_extensions_api_client.cc @@ -15,6 +15,7 @@ @@ -34,10 +34,10 @@ index 66ea000f8c048..02eeb15adceed 100644 WebViewGuestDelegate* ChromeExtensionsAPIClient::CreateWebViewGuestDelegate( diff --git chrome/browser/extensions/api/tabs/tabs_api.cc chrome/browser/extensions/api/tabs/tabs_api.cc -index d0ec6330ae8c1..c9e2857fa06b4 100644 +index f4fc8d090230a..0de22b5e1c0f1 100644 --- chrome/browser/extensions/api/tabs/tabs_api.cc +++ chrome/browser/extensions/api/tabs/tabs_api.cc -@@ -1603,7 +1603,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -1646,7 +1646,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { return RespondNow(Error(ExtensionTabUtil::kTabStripNotEditableError)); } @@ -46,7 +46,7 @@ index d0ec6330ae8c1..c9e2857fa06b4 100644 tab_strip->ActivateTabAt(tab_index); DCHECK_EQ(contents, tab_strip->GetActiveWebContents()); } -@@ -1617,7 +1617,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -1660,7 +1660,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { } bool highlighted = *params->update_properties.highlighted; @@ -55,7 +55,7 @@ index d0ec6330ae8c1..c9e2857fa06b4 100644 tab_strip->ToggleSelectionAt(tab_index); } } -@@ -1629,7 +1629,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -1672,7 +1672,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { kCannotUpdateMuteCaptured, base::NumberToString(tab_id)))); } @@ -64,7 +64,7 @@ index d0ec6330ae8c1..c9e2857fa06b4 100644 int opener_id = *params->update_properties.opener_tab_id; WebContents* opener_contents = nullptr; if (opener_id == tab_id) { -@@ -1664,7 +1664,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -1707,7 +1707,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { ->SetAutoDiscardable(state); } @@ -73,19 +73,17 @@ index d0ec6330ae8c1..c9e2857fa06b4 100644 // Bug fix for crbug.com/1197888. Don't let the extension update the tab if // the user is dragging tabs. if (!ExtensionTabUtil::IsTabStripEditable()) { -@@ -1685,8 +1685,9 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -1728,7 +1728,8 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { // Navigate the tab to a new location if the url is different. if (params->update_properties.url) { std::string updated_url = *params->update_properties.url; - if (browser->profile()->IsIncognitoProfile() && -- !IsURLAllowedInIncognito(GURL(updated_url), browser->profile())) { + auto* profile = Profile::FromBrowserContext(browser_context()); + if (profile->IsIncognitoProfile() && -+ !IsURLAllowedInIncognito(GURL(updated_url), profile)) { + !IsURLAllowedInIncognito(GURL(updated_url))) { return RespondNow(Error(ErrorUtils::FormatErrorMessage( tabs_constants::kURLsNotAllowedInIncognitoError, updated_url))); - } -@@ -1700,7 +1701,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -1743,7 +1744,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { return RespondNow(Error(std::move(error))); } @@ -95,7 +93,7 @@ index d0ec6330ae8c1..c9e2857fa06b4 100644 current_url, updated_url, js_callstack()); } diff --git chrome/browser/extensions/extension_tab_util.cc chrome/browser/extensions/extension_tab_util.cc -index a896cb1079d97..6681661f788f6 100644 +index 4d2c067a06041..6943da2585d22 100644 --- chrome/browser/extensions/extension_tab_util.cc +++ chrome/browser/extensions/extension_tab_util.cc @@ -20,6 +20,7 @@ @@ -106,7 +104,7 @@ index a896cb1079d97..6681661f788f6 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/browser_extension_window_controller.h" #include "chrome/browser/extensions/chrome_extension_function_details.h" -@@ -73,6 +74,10 @@ +@@ -74,6 +75,10 @@ #include "third_party/blink/public/common/features.h" #include "url/gurl.h" @@ -117,20 +115,14 @@ index a896cb1079d97..6681661f788f6 100644 using content::NavigationEntry; using content::WebContents; using extensions::mojom::APIPermissionID; -@@ -696,6 +701,20 @@ bool ExtensionTabUtil::GetTabById(int tab_id, +@@ -714,6 +719,14 @@ bool ExtensionTabUtil::GetTabById(int tab_id, } } +#if BUILDFLAG(ENABLE_CEF) -+ if (cef::GetAlloyTabById(tab_id, profile, include_incognito, contents)) { -+ // |tab_strip| and |tab_index| are tied to a specific Browser window, which -+ // doesn't exist for an Alloy style browser. -+ if (tab_strip) { -+ *tab_strip = nullptr; -+ } -+ if (tab_index) { -+ *tab_index = api::tabs::TAB_INDEX_NONE; -+ } ++ if (cef::GetAlloyTabById(tab_id, profile, include_incognito, out_contents)) { ++ // |out_window| and |out_tab_index| are tied to a specific Browser window, ++ // which doesn't exist for an Alloy style browser. + return true; + } +#endif // BUILDFLAG(ENABLE_CEF) diff --git a/patch/patches/chrome_browser_policy.patch b/patch/patches/chrome_browser_policy.patch index dc88464ea..a366ca4f1 100644 --- a/patch/patches/chrome_browser_policy.patch +++ b/patch/patches/chrome_browser_policy.patch @@ -105,7 +105,7 @@ index d8fda08453256..466718e824503 100644 } diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc -index cf3c9a1871a35..0577e8f8b60ec 100644 +index 440b8aaca8f0f..fec585790788d 100644 --- chrome/browser/policy/chrome_browser_policy_connector.cc +++ chrome/browser/policy/chrome_browser_policy_connector.cc @@ -13,11 +13,14 @@ @@ -123,7 +123,7 @@ index cf3c9a1871a35..0577e8f8b60ec 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" #include "chrome/browser/policy/configuration_policy_handler_list_factory.h" -@@ -82,6 +85,11 @@ +@@ -75,6 +78,11 @@ namespace policy { namespace { bool g_command_line_enabled_for_testing = false; @@ -135,7 +135,7 @@ index cf3c9a1871a35..0577e8f8b60ec 100644 } // namespace ChromeBrowserPolicyConnector::ChromeBrowserPolicyConnector() -@@ -278,6 +286,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() { +@@ -255,6 +263,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() { g_command_line_enabled_for_testing = true; } @@ -209,7 +209,7 @@ index cf3c9a1871a35..0577e8f8b60ec 100644 base::flat_set ChromeBrowserPolicyConnector::device_affiliation_ids() const { if (!device_affiliation_ids_for_testing_.empty()) { -@@ -357,25 +432,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { +@@ -318,25 +393,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { std::unique_ptr ChromeBrowserPolicyConnector::CreatePlatformProvider() { #if BUILDFLAG(IS_WIN) @@ -244,7 +244,7 @@ index cf3c9a1871a35..0577e8f8b60ec 100644 auto loader = std::make_unique( base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::BEST_EFFORT}), -@@ -385,7 +457,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { +@@ -346,7 +418,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { std::move(loader)); #elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) base::FilePath config_dir_path; @@ -254,12 +254,12 @@ index cf3c9a1871a35..0577e8f8b60ec 100644 base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::BEST_EFFORT}), diff --git chrome/browser/policy/chrome_browser_policy_connector.h chrome/browser/policy/chrome_browser_policy_connector.h -index e4c6792766ae4..0a0c054d9e4d1 100644 +index 40ce1cf15d277..e98c6e999fb5b 100644 --- chrome/browser/policy/chrome_browser_policy_connector.h +++ chrome/browser/policy/chrome_browser_policy_connector.h -@@ -28,6 +28,10 @@ - #include "components/policy/core/common/policy_loader_lacros.h" - #endif // BUILDFLAG(IS_CHROMEOS_LACROS) +@@ -23,6 +23,10 @@ + #include "components/policy/core/browser/android/policy_cache_updater_android.h" + #endif +#if BUILDFLAG(IS_MAC) +#include "base/apple/scoped_cftyperef.h" @@ -268,7 +268,7 @@ index e4c6792766ae4..0a0c054d9e4d1 100644 class PrefService; namespace policy { -@@ -135,6 +139,25 @@ class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { +@@ -128,6 +132,25 @@ class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { static void EnableCommandLineSupportForTesting(); @@ -357,13 +357,13 @@ index 8dbf958c189dd..6eaccc6688eca 100644 *dir = base::FilePath(policy::path_parser::ExpandPathVariables(value)); return true; diff --git chrome/common/chrome_paths.cc chrome/common/chrome_paths.cc -index ec09803ffabcf..9a39e6172293f 100644 +index a467b25145684..8727050b93a35 100644 --- chrome/common/chrome_paths.cc +++ chrome/common/chrome_paths.cc -@@ -535,7 +535,8 @@ bool PathProvider(int key, base::FilePath* result) { - return false; - } +@@ -525,7 +525,8 @@ bool PathProvider(int key, base::FilePath* result) { break; + } + #endif -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_OPENBSD) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_OPENBSD) && \ + !BUILDFLAG(ENABLE_CEF) @@ -371,7 +371,7 @@ index ec09803ffabcf..9a39e6172293f 100644 cur = base::FilePath(policy::kPolicyPath); break; diff --git chrome/common/chrome_paths.h chrome/common/chrome_paths.h -index 13abfd26b92b3..acb4d58f02650 100644 +index fbfe597d09d9a..b8067f8d9ecd7 100644 --- chrome/common/chrome_paths.h +++ chrome/common/chrome_paths.h @@ -8,6 +8,7 @@ @@ -382,17 +382,17 @@ index 13abfd26b92b3..acb4d58f02650 100644 #include "extensions/buildflags/buildflags.h" #include "third_party/widevine/cdm/buildflags.h" -@@ -48,7 +49,7 @@ enum { - DIR_INTERNAL_PLUGINS, // Directory where internal plugins reside. - DIR_COMPONENTS, // Directory where built-in implementations of - // component-updated libraries or data reside. +@@ -51,7 +52,7 @@ enum { + #if BUILDFLAG(IS_MAC) + DIR_OUTER_BUNDLE, // Directory that is the outermost Chromium bundle. + #endif -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(ENABLE_CEF) DIR_POLICY_FILES, // Directory for system-wide read-only // policy files that allow sys-admins // to set policies for chrome. This directory diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py -index be1553785d5b5..2446e30bea57e 100755 +index 41f2f032eeaa6..cd191b61b9c1e 100755 --- components/policy/tools/generate_policy_source.py +++ components/policy/tools/generate_policy_source.py @@ -465,6 +465,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, diff --git a/patch/patches/chrome_browser_printing_oop_osr.patch b/patch/patches/chrome_browser_printing_oop_osr.patch index 37b2104f7..a1a6e87d8 100644 --- a/patch/patches/chrome_browser_printing_oop_osr.patch +++ b/patch/patches/chrome_browser_printing_oop_osr.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/printing/print_backend_service_manager.cc chrome/browser/printing/print_backend_service_manager.cc -index 8fe9a3e263964..548609bc78b33 100644 +index 9f3d26990651f..e89f779746ac5 100644 --- chrome/browser/printing/print_backend_service_manager.cc +++ chrome/browser/printing/print_backend_service_manager.cc @@ -75,7 +75,15 @@ PrintBackendServiceManager* g_print_backend_service_manager_singleton = nullptr; @@ -17,5 +17,5 @@ index 8fe9a3e263964..548609bc78b33 100644 + } + return base::win::HandleToUint32(hwnd); #else - NOTREACHED_IN_MIGRATION(); - return 0; + NOTREACHED(); + #endif diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index c168b9265..d15e2889f 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/bookmarks/bookmark_stats.cc chrome/browser/ui/bookmarks/bookmark_stats.cc -index 7ae18c5a960b0..d48ba838efe6f 100644 +index bd47b3f13aa2a..0f4f3c47d2647 100644 --- chrome/browser/ui/bookmarks/bookmark_stats.cc +++ chrome/browser/ui/bookmarks/bookmark_stats.cc @@ -21,7 +21,9 @@ bool IsBookmarkBarLocation(BookmarkLaunchLocation location) { @@ -44,7 +44,7 @@ index caa20ec03434a..2a3ca921445c1 100644 avatar_toolbar_button, GetBrowser().profile(), type); DCHECK_EQ(nullptr, bubble_tracker_.view()); diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index 791ab794c8750..ca9e0851e2689 100644 +index 00510c991e657..830db4087c274 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -36,7 +36,9 @@ @@ -59,13 +59,13 @@ index 791ab794c8750..ca9e0851e2689 100644 ax::mojom::NameFrom::kAttribute); diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc -index ee9f399e4c010..2182e42981f9d 100644 +index 58026d48e15a6..acb3b51f86943 100644 --- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc +++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc -@@ -58,7 +58,9 @@ void ProfileMenuCoordinator::Show(bool is_source_accelerator) { - is_incognito &= !browser.profile()->IsGuestSession(); - #endif +@@ -52,7 +52,9 @@ void ProfileMenuCoordinator::Show(bool is_source_accelerator) { + std::unique_ptr bubble; + bool is_incognito = browser.profile()->IsIncognitoProfile(); - if (is_incognito) { + if (is_incognito || + (browser.profile()->IsOffTheRecord() && diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index ae6db051e..645d62b90 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc -index 0b7e60d6742de..94af5f4d226bf 100644 +index cf4597e671afe..a9693c4e10d8e 100644 --- chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc -@@ -643,7 +643,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( +@@ -647,7 +647,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( #endif if (!profile) profile = std::make_unique(parent, otr_profile_id); @@ -14,10 +14,10 @@ index 0b7e60d6742de..94af5f4d226bf 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 89254771117da..eb35e4595d1ad 100644 +index 4385d5d90f9c8..88aca5519660e 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc -@@ -81,6 +81,7 @@ base::LazyInstance>::Leaky +@@ -84,6 +84,7 @@ base::LazyInstance>::Leaky namespace { @@ -25,7 +25,7 @@ index 89254771117da..eb35e4595d1ad 100644 const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; const char kTestOTRProfileIDPrefix[] = "Test::OTR"; -@@ -101,6 +102,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { +@@ -104,6 +105,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { // DevTools::BrowserContext, MediaRouter::Presentation, and // CaptivePortal::Signin are exceptions to this ban. if (*this == PrimaryID() || @@ -34,7 +34,7 @@ index 89254771117da..eb35e4595d1ad 100644 base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, base::CompareCase::SENSITIVE) || base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, -@@ -138,6 +141,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( +@@ -141,6 +144,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( base::Uuid::GenerateRandomV4().AsLowercaseString().c_str())); } @@ -52,7 +52,7 @@ index 89254771117da..eb35e4595d1ad 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index f79b0cd32e4fb..c797e6659a43f 100644 +index 8e96e47754dc7..c65184775fba7 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h @@ -94,6 +94,10 @@ class Profile : public content::BrowserContext { @@ -66,7 +66,7 @@ index f79b0cd32e4fb..c797e6659a43f 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -503,6 +507,9 @@ class Profile : public content::BrowserContext { +@@ -506,6 +510,9 @@ class Profile : public content::BrowserContext { static Profile* FromJavaObject(const jni_zero::JavaRef& obj); jni_zero::ScopedJavaLocalRef GetJavaObject() const; #endif // BUILDFLAG(IS_ANDROID) @@ -76,7 +76,7 @@ index f79b0cd32e4fb..c797e6659a43f 100644 protected: // Creates an OffTheRecordProfile which points to this Profile. static std::unique_ptr CreateOffTheRecordProfile( -@@ -514,7 +521,6 @@ class Profile : public content::BrowserContext { +@@ -517,7 +524,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -85,10 +85,10 @@ index f79b0cd32e4fb..c797e6659a43f 100644 // Returns whether the user has signed in this profile to an account. diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 26667af1eb648..79bb0289f6150 100644 +index 3dd5f9818cfa0..7b3e3697f4ce3 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -1012,7 +1012,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -1038,7 +1038,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 8249b7c2c..14e7eeed1 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index 19cc1b47ecf4a..56b0e471ff37a 100644 +index 949f93a7b032a..1c32ec4aa0b84 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -39,6 +39,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_startup.patch b/patch/patches/chrome_browser_startup.patch index 36bcd82cd..a60c24b87 100644 --- a/patch/patches/chrome_browser_startup.patch +++ b/patch/patches/chrome_browser_startup.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/startup/startup_browser_creator.cc chrome/browser/ui/startup/startup_browser_creator.cc -index 5e4078d747c74..e1c41cb1a8cda 100644 +index ba443f5e8838d..a3f3c250f8006 100644 --- chrome/browser/ui/startup/startup_browser_creator.cc +++ chrome/browser/ui/startup/startup_browser_creator.cc @@ -616,6 +616,13 @@ std::optional GetAppId(const base::CommandLine& command_line, @@ -16,7 +16,7 @@ index 5e4078d747c74..e1c41cb1a8cda 100644 } // namespace StartupProfileMode StartupProfileModeFromReason( -@@ -1481,6 +1488,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( +@@ -1479,6 +1486,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( {profile, mode}, last_opened_profiles); } @@ -29,7 +29,7 @@ index 5e4078d747c74..e1c41cb1a8cda 100644 // static void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( const base::CommandLine& command_line, -@@ -1490,6 +1503,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( +@@ -1488,6 +1501,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( return; } diff --git a/patch/patches/chrome_browser_webui_license.patch b/patch/patches/chrome_browser_webui_license.patch index 99ee90cbf..5e2f1bcfb 100644 --- a/patch/patches/chrome_browser_webui_license.patch +++ b/patch/patches/chrome_browser_webui_license.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/webui/about/about_ui.cc chrome/browser/ui/webui/about/about_ui.cc -index 63e740fe81847..ea422ae7bbda4 100644 +index e28af86de9298..fb182fa3f7c32 100644 --- chrome/browser/ui/webui/about/about_ui.cc +++ chrome/browser/ui/webui/about/about_ui.cc -@@ -92,6 +92,10 @@ +@@ -89,6 +89,10 @@ #include "chrome/common/webui_url_constants.h" #endif // BUILDFLAG(IS_CHROMEOS) @@ -13,7 +13,7 @@ index 63e740fe81847..ea422ae7bbda4 100644 using content::BrowserThread; namespace { -@@ -624,6 +628,11 @@ ChromeURLsUIConfig::ChromeURLsUIConfig() +@@ -620,6 +624,11 @@ ChromeURLsUIConfig::ChromeURLsUIConfig() CreditsUIConfig::CreditsUIConfig() : AboutUIConfigBase(chrome::kChromeUICreditsHost) {} @@ -25,7 +25,7 @@ index 63e740fe81847..ea422ae7bbda4 100644 #if !BUILDFLAG(IS_ANDROID) TermsUIConfig::TermsUIConfig() : AboutUIConfigBase(chrome::kChromeUITermsHost) {} -@@ -725,6 +734,16 @@ void AboutUIHTMLSource::StartDataRequest( +@@ -721,6 +730,16 @@ void AboutUIHTMLSource::StartDataRequest( IDS_TERMS_HTML); #endif } @@ -69,7 +69,7 @@ index 6548d519c3da9..645163f69f822 100644 // chrome://terms class TermsUIConfig : public AboutUIConfigBase { diff --git chrome/browser/ui/webui/chrome_web_ui_configs.cc chrome/browser/ui/webui/chrome_web_ui_configs.cc -index a1f43d79b6f9b..281ee1e2c8a41 100644 +index 8b877339c4179..dcb347ef1878f 100644 --- chrome/browser/ui/webui/chrome_web_ui_configs.cc +++ chrome/browser/ui/webui/chrome_web_ui_configs.cc @@ -6,6 +6,7 @@ @@ -77,21 +77,21 @@ index a1f43d79b6f9b..281ee1e2c8a41 100644 #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/features.h" + #include "chrome/browser/optimization_guide/optimization_guide_internals_ui.h" #include "chrome/browser/ui/webui/about/about_ui.h" #include "chrome/browser/ui/webui/accessibility/accessibility_ui.h" - #include "chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui.h" -@@ -211,6 +212,9 @@ void RegisterChromeWebUIConfigs() { +@@ -215,6 +216,9 @@ void RegisterChromeWebUIConfigs() { + map.AddWebUIConfig(std::make_unique()); map.AddWebUIConfig(std::make_unique()); map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig(std::make_unique()); +#if BUILDFLAG(ENABLE_CEF) + map.AddWebUIConfig(std::make_unique()); +#endif - map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig( - std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); diff --git chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -index 279f73938d406..c1bf263962e0c 100644 +index f9ca5f61c9c1f..a99993720a7ea 100644 --- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc @@ -18,6 +18,7 @@ @@ -101,8 +101,8 @@ index 279f73938d406..c1bf263962e0c 100644 +#include "cef/libcef/features/features.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/buildflags.h" - #include "chrome/browser/commerce/shopping_service_factory.h" -@@ -538,6 +539,9 @@ ChromeWebUIControllerFactory::GetListOfAcceptableURLs() { + #include "chrome/browser/devtools/devtools_ui_bindings.h" +@@ -485,6 +486,9 @@ ChromeWebUIControllerFactory::GetListOfAcceptableURLs() { GURL(chrome::kChromeUIGpuURL), GURL(chrome::kChromeUIHistogramsURL), GURL(chrome::kChromeUIInspectURL), @@ -113,7 +113,7 @@ index 279f73938d406..c1bf263962e0c 100644 GURL(chrome::kChromeUINetExportURL), GURL(chrome::kChromeUIPrefsInternalsURL), diff --git chrome/common/webui_url_constants.cc chrome/common/webui_url_constants.cc -index 248b6795e8cbe..c957f9d55613d 100644 +index 47932e80c59ea..805a9e8e3c3e6 100644 --- chrome/common/webui_url_constants.cc +++ chrome/common/webui_url_constants.cc @@ -99,6 +99,9 @@ base::span ChromeURLHosts() { diff --git a/patch/patches/chrome_browser_webui_version.patch b/patch/patches/chrome_browser_webui_version.patch index 81b7cf524..c122cb78f 100644 --- a/patch/patches/chrome_browser_webui_version.patch +++ b/patch/patches/chrome_browser_webui_version.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/webui/version/version_handler.cc chrome/browser/ui/webui/version/version_handler.cc -index 55541159e5fc8..8021d1d963f59 100644 +index 0ce1816cb372d..dfee4d62126b2 100644 --- chrome/browser/ui/webui/version/version_handler.cc +++ chrome/browser/ui/webui/version/version_handler.cc -@@ -27,12 +27,23 @@ +@@ -28,12 +28,23 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" @@ -27,7 +27,7 @@ index 55541159e5fc8..8021d1d963f59 100644 base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::MAY_BLOCK); -@@ -48,6 +59,19 @@ void GetFilePaths(const base::FilePath& profile_path, +@@ -49,6 +60,19 @@ void GetFilePaths(const base::FilePath& profile_path, *profile_path_out = profile_path.LossyDisplayName(); else *profile_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND); @@ -47,7 +47,7 @@ index 55541159e5fc8..8021d1d963f59 100644 } } // namespace -@@ -111,23 +135,46 @@ void VersionHandler::HandleRequestPathInfo(const base::Value::List& args) { +@@ -115,23 +139,46 @@ void VersionHandler::HandleRequestPathInfo(const base::Value::List& args) { // OnGotFilePaths. std::u16string* exec_path_buffer = new std::u16string; std::u16string* profile_path_buffer = new std::u16string; @@ -124,7 +124,7 @@ index 2f8162d7491d1..b00f0d5bf26ae 100644 // Factory for the creating refs in callbacks. base::WeakPtrFactory weak_ptr_factory_{this}; diff --git chrome/browser/ui/webui/version/version_ui.cc chrome/browser/ui/webui/version/version_ui.cc -index f12ad5b23e75c..0f07abc1b85f5 100644 +index d046b78cb5825..096c0c806cf85 100644 --- chrome/browser/ui/webui/version/version_ui.cc +++ chrome/browser/ui/webui/version/version_ui.cc @@ -22,6 +22,7 @@ @@ -135,7 +135,7 @@ index f12ad5b23e75c..0f07abc1b85f5 100644 #include "chrome/browser/browser_process_impl.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/version/version_handler.h" -@@ -69,6 +70,10 @@ +@@ -70,6 +71,10 @@ #include "chrome/browser/ui/webui/version/version_util_win.h" #endif @@ -146,18 +146,18 @@ index f12ad5b23e75c..0f07abc1b85f5 100644 using content::WebUIDataSource; namespace { -@@ -89,6 +94,10 @@ void CreateAndAddVersionUIDataSource(Profile* profile) { - {version_ui::kCommandLineName, IDS_VERSION_UI_COMMAND_LINE}, - {version_ui::kExecutablePathName, IDS_VERSION_UI_EXECUTABLE_PATH}, - {version_ui::kProfilePathName, IDS_VERSION_UI_PROFILE_PATH}, +@@ -90,6 +95,10 @@ void CreateAndAddVersionUIDataSource(Profile* profile) { + {version_ui::kCommandLineName, IDS_VERSION_UI_COMMAND_LINE}, + {version_ui::kExecutablePathName, IDS_VERSION_UI_EXECUTABLE_PATH}, + {version_ui::kProfilePathName, IDS_VERSION_UI_PROFILE_PATH}, +#if BUILDFLAG(ENABLE_CEF) -+ {version_ui::kModulePathName, IDS_VERSION_UI_MODULE_PATH}, -+ {version_ui::kUserDataPathName, IDS_VERSION_UI_USER_DATA_PATH}, ++ {version_ui::kModulePathName, IDS_VERSION_UI_MODULE_PATH}, ++ {version_ui::kUserDataPathName, IDS_VERSION_UI_USER_DATA_PATH}, +#endif - {version_ui::kVariationsName, IDS_VERSION_UI_VARIATIONS}, - {version_ui::kVariationsCmdName, IDS_VERSION_UI_VARIATIONS_CMD}, - {version_ui::kVariationsSeedName, IDS_VERSION_UI_VARIATIONS_SEED_NAME}, -@@ -126,6 +135,10 @@ void CreateAndAddVersionUIDataSource(Profile* profile) { + {version_ui::kVariationsName, IDS_VERSION_UI_VARIATIONS}, + {version_ui::kVariationsCmdName, IDS_VERSION_UI_VARIATIONS_CMD}, + {version_ui::kCopyVariationsLabel, IDS_VERSION_UI_COPY_VARIATIONS_LABEL}, +@@ -130,6 +139,10 @@ void CreateAndAddVersionUIDataSource(Profile* profile) { IDR_PRODUCT_LOGO_WHITE); #endif // BUILDFLAG(IS_ANDROID) html_source->SetDefaultResource(IDR_VERSION_UI_ABOUT_VERSION_HTML); @@ -168,7 +168,7 @@ index f12ad5b23e75c..0f07abc1b85f5 100644 } std::string GetProductModifier() { -@@ -246,6 +259,10 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { +@@ -247,6 +260,10 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { // blank. html_source->AddString(version_ui::kExecutablePath, std::string()); html_source->AddString(version_ui::kProfilePath, std::string()); @@ -202,10 +202,10 @@ index 913cf913dca7a..d79c330989149 100644 + } } diff --git components/version_ui/resources/about_version.css components/version_ui/resources/about_version.css -index 6b753d716b55d..58d6419be0165 100644 +index 839526405ef3f..fb2d6f3a98c00 100644 --- components/version_ui/resources/about_version.css +++ components/version_ui/resources/about_version.css -@@ -135,3 +135,7 @@ body { +@@ -138,3 +138,7 @@ body { position: fixed; width: 1px; } @@ -214,7 +214,7 @@ index 6b753d716b55d..58d6419be0165 100644 + font-size: 0.8em; +} diff --git components/version_ui/resources/about_version.html components/version_ui/resources/about_version.html -index 508c4ecfd790f..fed6933908951 100644 +index c04197bd7b397..7e461101115b1 100644 --- components/version_ui/resources/about_version.html +++ components/version_ui/resources/about_version.html @@ -62,9 +62,21 @@ about:version template page @@ -240,7 +240,7 @@ index 508c4ecfd790f..fed6933908951 100644 $i18n{application_label} -@@ -171,7 +183,15 @@ about:version template page +@@ -175,7 +187,15 @@ about:version template page $i18n{executable_path_name} $i18n{executable_path} @@ -257,7 +257,7 @@ index 508c4ecfd790f..fed6933908951 100644 $i18n{profile_path} -@@ -198,6 +218,17 @@ about:version template page +@@ -208,6 +228,17 @@ about:version template page $i18n{sanitizer} @@ -276,10 +276,10 @@ index 508c4ecfd790f..fed6933908951 100644