mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Route Download bubble file open to OnOpenURLFromTab (fixes #3750)
Some downloaded file types [1] default to opening in a Browser. Open requests for these file types originating from the Download bubble UI should route to the source Browser (call OnOpenURLFromTab). If OnOpenURLFromTab is unhandled proceed with the default Chrome behavior of opening the URL in a new default Browser. [1] PDF, html, etc. For the complete list of file types see ChromeDownloadManagerDelegate::IsOpenInBrowserPreferredForFile.
This commit is contained in:
@@ -164,13 +164,14 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
virtual bool HasViewsHostedOpener() const { return false; }
|
||||
|
||||
// Same as OpenURLFromTab but only taking |navigation_handle_callback|
|
||||
// if the return value is non-nullptr.
|
||||
virtual content::WebContents* OpenURLFromTabEx(
|
||||
// if the return value is false. Return false to cancel the navigation
|
||||
// or true to proceed with default chrome handling.
|
||||
virtual bool OpenURLFromTabEx(
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params,
|
||||
base::OnceCallback<void(content::NavigationHandle&)>&
|
||||
navigation_handle_callback) {
|
||||
return nullptr;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user