#include "chrome/browser/ui/views/permissions/chip/permission_dashboard_controller.h"
#include <string>
#include "base/check.h"
#include "base/time/time.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/content_settings/content_setting_image_model.h"
#include "chrome/browser/ui/tabs/public/tab_features.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/views/permissions/chip/permission_prompt_chip_model.h"
#include "components/content_settings/browser/page_specific_content_settings.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/permissions/permission_indicators_tab_data.h"
#include "components/permissions/permission_request_manager.h"
#include "components/permissions/permission_uma_util.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/animation/animation.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
namespace {
constexpr auto kExpandAnimationDuration = …;
constexpr auto kCollapseAnimationDuration = …;
constexpr auto kCollapseDelay = …;
base::TimeDelta GetAnimationDuration(base::TimeDelta duration) { … }
void UpdateIndicatorsVisibilityFlags(LocationBarView* location_bar) { … }
bool ShouldExpandChipIndicator(
content_settings::PageSpecificContentSettings* pscs) { … }
void RecordIndicators(ContentSettingImageModel* indicator_model,
content_settings::PageSpecificContentSettings* pscs,
bool clicked) { … }
bool SuppressVerboseState(ChipController* request_chip_controller) { … }
}
PermissionDashboardController::PermissionDashboardController(
LocationBarView* location_bar_view,
PermissionDashboardView* permission_dashboard_view)
: … { … }
PermissionDashboardController::~PermissionDashboardController() = default;
bool PermissionDashboardController::Update(
ContentSettingImageModel* indicator_model,
ContentSettingImageView::Delegate* delegate) { … }
void PermissionDashboardController::OnChipVisibilityChanged(bool is_visible) { … }
void PermissionDashboardController::OnExpandAnimationEnded() { … }
void PermissionDashboardController::OnCollapseAnimationEnded() { … }
void PermissionDashboardController::OnMousePressed() { … }
bool PermissionDashboardController::SuppressVerboseIndicator() { … }
void PermissionDashboardController::StartCollapseTimer() { … }
void PermissionDashboardController::Collapse(bool hide) { … }
void PermissionDashboardController::HideIndicators() { … }
void PermissionDashboardController::ShowBubble() { … }
void PermissionDashboardController::ShowPageInfoDialog() { … }
void PermissionDashboardController::OnPageInfoBubbleClosed(
views::Widget::ClosedReason closed_reason,
bool reload_prompt) { … }
void PermissionDashboardController::OnIndicatorsChipButtonPressed() { … }
std::u16string PermissionDashboardController::GetIndicatorTitle(
ContentSettingImageModel* model) { … }