#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_two_origins_view.h"
#include "base/metrics/histogram_functions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/favicon/core/favicon_service.h"
#include "components/favicon_base/favicon_callback.h"
#include "components/permissions/permission_util.h"
#include "components/strings/grit/components_strings.h"
#include "components/url_formatter/elide_url.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/layout/layout_provider.h"
namespace {
constexpr int kDesiredFaviconSizeInPixel = …;
constexpr int kMaxShowDelayMs = …;
std::optional<std::u16string> GetExtraTextTwoOrigin(
permissions::PermissionPrompt::Delegate& delegate) { … }
bool HasExtraText(permissions::PermissionPrompt::Delegate& delegate) { … }
}
PermissionPromptBubbleTwoOriginsView::PermissionPromptBubbleTwoOriginsView(
Browser* browser,
base::WeakPtr<permissions::PermissionPrompt::Delegate> delegate,
base::TimeTicks permission_requested_time,
PermissionPromptStyle prompt_style)
: … { … }
PermissionPromptBubbleTwoOriginsView::~PermissionPromptBubbleTwoOriginsView() { … }
void PermissionPromptBubbleTwoOriginsView::AddedToWidget() { … }
void PermissionPromptBubbleTwoOriginsView::Show() { … }
std::u16string PermissionPromptBubbleTwoOriginsView::CreateWindowTitle() { … }
void PermissionPromptBubbleTwoOriginsView::CreateFaviconRow() { … }
void PermissionPromptBubbleTwoOriginsView::OnEmbeddingOriginFaviconLoaded(
const favicon_base::FaviconRawBitmapResult& favicon_result) { … }
void PermissionPromptBubbleTwoOriginsView::OnRequestingOriginFaviconLoaded(
const favicon_base::FaviconRawBitmapResult& favicon_result) { … }
void PermissionPromptBubbleTwoOriginsView::MaybeAddLink() { … }
std::optional<std::u16string> PermissionPromptBubbleTwoOriginsView::GetLink(
gfx::Range& link_range,
views::StyledLabel::RangeStyleInfo& link_style) { … }
std::u16string PermissionPromptBubbleTwoOriginsView::GetLinkStorageAccess(
gfx::Range& link_range,
views::StyledLabel::RangeStyleInfo& link_style) { … }
void PermissionPromptBubbleTwoOriginsView::HelpCenterLinkClicked(
const ui::Event& event) { … }
void PermissionPromptBubbleTwoOriginsView::MaybeShow() { … }
void PermissionPromptBubbleTwoOriginsView::OnViewIsDeleting(views::View* view) { … }