diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc index 4c97a54072fd70..cbd9e0aa756f3c 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.cc @@ -316,10 +316,7 @@ views::View* DownloadBubbleRowView::GetTooltipHandlerForPoint( void DownloadBubbleRowView::OnMainButtonPressed() { if (ui_info_.has_subpage) { - SetEnabled(false); - model_->RemoveObserver(this); - navigation_handler_->OpenSecurityDialog(std::move(model_), ui_info_); - // |this| is deleted now. + navigation_handler_->OpenSecurityDialog(this); } else { DownloadCommands(model_->GetWeakPtr()) .ExecuteCommand(DownloadCommands::OPEN_WHEN_COMPLETE); diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h index defd5dbde95e5f..d8844c0f3ddce3 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h @@ -61,6 +61,10 @@ class DownloadBubbleRowView : public HoverButton, // views::ViewTargeterDelegate: views::View* TargetForRect(views::View* root, const gfx::Rect& rect) override; + DownloadUIModel* model() { return model_.get(); } + + DownloadUIModel::BubbleUIInfo& ui_info() { return ui_info_; } + protected: // Overrides ui::LayerDelegate: void OnDeviceScaleFactorChanged(float old_device_scale_factor, diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc index b5ddbf81a4ab18..d1c09ccbad2742 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.cc @@ -7,6 +7,7 @@ #include "chrome/browser/download/bubble/download_bubble_controller.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "chrome/browser/ui/views/download/bubble/download_bubble_row_view.h" #include "chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h" #include "chrome/grit/generated_resources.h" #include "components/strings/grit/components_strings.h" @@ -25,7 +26,15 @@ namespace { constexpr int kCheckboxHeight = 32; -constexpr int kBuffer = 40; +constexpr auto kCommandToButtons = base::MakeFixedFlatMap< + DownloadCommands::Command, + raw_ptr DownloadBubbleSecurityView::*>( + {{DownloadCommands::DISCARD, &DownloadBubbleSecurityView::discard_button_}, + {DownloadCommands::KEEP, &DownloadBubbleSecurityView::keep_button_}, + {DownloadCommands::DEEP_SCAN, + &DownloadBubbleSecurityView::deep_scan_button_}, + {DownloadCommands::BYPASS_DEEP_SCANNING, + &DownloadBubbleSecurityView::bypass_deep_scan_button_}}); } // namespace void DownloadBubbleSecurityView::AddHeader() { @@ -48,20 +57,19 @@ void DownloadBubbleSecurityView::AddHeader() { back_button->SetProperty(views::kCrossAxisAlignmentKey, views::LayoutAlignment::kStart); - auto* title = header->AddChildView(std::make_unique( - model_->GetFileNameToReportUser().LossyDisplayName(), - views::style::CONTEXT_DIALOG_TITLE, views::style::STYLE_PRIMARY)); - title->SetProperty( + title_ = header->AddChildView(std::make_unique( + std::u16string(), views::style::CONTEXT_DIALOG_TITLE, + views::style::STYLE_PRIMARY)); + title_->SetProperty( views::kFlexBehaviorKey, views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero, views::MaximumFlexSizeRule::kUnbounded, - /*adjust_height_for_width=*/true) - .WithWeight(1)); + /*adjust_height_for_width=*/false)); const int icon_label_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_LABEL_HORIZONTAL); - title->SetProperty(views::kMarginsKey, - gfx::Insets::VH(0, icon_label_spacing)); - title->SetHorizontalAlignment(gfx::ALIGN_LEFT); + title_->SetProperty(views::kMarginsKey, + gfx::Insets::VH(0, icon_label_spacing)); + title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); auto* close_button = header->AddChildView(views::CreateVectorImageButtonWithNativeTheme( @@ -75,6 +83,12 @@ void DownloadBubbleSecurityView::AddHeader() { views::LayoutAlignment::kStart); } +void DownloadBubbleSecurityView::UpdateHeader() { + title_->SetText(download_row_view_->model() + ->GetFileNameToReportUser() + .LossyDisplayName()); +} + void DownloadBubbleSecurityView::CloseBubble() { navigation_handler_->CloseDialog( views::Widget::ClosedReason::kCloseButtonClicked); @@ -82,17 +96,44 @@ void DownloadBubbleSecurityView::CloseBubble() { void DownloadBubbleSecurityView::OnCheckboxClicked() { first_button_->SetEnabled(checkbox_->GetChecked()); - first_button_->SetEnabledTextColors( - GetColorProvider()->GetColor(info_.secondary_color)); + first_button_->SetEnabledTextColors(GetColorProvider()->GetColor( + download_row_view_->ui_info().secondary_color)); } -void DownloadBubbleSecurityView::AddIconAndText() { +void DownloadBubbleSecurityView::UpdateIconAndText() { + DownloadUIModel::BubbleUIInfo& ui_info = download_row_view_->ui_info(); + icon_->SetImage(ui::ImageModel::FromVectorIcon( + *(ui_info.icon_model_override), ui_info.secondary_color, + GetLayoutConstant(DOWNLOAD_ICON_SIZE))); + + styled_label_->SetText(ui_info.warning_summary); + // The label defaults to a single line, which would force the dialog wider; + // instead give it a width that's the minimum we want it to have. Then the + // Layout will stretch it back out into any additional space available. + // The side margin is added twice, once in the bubble, and then for each + // row view. const int side_margin = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_CONTROL_VERTICAL); const int icon_label_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_LABEL_HORIZONTAL); const int bubble_width = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_BUBBLE_PREFERRED_WIDTH); + const int min_label_width = + bubble_width - side_margin * 4 - GetLayoutConstant(DOWNLOAD_ICON_SIZE) - + GetLayoutInsets(DOWNLOAD_ICON).width() - icon_label_spacing; + styled_label_->SizeToFit(min_label_width); + + checkbox_->SetVisible(ui_info.has_checkbox); + if (ui_info.has_checkbox) { + checkbox_->SetText(ui_info.checkbox_label); + } +} + +void DownloadBubbleSecurityView::AddIconAndText() { + const int side_margin = ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL); + const int icon_label_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_LABEL_HORIZONTAL); auto* icon_text_row = AddChildView(std::make_unique()); icon_text_row->SetLayoutManager(std::make_unique()) @@ -100,77 +141,92 @@ void DownloadBubbleSecurityView::AddIconAndText() { .SetCrossAxisAlignment(views::LayoutAlignment::kStart); icon_text_row->SetProperty(views::kMarginsKey, gfx::Insets(side_margin)); - auto* icon = - icon_text_row->AddChildView(std::make_unique()); - icon->SetProperty(views::kMarginsKey, GetLayoutInsets(DOWNLOAD_ICON)); - icon->SetImage(ui::ImageModel::FromVectorIcon( - *info_.icon_model_override, info_.secondary_color, - GetLayoutConstant(DOWNLOAD_ICON_SIZE))); + icon_ = icon_text_row->AddChildView(std::make_unique()); + icon_->SetProperty(views::kMarginsKey, GetLayoutInsets(DOWNLOAD_ICON)); auto* wrapper = icon_text_row->AddChildView(std::make_unique()); wrapper->SetLayoutManager(std::make_unique()) ->SetOrientation(views::LayoutOrientation::kVertical) .SetCrossAxisAlignment(views::LayoutAlignment::kStart); wrapper->SetProperty(views::kMarginsKey, - gfx::Insets::VH(0, icon_label_spacing)); + gfx::Insets::TLBR(0, icon_label_spacing, 0, 0)); wrapper->SetProperty(views::kCrossAxisAlignmentKey, views::LayoutAlignment::kStretch); wrapper->SetProperty( views::kFlexBehaviorKey, - views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero, + views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum, views::MaximumFlexSizeRule::kUnbounded, - /*adjust_height_for_width=*/true) - .WithWeight(1)); - - auto* styled_label = - wrapper->AddChildView(std::make_unique()); - styled_label->SetProperty(views::kCrossAxisAlignmentKey, - views::LayoutAlignment::kStretch); - styled_label->SetTextContext(views::style::CONTEXT_DIALOG_BODY_TEXT); - styled_label->SetText(info_.warning_summary); - styled_label->SetProperty( + /*adjust_height_for_width=*/true)); + + styled_label_ = wrapper->AddChildView(std::make_unique()); + styled_label_->SetProperty(views::kCrossAxisAlignmentKey, + views::LayoutAlignment::kStretch); + styled_label_->SetTextContext(views::style::CONTEXT_DIALOG_BODY_TEXT); + styled_label_->SetProperty( views::kFlexBehaviorKey, views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum, - views::MaximumFlexSizeRule::kPreferred, - /*adjust_height_for_width=*/true) - .WithWeight(1)); - // The label defaults to a single line, which would force the dialog wider; - // instead give it a width that's the minimum we want it to have. Then the - // Layout will stretch it back out into any additional space available. - // Reduce by extra buffer so it has space for word wrapping. - const int min_label_width = - bubble_width - side_margin * 4 - icon->GetImageModel().Size().width() - - 2 * GetLayoutInsets(DOWNLOAD_ICON).width() - icon_label_spacing - kBuffer; - styled_label->SizeToFit(min_label_width); - - if (info_.has_checkbox) { - checkbox_ = wrapper->AddChildView(std::make_unique( - info_.checkbox_label, - base::BindRepeating(&DownloadBubbleSecurityView::OnCheckboxClicked, - base::Unretained(this)))); - checkbox_->SetMultiLine(true); - checkbox_->SetProperty( - views::kMarginsKey, - gfx::Insets::VH(ChromeLayoutProvider::Get()->GetDistanceMetric( - views::DISTANCE_RELATED_CONTROL_VERTICAL), - 0)); - checkbox_->SetProperty(views::kCrossAxisAlignmentKey, - views::LayoutAlignment::kStretch); - checkbox_->SetProperty( - views::kFlexBehaviorKey, - views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred, - views::MaximumFlexSizeRule::kUnbounded, - /*adjust_height_for_width=*/false) - .WithWeight(1)); - // Set min height for checkbox, so that it can layout label accordingly. - checkbox_->SetMinSize(gfx::Size(0, kCheckboxHeight)); - } + views::MaximumFlexSizeRule::kUnbounded, + /*adjust_height_for_width=*/true)); + + checkbox_ = wrapper->AddChildView(std::make_unique( + std::u16string(), + base::BindRepeating(&DownloadBubbleSecurityView::OnCheckboxClicked, + base::Unretained(this)))); + checkbox_->SetMultiLine(true); + checkbox_->SetProperty( + views::kMarginsKey, + gfx::Insets::VH(ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL), + 0)); + checkbox_->SetProperty(views::kCrossAxisAlignmentKey, + views::LayoutAlignment::kStretch); + checkbox_->SetProperty( + views::kFlexBehaviorKey, + views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToMinimum, + views::MaximumFlexSizeRule::kUnbounded, + /*adjust_height_for_width=*/true)); + // Set min height for checkbox, so that it can layout label accordingly. + checkbox_->SetMinSize(gfx::Size(0, kCheckboxHeight)); } void DownloadBubbleSecurityView::ProcessButtonClick( DownloadCommands::Command command) { - bubble_controller_->ProcessDownloadButtonPress(model_.get(), command); + // First open primary dialog, and then execute the command. If a deletion + // happens leading to closure of the bubble, it will be called after primary + // dialog is opened. navigation_handler_->OpenPrimaryDialog(); + bubble_controller_->ProcessDownloadButtonPress(download_row_view_->model(), + command); +} + +views::MdTextButton* DownloadBubbleSecurityView::GetButtonForCommand( + DownloadCommands::Command command) { + auto* button_iter = kCommandToButtons.find(command); + return (button_iter != kCommandToButtons.end()) ? this->*(button_iter->second) + : nullptr; +} + +void DownloadBubbleSecurityView::UpdateButtons() { + discard_button_->SetVisible(false); + keep_button_->SetVisible(false); + deep_scan_button_->SetVisible(false); + bypass_deep_scan_button_->SetVisible(false); + DownloadUIModel::BubbleUIInfo& ui_info = download_row_view_->ui_info(); + if (ui_info.has_first_button) { + first_button_ = GetButtonForCommand(ui_info.first_button_command); + first_button_->SetText(ui_info.first_button_label); + if (ui_info.has_checkbox) { + first_button_->SetEnabled(false); + } + first_button_->SetVisible(true); + } + if (ui_info.has_second_button) { + views::MdTextButton* second_button = + GetButtonForCommand(ui_info.second_button_command); + second_button->SetText(ui_info.second_button_label); + second_button->SetVisible(true); + second_button->SetProminent(true); + } } void DownloadBubbleSecurityView::AddButtons() { @@ -183,44 +239,44 @@ void DownloadBubbleSecurityView::AddButtons() { gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_CONTROL_VERTICAL))); - if (info_.has_first_button) { - first_button_ = - button_row->AddChildView(std::make_unique( - base::BindRepeating(&DownloadBubbleSecurityView::ProcessButtonClick, - base::Unretained(this), - info_.first_button_command), - info_.first_button_label)); - first_button_->SetProperty( - views::kMarginsKey, - gfx::Insets::VH(0, ChromeLayoutProvider::Get()->GetDistanceMetric( - views::DISTANCE_RELATED_CONTROL_HORIZONTAL))); - - if (info_.has_checkbox) { - first_button_->SetEnabled(false); - } - } + gfx::Insets button_margin = + gfx::Insets::VH(0, ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); - if (info_.has_second_button) { - raw_ptr second_button = + auto add_button_for_command = [button_row, button_margin, + this](DownloadCommands::Command command) { + auto* button = button_row->AddChildView(std::make_unique( base::BindRepeating(&DownloadBubbleSecurityView::ProcessButtonClick, - base::Unretained(this), - info_.second_button_command), - info_.second_button_label)); - second_button->SetProminent(true); - } + base::Unretained(this), command), + std::u16string())); + button->SetProperty(views::kMarginsKey, button_margin); + return button; + }; + + // The buttons come in this order KEEP, DISCARD, BYPASS_DEEP_SCANNING, + // DEEP_SCAN. Reorder buttons in runtime if required. + keep_button_ = add_button_for_command(DownloadCommands::KEEP); + discard_button_ = add_button_for_command(DownloadCommands::DISCARD); + bypass_deep_scan_button_ = + add_button_for_command(DownloadCommands::BYPASS_DEEP_SCANNING); + deep_scan_button_ = add_button_for_command(DownloadCommands::DEEP_SCAN); +} + +void DownloadBubbleSecurityView::UpdateSecurityView( + DownloadBubbleRowView* download_row_view) { + download_row_view_ = download_row_view; + DCHECK(download_row_view_->model()); + UpdateHeader(); + UpdateIconAndText(); + UpdateButtons(); } DownloadBubbleSecurityView::DownloadBubbleSecurityView( - DownloadUIModel::DownloadUIModelPtr model, - DownloadUIModel::BubbleUIInfo info, DownloadBubbleUIController* bubble_controller, DownloadBubbleNavigationHandler* navigation_handler) - : model_(std::move(model)), - info_(info), - bubble_controller_(bubble_controller), + : bubble_controller_(bubble_controller), navigation_handler_(navigation_handler) { - DCHECK(model_.get()); SetLayoutManager(std::make_unique()) ->SetOrientation(views::LayoutOrientation::kVertical); AddHeader(); diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h index dd8f563980c748..c7897e747e65f1 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_security_view.h @@ -12,38 +12,52 @@ namespace views { class MdTextButton; class Checkbox; +class Label; +class ImageView; +class StyledLabel; } // namespace views class DownloadBubbleUIController; class DownloadBubbleNavigationHandler; +class DownloadBubbleRowView; class DownloadBubbleSecurityView : public views::View { public: METADATA_HEADER(DownloadBubbleSecurityView); DownloadBubbleSecurityView( - DownloadUIModel::DownloadUIModelPtr model, - DownloadUIModel::BubbleUIInfo info, DownloadBubbleUIController* bubble_controller, DownloadBubbleNavigationHandler* navigation_handler); DownloadBubbleSecurityView(const DownloadBubbleSecurityView&) = delete; DownloadBubbleSecurityView& operator=(const DownloadBubbleSecurityView&) = delete; ~DownloadBubbleSecurityView() override; + void UpdateSecurityView(DownloadBubbleRowView* download_row_view); + + raw_ptr keep_button_ = nullptr; + raw_ptr discard_button_ = nullptr; + raw_ptr bypass_deep_scan_button_ = nullptr; + raw_ptr deep_scan_button_ = nullptr; private: + void UpdateHeader(); void AddHeader(); void CloseBubble(); void OnCheckboxClicked(); + void UpdateIconAndText(); void AddIconAndText(); + void UpdateButtons(); void AddButtons(); void ProcessButtonClick(DownloadCommands::Command command); + views::MdTextButton* GetButtonForCommand(DownloadCommands::Command command); - DownloadUIModel::DownloadUIModelPtr model_; - DownloadUIModel::BubbleUIInfo info_; + raw_ptr download_row_view_; raw_ptr bubble_controller_ = nullptr; raw_ptr navigation_handler_ = nullptr; raw_ptr first_button_ = nullptr; raw_ptr checkbox_ = nullptr; + raw_ptr title_ = nullptr; + raw_ptr icon_ = nullptr; + raw_ptr styled_label_ = nullptr; }; #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_BUBBLE_SECURITY_VIEW_H_ diff --git a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc index b27b1b5097fd40..afcc689d32c160 100644 --- a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc @@ -184,23 +184,17 @@ std::unique_ptr DownloadToolbarButtonView::GetPrimaryView() { } void DownloadToolbarButtonView::OpenPrimaryDialog() { - switcher_view_->RemoveAllChildViews(); - std::unique_ptr primary_view = GetPrimaryView(); - if (primary_view) { - switcher_view_->AddChildView(std::move(primary_view)); - bubble_delegate_->SizeToContents(); - } else { - CloseDialog(views::Widget::ClosedReason::kUnspecified); - } + primary_view_->SetVisible(true); + security_view_->SetVisible(false); + ResizeDialog(); } void DownloadToolbarButtonView::OpenSecurityDialog( - DownloadUIModel::DownloadUIModelPtr download, - DownloadUIModel::BubbleUIInfo info) { - switcher_view_->RemoveAllChildViews(); - switcher_view_->AddChildView(std::make_unique( - std::move(download), info, bubble_controller_.get(), this)); - bubble_delegate_->SizeToContents(); + DownloadBubbleRowView* download_row_view) { + security_view_->UpdateSecurityView(download_row_view); + primary_view_->SetVisible(false); + security_view_->SetVisible(true); + ResizeDialog(); } void DownloadToolbarButtonView::CloseDialog( @@ -214,7 +208,8 @@ void DownloadToolbarButtonView::ResizeDialog() { void DownloadToolbarButtonView::OnBubbleDelegateDeleted() { bubble_delegate_ = nullptr; - switcher_view_ = nullptr; + primary_view_ = nullptr; + security_view_ = nullptr; } void DownloadToolbarButtonView::CreateBubbleDialogDelegate( @@ -230,11 +225,16 @@ void DownloadToolbarButtonView::CreateBubbleDialogDelegate( bubble_delegate->RegisterDeleteDelegateCallback( base::BindOnce(&DownloadToolbarButtonView::OnBubbleDelegateDeleted, weak_factory_.GetWeakPtr())); - switcher_view_ = + auto* switcher_view = bubble_delegate->SetContentsView(std::make_unique()); - switcher_view_->SetLayoutManager(std::make_unique()) + switcher_view->SetLayoutManager(std::make_unique()) ->SetOrientation(views::LayoutOrientation::kVertical); - switcher_view_->AddChildView(std::move(bubble_contents_view)); + primary_view_ = switcher_view->AddChildView(std::move(bubble_contents_view)); + // raw ptr for this is safe as Toolbar Button view owns the Bubble. + security_view_ = + switcher_view->AddChildView(std::make_unique( + bubble_controller_.get(), this)); + security_view_->SetVisible(false); bubble_delegate->set_fixed_width( ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_BUBBLE_PREFERRED_WIDTH)); diff --git a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h index 4b90725cba250e..2e92a16507aa37 100644 --- a/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h +++ b/chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h @@ -18,13 +18,14 @@ class Browser; class BrowserView; class DownloadDisplayController; class DownloadBubbleUIController; +class DownloadBubbleRowView; +class DownloadBubbleSecurityView; class DownloadBubbleNavigationHandler { public: // Primary dialog is either main or partial view. virtual void OpenPrimaryDialog() = 0; - virtual void OpenSecurityDialog(DownloadUIModel::DownloadUIModelPtr download, - DownloadUIModel::BubbleUIInfo info) = 0; + virtual void OpenSecurityDialog(DownloadBubbleRowView* download_row_view) = 0; virtual void CloseDialog(views::Widget::ClosedReason reason) = 0; virtual void ResizeDialog() = 0; }; @@ -57,8 +58,7 @@ class DownloadToolbarButtonView : public ToolbarButton, // DownloadBubbleNavigationHandler: void OpenPrimaryDialog() override; - void OpenSecurityDialog(DownloadUIModel::DownloadUIModelPtr download, - DownloadUIModel::BubbleUIInfo info) override; + void OpenSecurityDialog(DownloadBubbleRowView* download_row_view) override; void CloseDialog(views::Widget::ClosedReason reason) override; void ResizeDialog() override; @@ -87,7 +87,8 @@ class DownloadToolbarButtonView : public ToolbarButton, // Controller for keeping track of items for both main view and partial view. std::unique_ptr bubble_controller_; raw_ptr bubble_delegate_ = nullptr; - raw_ptr switcher_view_ = nullptr; + raw_ptr primary_view_ = nullptr; + raw_ptr security_view_ = nullptr; gfx::SlideAnimation scanning_animation_{this};