chromium/chrome/browser/ui/views/toolbar/toolbar_action_hover_card_bubble_view.cc

// Copyright 2022 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/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;

// Hover card fixed width. Toolbar actions are not visible when window is too
// small to display them, therefore hover cards wouldn't be displayed if the
// window is not big enough.
constexpr int kHoverCardWidth =;

// Hover card margins.
// TODO(crbug.com/40857356): Move to a base hover card class.
constexpr int kHorizontalMargin =;
constexpr int kVerticalMargin =;

// Maximum number of lines that a label occupies.
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) {}

}  // namespace

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()