#include "chrome/browser/ui/views/page_action/page_action_icon_controller.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/immediate_crash.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sharing/click_to_call/click_to_call_ui_controller.h"
#include "chrome/browser/sharing/sms/sms_remote_fetcher_ui_controller.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/page_action/page_action_icon_type.h"
#include "chrome/browser/ui/views/autofill/address_bubbles_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/local_card_migration_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/mandatory_reauth_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/offer_notification_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/save_payment_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/virtual_card_enroll_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/virtual_card_manual_fallback_icon_view.h"
#include "chrome/browser/ui/views/commerce/discounts_icon_view.h"
#include "chrome/browser/ui/views/commerce/price_insights_icon_view.h"
#include "chrome/browser/ui/views/commerce/price_tracking_icon_view.h"
#include "chrome/browser/ui/views/commerce/product_specifications_icon_view.h"
#include "chrome/browser/ui/views/file_system_access/file_system_access_icon_view.h"
#include "chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_icon_view.h"
#include "chrome/browser/ui/views/location_bar/find_bar_icon.h"
#include "chrome/browser/ui/views/location_bar/intent_picker_view.h"
#include "chrome/browser/ui/views/location_bar/lens_overlay_page_action_icon_view.h"
#include "chrome/browser/ui/views/location_bar/star_view.h"
#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_container.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_params.h"
#include "chrome/browser/ui/views/page_action/pwa_install_view.h"
#include "chrome/browser/ui/views/page_action/zoom_view.h"
#include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h"
#include "chrome/browser/ui/views/performance_controls/memory_saver_chip_view.h"
#include "chrome/browser/ui/views/sharing/sharing_dialog_view.h"
#include "chrome/browser/ui/views/sharing/sharing_icon_view.h"
#include "chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h"
#include "chrome/browser/ui/views/side_search/side_search_icon_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h"
#include "chrome/browser/ui/views/translate/translate_icon_view.h"
#include "chrome/common/chrome_features.h"
#include "components/content_settings/core/common/features.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/common/content_features.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/layout/box_layout.h"
namespace {
void RecordCTRMetrics(const char* name, PageActionCTREvent event) { … }
}
PageActionIconController::PageActionIconController() = default;
PageActionIconController::~PageActionIconController() = default;
void PageActionIconController::Init(const PageActionIconParams& params,
PageActionIconContainer* icon_container) { … }
PageActionIconView* PageActionIconController::GetIconView(
PageActionIconType type) { … }
PageActionIconType PageActionIconController::GetIconType(
PageActionIconView* view) { … }
void PageActionIconController::UpdateAll() { … }
bool PageActionIconController::IsAnyIconVisible() const { … }
bool PageActionIconController::ActivateFirstInactiveBubbleForAccessibility() { … }
void PageActionIconController::SetIconColor(SkColor icon_color) { … }
void PageActionIconController::SetFontList(const gfx::FontList& font_list) { … }
void PageActionIconController::OnPageActionIconViewShown(
PageActionIconView* view) { … }
void PageActionIconController::OnPageActionIconViewClicked(
PageActionIconView* view) { … }
void PageActionIconController::ZoomChangedForActiveTab(bool can_show_bubble) { … }
std::vector<const PageActionIconView*>
PageActionIconController::GetPageActionIconViewsForTesting() const { … }
void PageActionIconController::OnDefaultZoomLevelChanged() { … }
void PageActionIconController::UpdateWebContents(
content::WebContents* contents) { … }
void PageActionIconController::ReadyToCommitNavigation(
content::NavigationHandle* navigation_handle) { … }
void PageActionIconController::PrimaryPageChanged(content::Page& page) { … }
int PageActionIconController::VisibleEphemeralActionCount() const { … }
void PageActionIconController::RecordMetricsOnURLChange(GURL url) { … }
void PageActionIconController::RecordOverallMetrics() { … }
void PageActionIconController::RecordIndividualMetrics(
PageActionIconType type,
PageActionIconView* view) const { … }
void PageActionIconController::RecordClickMetrics(
PageActionIconType type,
PageActionIconView* view) const { … }