#include "chrome/browser/ui/download/download_bubble_security_view_info.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_item_warning_data.h"
#include "chrome/browser/download/download_ui_safe_browsing_util.h"
#include "chrome/browser/download/offline_item_utils.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/safe_browsing/advanced_protection_status_manager.h"
#include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/offline_items_collection/core/fail_state.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
DownloadItem;
TailoredWarningType;
FailState;
DownloadBubbleSecurityViewInfoObserver::
DownloadBubbleSecurityViewInfoObserver() = default;
DownloadBubbleSecurityViewInfoObserver::
~DownloadBubbleSecurityViewInfoObserver() = default;
DownloadBubbleSecurityViewInfo::SubpageButton::SubpageButton(
DownloadCommands::Command command,
std::u16string label,
bool is_prominent,
std::optional<ui::ColorId> text_color)
: … { … }
DownloadBubbleSecurityViewInfo::DownloadBubbleSecurityViewInfo() = default;
DownloadBubbleSecurityViewInfo::~DownloadBubbleSecurityViewInfo() = default;
void DownloadBubbleSecurityViewInfo::InitializeForDownload(
DownloadUIModel& model) { … }
void DownloadBubbleSecurityViewInfo::SetSubpageButtonsForTesting(
std::vector<SubpageButton> buttons) { … }
bool DownloadBubbleSecurityViewInfo::HasSubpage() const { … }
void DownloadBubbleSecurityViewInfo::OnDownloadUpdated(
download::DownloadItem* download) { … }
void DownloadBubbleSecurityViewInfo::OnDownloadRemoved(
download::DownloadItem* download) { … }
void DownloadBubbleSecurityViewInfo::Reset() { … }
void DownloadBubbleSecurityViewInfo::ClearForUpdate() { … }
void DownloadBubbleSecurityViewInfo::PopulateForDownload(
download::DownloadItem* download) { … }
void DownloadBubbleSecurityViewInfo::PopulateForDangerousUi(
const std::u16string& subpage_summary) { … }
void DownloadBubbleSecurityViewInfo::PopulateForSuspiciousUi(
const std::u16string& subpage_summary,
const std::u16string& secondary_subpage_button_label) { … }
void DownloadBubbleSecurityViewInfo::PopulateForInterrupted(
const DownloadUIModel& model) { … }
void DownloadBubbleSecurityViewInfo::PopulateForInProgressOrComplete(
const DownloadUIModel& model) { … }
void DownloadBubbleSecurityViewInfo::PopulateForTailoredWarning(
const DownloadUIModel& model) { … }
void DownloadBubbleSecurityViewInfo::PopulateForFileTypeWarningNoSafeBrowsing(
const DownloadUIModel& model) { … }
void DownloadBubbleSecurityViewInfo::PopulateLearnMoreLink(
const std::u16string& link_text,
DownloadCommands::Command command) { … }
void DownloadBubbleSecurityViewInfo::PopulateLearnMoreLink(
int label_text_id,
int link_text_id,
DownloadCommands::Command command) { … }
void DownloadBubbleSecurityViewInfo::PopulatePrimarySubpageButton(
const std::u16string& label,
DownloadCommands::Command command,
bool is_prominent) { … }
void DownloadBubbleSecurityViewInfo::PopulateSecondarySubpageButton(
const std::u16string& label,
DownloadCommands::Command command,
std::optional<ui::ColorId> color) { … }