#include "chrome/browser/download/bubble/download_display_controller.h"
#include "base/functional/bind.h"
#include "base/numerics/safe_conversions.h"
#include "base/power_monitor/power_monitor.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "chrome/browser/download/bubble/download_bubble_display_info.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/download/bubble/download_bubble_ui_controller.h"
#include "chrome/browser/download/bubble/download_bubble_utils.h"
#include "chrome/browser/download/download_core_service.h"
#include "chrome/browser/download/download_core_service_factory.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/download/download_ui_controller.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/download/download_item_mode.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "components/download/public/common/download_danger_type.h"
#include "components/offline_items_collection/core/offline_item.h"
#include "components/offline_items_collection/core/offline_item_state.h"
#if BUILDFLAG(IS_MAC)
#include "chrome/browser/ui/fullscreen_util_mac.h"
#endif
namespace {
DownloadIconActive;
DownloadIconState;
DownloadUIModelPtr;
constexpr base::TimeDelta kToolbarIconVisibilityTimeInterval = …;
constexpr base::TimeDelta kToolbarIconActiveTimeInterval = …;
bool IsAllDone(const DownloadBubbleDisplayInfo& info) { … }
bool HasRecentCompleteDownload(base::TimeDelta interval,
base::Time last_complete_time) { … }
Browser* FindMostRecentBrowserForProfileMatchingWebApp(
Profile* profile,
const webapps::AppId* app_id) { … }
}
DownloadDisplayController::DownloadDisplayController(
DownloadDisplay* display,
Browser* browser,
DownloadBubbleUIController* bubble_controller)
: … { … }
DownloadDisplayController::~DownloadDisplayController() { … }
void DownloadDisplayController::OnNewItem(bool show_animation) { … }
void DownloadDisplayController::OnUpdatedItem(bool is_done,
bool may_show_details) { … }
void DownloadDisplayController::OnRemovedItem(const ContentId& id) { … }
void DownloadDisplayController::OnButtonPressed() { … }
void DownloadDisplayController::HandleButtonPressed() { … }
void DownloadDisplayController::ShowToolbarButton() { … }
void DownloadDisplayController::HideToolbarButton() { … }
void DownloadDisplayController::HideBubble() { … }
bool DownloadDisplayController::OpenMostSpecificDialog(
const offline_items_collection::ContentId& content_id) { … }
void DownloadDisplayController::ListenToFullScreenChanges() { … }
void DownloadDisplayController::OnFullscreenStateChanged() { … }
void DownloadDisplayController::OnResume() { … }
void DownloadDisplayController::OpenSecuritySubpage(
const offline_items_collection::ContentId& id) { … }
void DownloadDisplayController::UpdateToolbarButtonState(
const DownloadBubbleDisplayInfo& info,
const DownloadDisplay::ProgressInfo& progress_info) { … }
void DownloadDisplayController::UpdateDownloadIconToInactive() { … }
const DownloadBubbleDisplayInfo&
DownloadDisplayController::UpdateButtonStateFromUpdateService() { … }
void DownloadDisplayController::HandleAccessibleAlerts() { … }
void DownloadDisplayController::ScheduleToolbarDisappearance(
base::TimeDelta interval) { … }
void DownloadDisplayController::ScheduleToolbarInactive(
base::TimeDelta interval) { … }
void DownloadDisplayController::MaybeShowButtonWhenCreated() { … }