#include "chrome/browser/ui/views/toolbar/toolbar_action_hover_card_bubble_view.h"
#include <string>
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/browser/ui/views/extensions/extensions_dialogs_utils.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/extension_features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/view_class_properties.h"
namespace {
HoverCardState;
constexpr int kHoverCardWidth = …;
constexpr int kHorizontalMargin = …;
constexpr int kVerticalMargin = …;
constexpr int kHoverCardLabelMaxLines = …;
std::u16string GetSiteAccessTitle(
ToolbarActionViewController::HoverCardState::SiteAccess state) { … }
std::u16string GetSiteAccessDescription(HoverCardState::SiteAccess state,
std::u16string host) { … }
std::u16string GetPolicyText(HoverCardState::AdminPolicy state) { … }
}
ToolbarActionHoverCardBubbleView::ToolbarActionHoverCardBubbleView(
ToolbarActionView* action_view)
: … { … }
void ToolbarActionHoverCardBubbleView::UpdateCardContent(
const std::u16string& extension_name,
const std::u16string& action_title,
ToolbarActionViewController::HoverCardState state,
content::WebContents* web_contents) { … }
void ToolbarActionHoverCardBubbleView::SetTextFade(double percent) { … }
std::u16string ToolbarActionHoverCardBubbleView::GetTitleTextForTesting()
const { … }
std::u16string ToolbarActionHoverCardBubbleView::GetActionTitleTextForTesting()
const { … }
std::u16string
ToolbarActionHoverCardBubbleView::GetSiteAccessTitleTextForTesting() const { … }
std::u16string
ToolbarActionHoverCardBubbleView::GetSiteAccessDescriptionTextForTesting()
const { … }
bool ToolbarActionHoverCardBubbleView::IsActionTitleVisible() const { … }
bool ToolbarActionHoverCardBubbleView::IsSiteAccessSeparatorVisible() const { … }
bool ToolbarActionHoverCardBubbleView::IsSiteAccessTitleVisible() const { … }
bool ToolbarActionHoverCardBubbleView::IsSiteAccessDescriptionVisible() const { … }
bool ToolbarActionHoverCardBubbleView::IsPolicySeparatorVisible() const { … }
bool ToolbarActionHoverCardBubbleView::IsPolicyLabelVisible() const { … }
ToolbarActionHoverCardBubbleView::~ToolbarActionHoverCardBubbleView() = default;
BEGIN_METADATA(…)