diff --git a/chromium_src/chrome/browser/download/bubble/download_display_controller.cc b/chromium_src/chrome/browser/download/bubble/download_display_controller.cc index 82cdc3847a30..95cca93064d0 100644 --- a/chromium_src/chrome/browser/download/bubble/download_display_controller.cc +++ b/chromium_src/chrome/browser/download/bubble/download_display_controller.cc @@ -12,10 +12,10 @@ #undef DownloadDisplayController void DownloadDisplayController::UpdateToolbarButtonState( - std::vector>& all_models) { - DownloadDisplayControllerChromium::UpdateToolbarButtonState(all_models); + const AllDownloadUIModelsInfo& info) { + DownloadDisplayControllerChromium::UpdateToolbarButtonState(info); - if (all_models.empty()) { + if (info.all_models_size == 0) { return; } @@ -26,10 +26,7 @@ void DownloadDisplayController::UpdateToolbarButtonState( // Show toolbar if there's at least one in-progress download item. // Upstream doesn't show toolbar button when only dangerous files are // in-progress. - for (const auto& model : all_models) { - if (model->GetState() == download::DownloadItem::IN_PROGRESS) { - ShowToolbarButton(); - return; - } + if (info.in_progress_count || info.has_deep_scanning) { + ShowToolbarButton(); } } diff --git a/chromium_src/chrome/browser/download/bubble/download_display_controller.h b/chromium_src/chrome/browser/download/bubble/download_display_controller.h index 46eaca994507..a3967f3e3260 100644 --- a/chromium_src/chrome/browser/download/bubble/download_display_controller.h +++ b/chromium_src/chrome/browser/download/bubble/download_display_controller.h @@ -28,8 +28,7 @@ class DownloadDisplayController : public DownloadDisplayControllerChromium { using DownloadDisplayControllerChromium::DownloadDisplayControllerChromium; private: - void UpdateToolbarButtonState( - std::vector>& all_models) override; + void UpdateToolbarButtonState(const AllDownloadUIModelsInfo& info) override; }; #endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_DOWNLOAD_BUBBLE_DOWNLOAD_DISPLAY_CONTROLLER_H_