diff --git a/chromium_src/chrome/browser/download/download_file_picker.cc b/chromium_src/chrome/browser/download/download_file_picker.cc index 0329cf5c5330..1e135fa93249 100644 --- a/chromium_src/chrome/browser/download/download_file_picker.cc +++ b/chromium_src/chrome/browser/download/download_file_picker.cc @@ -5,10 +5,12 @@ #include +#include "components/download/public/common/download_item.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h" #include "ui/shell_dialogs/select_file_dialog.h" +#include "url/origin.h" #if !BUILDFLAG(IS_ANDROID) #include "brave/browser/ui/brave_file_select_utils.h" @@ -17,7 +19,8 @@ namespace { std::u16string GetTitle(content::RenderFrameHost* render_frame_host, - const std::u16string& original_title) { + const std::u16string& original_title, + const GURL& caller) { #if BUILDFLAG(IS_ANDROID) return original_title; #else @@ -26,18 +29,17 @@ std::u16string GetTitle(content::RenderFrameHost* render_frame_host, } return brave::GetFileSelectTitle( content::WebContents::FromRenderFrameHost(render_frame_host), - render_frame_host->GetLastCommittedOrigin(), - brave::FileSelectTitleType::kSave); + url::Origin::Create(caller), brave::FileSelectTitleType::kSave); #endif } } // namespace // Override title of the file select dialog for downloads. -#define SelectFile(type, title, default_path, file_types, file_type_index, \ - default_extension, owning_window, caller) \ - SelectFile(type, GetTitle(render_frame_host, title), default_path, \ - file_types, file_type_index, default_extension, owning_window, \ +#define SelectFile(type, title, default_path, file_types, file_type_index, \ + default_extension, owning_window, caller) \ + SelectFile(type, GetTitle(render_frame_host, title, *caller), default_path, \ + file_types, file_type_index, default_extension, owning_window, \ caller) #include "src/chrome/browser/download/download_file_picker.cc"