Compare commits
2 Commits
f1af6179f0
...
e9e2e1487f
Author | SHA1 | Date |
---|---|---|
Marshall Greenblatt | e9e2e1487f | |
Marshall Greenblatt | 62b2b5a80f |
|
@ -5,10 +5,13 @@
|
||||||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
|
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
|
||||||
load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application")
|
load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application")
|
||||||
load("//bazel:variables.bzl", "VERSION_PLIST")
|
load("//bazel:variables.bzl", "VERSION_PLIST")
|
||||||
load("//bazel/mac:variables.bzl", "MACOS_DEPLOYMENT_TARGET", "MACOS_BUNDLE_ID_BASE",
|
load("//bazel/mac:variables.bzl",
|
||||||
"COMMON_LINKOPTS")
|
"MACOS_DEPLOYMENT_TARGET",
|
||||||
|
"MACOS_BUNDLE_ID_BASE",
|
||||||
|
"CEF_FRAMEWORK_NAME",
|
||||||
|
"COMMON_LINKOPTS")
|
||||||
|
|
||||||
def _declare_helper_app(name, info_plist, deps, helper_base_name, helper_suffix):
|
def _declare_helper_app(name, info_plist, deps, helper_base_name, helper_suffix, **kwargs):
|
||||||
"""
|
"""
|
||||||
Creates a Helper .app target.
|
Creates a Helper .app target.
|
||||||
"""
|
"""
|
||||||
|
@ -43,6 +46,7 @@ def _declare_helper_app(name, info_plist, deps, helper_base_name, helper_suffix)
|
||||||
deps = [
|
deps = [
|
||||||
"@cef//:cef_sandbox",
|
"@cef//:cef_sandbox",
|
||||||
] + deps,
|
] + deps,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
HELPERS = {
|
HELPERS = {
|
||||||
|
@ -53,7 +57,7 @@ HELPERS = {
|
||||||
"HelperRenderer": "Renderer",
|
"HelperRenderer": "Renderer",
|
||||||
}
|
}
|
||||||
|
|
||||||
def declare_all_helper_apps(name, info_plist, deps):
|
def declare_all_helper_apps(name, info_plist, deps, **kwargs):
|
||||||
"""
|
"""
|
||||||
Creates all Helper .app targets.
|
Creates all Helper .app targets.
|
||||||
"""
|
"""
|
||||||
|
@ -63,9 +67,10 @@ def declare_all_helper_apps(name, info_plist, deps):
|
||||||
deps = deps,
|
deps = deps,
|
||||||
helper_base_name = h,
|
helper_base_name = h,
|
||||||
helper_suffix = v,
|
helper_suffix = v,
|
||||||
|
**kwargs,
|
||||||
) for h, v in HELPERS.items()]
|
) for h, v in HELPERS.items()]
|
||||||
|
|
||||||
def declare_main_app(name, info_plist, deps, resources, linkopts=[]):
|
def declare_main_app(name, info_plist, deps, resources, linkopts=[], **kwargs):
|
||||||
"""
|
"""
|
||||||
Creates the main .app target.
|
Creates the main .app target.
|
||||||
"""
|
"""
|
||||||
|
@ -92,6 +97,7 @@ def declare_main_app(name, info_plist, deps, resources, linkopts=[]):
|
||||||
":HelperGPU": "Frameworks",
|
":HelperGPU": "Frameworks",
|
||||||
":HelperPlugin": "Frameworks",
|
":HelperPlugin": "Frameworks",
|
||||||
":HelperRenderer": "Frameworks",
|
":HelperRenderer": "Frameworks",
|
||||||
|
"@cef//:cef_framework": "Frameworks/{}.framework".format(CEF_FRAMEWORK_NAME),
|
||||||
},
|
},
|
||||||
bundle_name = name,
|
bundle_name = name,
|
||||||
bundle_id = "{}.{}".format(MACOS_BUNDLE_ID_BASE, name.lower()),
|
bundle_id = "{}.{}".format(MACOS_BUNDLE_ID_BASE, name.lower()),
|
||||||
|
@ -102,7 +108,6 @@ def declare_main_app(name, info_plist, deps, resources, linkopts=[]):
|
||||||
target_compatible_with = [
|
target_compatible_with = [
|
||||||
"@platforms//os:macos",
|
"@platforms//os:macos",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = deps,
|
||||||
"@cef//:cef_framework",
|
**kwargs,
|
||||||
] + deps,
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -164,13 +164,14 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||||
virtual bool HasViewsHostedOpener() const { return false; }
|
virtual bool HasViewsHostedOpener() const { return false; }
|
||||||
|
|
||||||
// Same as OpenURLFromTab but only taking |navigation_handle_callback|
|
// Same as OpenURLFromTab but only taking |navigation_handle_callback|
|
||||||
// if the return value is non-nullptr.
|
// if the return value is false. Return false to cancel the navigation
|
||||||
virtual content::WebContents* OpenURLFromTabEx(
|
// or true to proceed with default chrome handling.
|
||||||
|
virtual bool OpenURLFromTabEx(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::OpenURLParams& params,
|
const content::OpenURLParams& params,
|
||||||
base::OnceCallback<void(content::NavigationHandle&)>&
|
base::OnceCallback<void(content::NavigationHandle&)>&
|
||||||
navigation_handle_callback) {
|
navigation_handle_callback) {
|
||||||
return nullptr;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -527,7 +527,7 @@ void ChromeBrowserDelegate::WebContentsCreated(
|
||||||
/*is_devtools_popup=*/false, opener);
|
/*is_devtools_popup=*/false, opener);
|
||||||
}
|
}
|
||||||
|
|
||||||
content::WebContents* ChromeBrowserDelegate::OpenURLFromTabEx(
|
bool ChromeBrowserDelegate::OpenURLFromTabEx(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::OpenURLParams& params,
|
const content::OpenURLParams& params,
|
||||||
base::OnceCallback<void(content::NavigationHandle&)>&
|
base::OnceCallback<void(content::NavigationHandle&)>&
|
||||||
|
@ -536,17 +536,31 @@ content::WebContents* ChromeBrowserDelegate::OpenURLFromTabEx(
|
||||||
// Reading List sidebar. In that case we default to using the Browser's
|
// Reading List sidebar. In that case we default to using the Browser's
|
||||||
// currently active WebContents.
|
// currently active WebContents.
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
// GetActiveWebContents() may return nullptr if we're in a new Browser
|
||||||
|
// created using ScopedTabbedBrowserDisplayer. This new Browser does
|
||||||
|
// not have a WebContents yet.
|
||||||
source = browser_->tab_strip_model()->GetActiveWebContents();
|
source = browser_->tab_strip_model()->GetActiveWebContents();
|
||||||
DCHECK(source);
|
}
|
||||||
|
if (!source) {
|
||||||
|
LOG(WARNING) << "Failed to identify target browser for "
|
||||||
|
<< params.url.spec();
|
||||||
|
// Proceed with default chrome handling.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return nullptr to cancel the navigation. Otherwise, proceed with default
|
|
||||||
// chrome handling.
|
|
||||||
if (auto delegate = GetDelegateForWebContents(source)) {
|
if (auto delegate = GetDelegateForWebContents(source)) {
|
||||||
return delegate->OpenURLFromTabEx(source, params,
|
// Returns nullptr to cancel the navigation.
|
||||||
navigation_handle_callback);
|
const bool cancel =
|
||||||
|
delegate->OpenURLFromTabEx(source, params,
|
||||||
|
navigation_handle_callback) == nullptr;
|
||||||
|
if (cancel) {
|
||||||
|
// Cancel the navigation.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
|
||||||
|
// Proceed with default chrome handling.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeBrowserDelegate::LoadingStateChanged(content::WebContents* source,
|
void ChromeBrowserDelegate::LoadingStateChanged(content::WebContents* source,
|
||||||
|
|
|
@ -90,11 +90,10 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||||
const std::optional<SkRegion> GetDraggableRegion() const override;
|
const std::optional<SkRegion> GetDraggableRegion() const override;
|
||||||
void WindowFullscreenStateChanged() override;
|
void WindowFullscreenStateChanged() override;
|
||||||
bool HasViewsHostedOpener() const override;
|
bool HasViewsHostedOpener() const override;
|
||||||
content::WebContents* OpenURLFromTabEx(
|
bool OpenURLFromTabEx(content::WebContents* source,
|
||||||
content::WebContents* source,
|
const content::OpenURLParams& params,
|
||||||
const content::OpenURLParams& params,
|
base::OnceCallback<void(content::NavigationHandle&)>&
|
||||||
base::OnceCallback<void(content::NavigationHandle&)>&
|
navigation_handle_callback) override;
|
||||||
navigation_handle_callback) override;
|
|
||||||
|
|
||||||
// WebContentsDelegate methods:
|
// WebContentsDelegate methods:
|
||||||
void WebContentsCreated(content::WebContents* source_contents,
|
void WebContentsCreated(content::WebContents* source_contents,
|
||||||
|
|
|
@ -289,6 +289,10 @@ patches = [
|
||||||
# alloy: Support override of DownloadPrefs::FromBrowserContext
|
# alloy: Support override of DownloadPrefs::FromBrowserContext
|
||||||
# chrome: Support custom DownloadManagerDelegate handling.
|
# chrome: Support custom DownloadManagerDelegate handling.
|
||||||
# https://github.com/chromiumembedded/cef/issues/3681
|
# https://github.com/chromiumembedded/cef/issues/3681
|
||||||
|
#
|
||||||
|
# chrome: Allow routing of Download bubble file open to non-Tabbed
|
||||||
|
# source browser.
|
||||||
|
# https://github.com/chromiumembedded/cef/issues/3750
|
||||||
'name': 'chrome_browser_download',
|
'name': 'chrome_browser_download',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -154,7 +154,7 @@ index 49e6bdcbd55a6..0425eb49c4296 100644
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
|
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
|
||||||
index a7a3a0722bcbe..53051e86f03c1 100644
|
index a7a3a0722bcbe..4a9ce76019fc3 100644
|
||||||
--- chrome/browser/ui/browser.cc
|
--- chrome/browser/ui/browser.cc
|
||||||
+++ chrome/browser/ui/browser.cc
|
+++ chrome/browser/ui/browser.cc
|
||||||
@@ -271,6 +271,25 @@
|
@@ -271,6 +271,25 @@
|
||||||
|
@ -252,24 +252,22 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Browser::TabsNeedBeforeUnloadFired() const {
|
bool Browser::TabsNeedBeforeUnloadFired() const {
|
||||||
@@ -1798,6 +1847,16 @@ WebContents* Browser::OpenURLFromTab(
|
@@ -1798,6 +1847,14 @@ WebContents* Browser::OpenURLFromTab(
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
|
|
||||||
+#if BUILDFLAG(ENABLE_CEF)
|
+#if BUILDFLAG(ENABLE_CEF)
|
||||||
+ if (cef_browser_delegate_) {
|
+ if (cef_browser_delegate_ &&
|
||||||
+ auto web_contents =
|
+ !cef_browser_delegate_->OpenURLFromTabEx(source, params,
|
||||||
+ cef_browser_delegate_->OpenURLFromTabEx(source, params,
|
+ navigation_handle_callback)) {
|
||||||
+ navigation_handle_callback);
|
+ return nullptr;
|
||||||
+ if (!web_contents)
|
|
||||||
+ return nullptr;
|
|
||||||
+ }
|
+ }
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
NavigateParams nav_params(this, params.url, params.transition);
|
NavigateParams nav_params(this, params.url, params.transition);
|
||||||
nav_params.FillNavigateParamsFromOpenURLParams(params);
|
nav_params.FillNavigateParamsFromOpenURLParams(params);
|
||||||
nav_params.source_contents = source;
|
nav_params.source_contents = source;
|
||||||
@@ -1960,6 +2019,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
@@ -1960,6 +2017,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
||||||
bool should_show_loading_ui) {
|
bool should_show_loading_ui) {
|
||||||
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
|
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
|
||||||
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
|
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
|
||||||
|
@ -278,7 +276,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::CloseContents(WebContents* source) {
|
void Browser::CloseContents(WebContents* source) {
|
||||||
@@ -1988,6 +2049,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
@@ -1988,6 +2047,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||||
|
@ -287,7 +285,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
if (!GetStatusBubble())
|
if (!GetStatusBubble())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1995,6 +2058,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
@@ -1995,6 +2056,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||||
GetStatusBubble()->SetURL(url);
|
GetStatusBubble()->SetURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +303,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
void Browser::ContentsMouseEvent(WebContents* source, const ui::Event& event) {
|
void Browser::ContentsMouseEvent(WebContents* source, const ui::Event& event) {
|
||||||
const ui::EventType type = event.type();
|
const ui::EventType type = event.type();
|
||||||
const bool exited = type == ui::ET_MOUSE_EXITED;
|
const bool exited = type == ui::ET_MOUSE_EXITED;
|
||||||
@@ -2022,6 +2096,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
|
@@ -2022,6 +2094,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +323,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
void Browser::BeforeUnloadFired(WebContents* web_contents,
|
void Browser::BeforeUnloadFired(WebContents* web_contents,
|
||||||
bool proceed,
|
bool proceed,
|
||||||
bool* proceed_to_fire_unload) {
|
bool* proceed_to_fire_unload) {
|
||||||
@@ -2121,12 +2208,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
@@ -2121,12 +2206,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
||||||
|
|
||||||
// Make the tab show up in the task manager.
|
// Make the tab show up in the task manager.
|
||||||
task_manager::WebContentsTags::CreateForTabContents(new_contents);
|
task_manager::WebContentsTags::CreateForTabContents(new_contents);
|
||||||
|
@ -350,7 +348,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
// Don't show the page hung dialog when a HTML popup hangs because
|
// Don't show the page hung dialog when a HTML popup hangs because
|
||||||
// the dialog will take the focus and immediately close the popup.
|
// the dialog will take the focus and immediately close the popup.
|
||||||
RenderWidgetHostView* view = render_widget_host->GetView();
|
RenderWidgetHostView* view = render_widget_host->GetView();
|
||||||
@@ -2139,6 +2238,13 @@ void Browser::RendererUnresponsive(
|
@@ -2139,6 +2236,13 @@ void Browser::RendererUnresponsive(
|
||||||
void Browser::RendererResponsive(
|
void Browser::RendererResponsive(
|
||||||
WebContents* source,
|
WebContents* source,
|
||||||
content::RenderWidgetHost* render_widget_host) {
|
content::RenderWidgetHost* render_widget_host) {
|
||||||
|
@ -364,7 +362,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
RenderWidgetHostView* view = render_widget_host->GetView();
|
RenderWidgetHostView* view = render_widget_host->GetView();
|
||||||
if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) {
|
if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) {
|
||||||
TabDialogs::FromWebContents(source)->HideHungRendererDialog(
|
TabDialogs::FromWebContents(source)->HideHungRendererDialog(
|
||||||
@@ -2148,6 +2254,15 @@ void Browser::RendererResponsive(
|
@@ -2148,6 +2252,15 @@ void Browser::RendererResponsive(
|
||||||
|
|
||||||
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
|
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
|
||||||
WebContents* source) {
|
WebContents* source) {
|
||||||
|
@ -380,7 +378,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
return javascript_dialogs::TabModalDialogManager::FromWebContents(source);
|
return javascript_dialogs::TabModalDialogManager::FromWebContents(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2183,6 +2298,11 @@ void Browser::DraggableRegionsChanged(
|
@@ -2183,6 +2296,11 @@ void Browser::DraggableRegionsChanged(
|
||||||
if (app_controller_) {
|
if (app_controller_) {
|
||||||
app_controller_->DraggableRegionsChanged(regions, contents);
|
app_controller_->DraggableRegionsChanged(regions, contents);
|
||||||
}
|
}
|
||||||
|
@ -392,7 +390,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::DidFinishNavigation(
|
void Browser::DidFinishNavigation(
|
||||||
@@ -2263,11 +2383,15 @@ void Browser::EnterFullscreenModeForTab(
|
@@ -2263,11 +2381,15 @@ void Browser::EnterFullscreenModeForTab(
|
||||||
const blink::mojom::FullscreenOptions& options) {
|
const blink::mojom::FullscreenOptions& options) {
|
||||||
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
||||||
requesting_frame, options.display_id);
|
requesting_frame, options.display_id);
|
||||||
|
@ -408,7 +406,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
|
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
|
||||||
@@ -2467,6 +2591,15 @@ void Browser::RequestMediaAccessPermission(
|
@@ -2467,6 +2589,15 @@ void Browser::RequestMediaAccessPermission(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const content::MediaStreamRequest& request,
|
const content::MediaStreamRequest& request,
|
||||||
content::MediaResponseCallback callback) {
|
content::MediaResponseCallback callback) {
|
||||||
|
@ -424,7 +422,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
const extensions::Extension* extension =
|
const extensions::Extension* extension =
|
||||||
GetExtensionForOrigin(profile_, request.security_origin);
|
GetExtensionForOrigin(profile_, request.security_origin);
|
||||||
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
|
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
|
||||||
@@ -3011,9 +3144,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
|
@@ -3011,9 +3142,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
|
||||||
// Browser, Getters for UI (private):
|
// Browser, Getters for UI (private):
|
||||||
|
|
||||||
StatusBubble* Browser::GetStatusBubble() {
|
StatusBubble* Browser::GetStatusBubble() {
|
||||||
|
@ -437,7 +435,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
// We hide the status bar for web apps windows as this matches native
|
// We hide the status bar for web apps windows as this matches native
|
||||||
@@ -3021,6 +3156,12 @@ StatusBubble* Browser::GetStatusBubble() {
|
@@ -3021,6 +3154,12 @@ StatusBubble* Browser::GetStatusBubble() {
|
||||||
// mode, as the minimal browser UI includes the status bar.
|
// mode, as the minimal browser UI includes the status bar.
|
||||||
if (web_app::AppBrowserController::IsWebApp(this) &&
|
if (web_app::AppBrowserController::IsWebApp(this) &&
|
||||||
!app_controller()->HasMinimalUiButtons()) {
|
!app_controller()->HasMinimalUiButtons()) {
|
||||||
|
@ -450,7 +448,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3170,6 +3311,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
@@ -3170,6 +3309,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
||||||
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
|
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
|
||||||
web_contents_collection_.StopObserving(web_contents);
|
web_contents_collection_.StopObserving(web_contents);
|
||||||
}
|
}
|
||||||
|
@ -459,7 +457,7 @@ index a7a3a0722bcbe..53051e86f03c1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::TabDetachedAtImpl(content::WebContents* contents,
|
void Browser::TabDetachedAtImpl(content::WebContents* contents,
|
||||||
@@ -3324,6 +3467,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
|
@@ -3324,6 +3465,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
|
||||||
|
|
||||||
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
|
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
|
||||||
bool check_can_support) const {
|
bool check_can_support) const {
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
diff --git chrome/browser/download/chrome_download_manager_delegate.cc chrome/browser/download/chrome_download_manager_delegate.cc
|
diff --git chrome/browser/download/chrome_download_manager_delegate.cc chrome/browser/download/chrome_download_manager_delegate.cc
|
||||||
index bd2c41e30f01e..d87b8baf3de2b 100644
|
index bd2c41e30f01e..e57592e75dec7 100644
|
||||||
--- chrome/browser/download/chrome_download_manager_delegate.cc
|
--- chrome/browser/download/chrome_download_manager_delegate.cc
|
||||||
+++ chrome/browser/download/chrome_download_manager_delegate.cc
|
+++ chrome/browser/download/chrome_download_manager_delegate.cc
|
||||||
@@ -150,6 +150,10 @@
|
@@ -30,6 +30,7 @@
|
||||||
|
#include "base/time/time.h"
|
||||||
|
#include "build/build_config.h"
|
||||||
|
#include "build/chromeos_buildflags.h"
|
||||||
|
+#include "cef/libcef/features/features.h"
|
||||||
|
#include "chrome/browser/browser_process.h"
|
||||||
|
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
|
||||||
|
#include "chrome/browser/download/download_core_service.h"
|
||||||
|
@@ -150,6 +151,10 @@
|
||||||
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
|
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,7 +21,7 @@ index bd2c41e30f01e..d87b8baf3de2b 100644
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
using content::DownloadManager;
|
using content::DownloadManager;
|
||||||
using download::DownloadItem;
|
using download::DownloadItem;
|
||||||
@@ -500,6 +504,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
|
@@ -500,6 +505,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
|
||||||
download_dialog_bridge_ = std::make_unique<DownloadDialogBridge>();
|
download_dialog_bridge_ = std::make_unique<DownloadDialogBridge>();
|
||||||
download_message_bridge_ = std::make_unique<DownloadMessageBridge>();
|
download_message_bridge_ = std::make_unique<DownloadMessageBridge>();
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,7 +33,7 @@ index bd2c41e30f01e..d87b8baf3de2b 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() {
|
ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() {
|
||||||
@@ -559,6 +568,9 @@ void ChromeDownloadManagerDelegate::Shutdown() {
|
@@ -559,6 +569,9 @@ void ChromeDownloadManagerDelegate::Shutdown() {
|
||||||
download_manager_->RemoveObserver(this);
|
download_manager_->RemoveObserver(this);
|
||||||
download_manager_ = nullptr;
|
download_manager_ = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +43,7 @@ index bd2c41e30f01e..d87b8baf3de2b 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeDownloadManagerDelegate::OnDownloadCanceledAtShutdown(
|
void ChromeDownloadManagerDelegate::OnDownloadCanceledAtShutdown(
|
||||||
@@ -627,6 +639,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
|
@@ -627,6 +640,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
|
||||||
ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload);
|
ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +56,20 @@ index bd2c41e30f01e..d87b8baf3de2b 100644
|
||||||
DownloadTargetDeterminer::CompletionCallback target_determined_callback =
|
DownloadTargetDeterminer::CompletionCallback target_determined_callback =
|
||||||
base::BindOnce(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined,
|
base::BindOnce(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined,
|
||||||
weak_ptr_factory_.GetWeakPtr(), download->GetId(),
|
weak_ptr_factory_.GetWeakPtr(), download->GetId(),
|
||||||
|
@@ -1015,8 +1034,11 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
|
||||||
|
Browser* browser =
|
||||||
|
web_contents ? chrome::FindBrowserWithTab(web_contents) : nullptr;
|
||||||
|
std::unique_ptr<chrome::ScopedTabbedBrowserDisplayer> browser_displayer;
|
||||||
|
- if (!browser ||
|
||||||
|
- !browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) {
|
||||||
|
+ if (!browser
|
||||||
|
+#if !BUILDFLAG(ENABLE_CEF)
|
||||||
|
+ || !browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)
|
||||||
|
+#endif
|
||||||
|
+ ) {
|
||||||
|
browser_displayer =
|
||||||
|
std::make_unique<chrome::ScopedTabbedBrowserDisplayer>(profile_);
|
||||||
|
browser = browser_displayer->browser();
|
||||||
diff --git chrome/browser/download/chrome_download_manager_delegate.h chrome/browser/download/chrome_download_manager_delegate.h
|
diff --git chrome/browser/download/chrome_download_manager_delegate.h chrome/browser/download/chrome_download_manager_delegate.h
|
||||||
index af7f1d5fac12b..1cb1d01464c11 100644
|
index af7f1d5fac12b..1cb1d01464c11 100644
|
||||||
--- chrome/browser/download/chrome_download_manager_delegate.h
|
--- chrome/browser/download/chrome_download_manager_delegate.h
|
||||||
|
|
|
@ -7,8 +7,8 @@ package(default_visibility = [
|
||||||
"//visibility:public",
|
"//visibility:public",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
load("@aspect_bazel_lib//lib:copy_directory.bzl", "copy_directory")
|
||||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||||
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_dynamic_framework_import")
|
|
||||||
load("//bazel:library_helpers.bzl", "declare_cc_library", "declare_objc_library")
|
load("//bazel:library_helpers.bzl", "declare_cc_library", "declare_objc_library")
|
||||||
load("//bazel/win:variables.bzl",
|
load("//bazel/win:variables.bzl",
|
||||||
WIN_DLLS="DLLS",
|
WIN_DLLS="DLLS",
|
||||||
|
@ -309,10 +309,15 @@ alias(
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
apple_dynamic_framework_import(
|
# Copy the CEF framework into the app bundle but do not link it. See
|
||||||
|
# https://groups.google.com/g/cef-announce/c/Fith0A3kWtw/m/6ds_mJVMCQAJ
|
||||||
|
# for background. Use `copy_directory` instead of `filegroup` to remove
|
||||||
|
# the Debug/Release path prefix.
|
||||||
|
copy_directory(
|
||||||
name = "cef_framework",
|
name = "cef_framework",
|
||||||
framework_imports = select({
|
src = select({
|
||||||
"@cef//:dbg": glob(["Debug/{}.framework/**".format(CEF_FRAMEWORK_NAME)]),
|
"@cef//:dbg": "Debug/{}.framework".format(CEF_FRAMEWORK_NAME),
|
||||||
"//conditions:default": glob(["Release/{}.framework/**".format(CEF_FRAMEWORK_NAME)]),
|
"//conditions:default": "Release/{}.framework".format(CEF_FRAMEWORK_NAME),
|
||||||
}),
|
}),
|
||||||
|
out = "{}.framework".format(CEF_FRAMEWORK_NAME),
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,3 +15,4 @@ bazel_dep(name = "rules_apple", version = "3.6.0", repo_name = "build_bazel_rule
|
||||||
bazel_dep(name = "rules_cc", version = "0.0.9")
|
bazel_dep(name = "rules_cc", version = "0.0.9")
|
||||||
|
|
||||||
# Add other dependencies here.
|
# Add other dependencies here.
|
||||||
|
bazel_dep(name = "aspect_bazel_lib", version = "2.7.9")
|
||||||
|
|
Loading…
Reference in New Issue