chromium/chrome/browser/ui/views/permissions/chip/permission_dashboard_controller.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// A duration of the expand animation. In other words, how long does it take to
// expand the chip.
constexpr auto kExpandAnimationDuration =;
// A duration of the collapse animation. In other words, how long does it take
// to collapse/shrink the chip.
constexpr auto kCollapseAnimationDuration =;
// A delay for the verbose state. In other words the delay that is used between
// expand and collapse animations.
constexpr auto kCollapseDelay =;

base::TimeDelta GetAnimationDuration(base::TimeDelta duration) {}

// This method updates indicators' visibility set in
// `PageSpecificContentSettings`.
void UpdateIndicatorsVisibilityFlags(LocationBarView* location_bar) {}

// Returns `true` if there is misalignment in Camera & Mic usage and displayed
// indicators.
bool ShouldExpandChipIndicator(
    content_settings::PageSpecificContentSettings* pscs) {}

void RecordIndicators(ContentSettingImageModel* indicator_model,
                      content_settings::PageSpecificContentSettings* pscs,
                      bool clicked) {}

// If permission request chip is visible, the indicator's verbose state (the
// expand animation) should be suppressed.
bool SuppressVerboseState(ChipController* request_chip_controller) {}
}  // namespace

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) {}