chromium/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

// Copyright 2012 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/location_bar/icon_label_bubble_view.h"

#include <algorithm>
#include <memory>
#include <utility>

#include "base/functional/bind.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/omnibox/omnibox_theme.h"
#include "chrome/browser/ui/views/location_bar/location_bar_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/views/accessibility/ax_virtual_view.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/animation/ink_drop_mask.h"
#include "ui/views/animation/ink_drop_ripple.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/widget/widget.h"

namespace {

// Amount of space reserved for the separator that appears after the icon or
// label.
constexpr int kIconLabelBubbleSeparatorWidth =;

// Amount of space on either side of the separator that appears after the icon
// or label.
constexpr int kIconLabelBubbleSpaceBesideSeparator =;

// The length of the separator's fade animation. These values are empirical.
constexpr int kIconLabelBubbleFadeInDurationMs =;
constexpr int kIconLabelBubbleFadeOutDurationMs =;

// The length of the label fade in and out animations.
constexpr int kIconLabelAnimationDurationMs =;

}  // namespace

SkAlpha IconLabelBubbleView::Delegate::GetIconLabelBubbleSeparatorAlpha()
    const {}

SkColor IconLabelBubbleView::Delegate::GetIconLabelBubbleInkDropColor() const {}

IconLabelBubbleView::SeparatorView::SeparatorView(IconLabelBubbleView* owner) {}

void IconLabelBubbleView::SeparatorView::OnPaint(gfx::Canvas* canvas) {}

void IconLabelBubbleView::SeparatorView::OnThemeChanged() {}

void IconLabelBubbleView::SeparatorView::UpdateOpacity() {}

BEGIN_METADATA()
END_METADATA

class IconLabelBubbleView::HighlightPathGenerator
    : public views::HighlightPathGenerator {};

IconLabelBubbleView::IconLabelBubbleView(const gfx::FontList& font_list,
                                         Delegate* delegate)
    :{}

IconLabelBubbleView::~IconLabelBubbleView() {}

void IconLabelBubbleView::InkDropAnimationStarted() {}

void IconLabelBubbleView::InkDropRippleAnimationEnded(
    views::InkDropState state) {}

bool IconLabelBubbleView::ShouldShowLabel() const {}

void IconLabelBubbleView::Layout(PassKey) {}

void IconLabelBubbleView::SetBackgroundVisibility(
    BackgroundVisibility background_visibility) {}

void IconLabelBubbleView::SetLabel(const std::u16string& label_text) {}

void IconLabelBubbleView::SetLabel(const std::u16string& label_text,
                                   const std::u16string& accessible_name) {}

void IconLabelBubbleView::SetFontList(const gfx::FontList& font_list) {}

SkColor IconLabelBubbleView::GetBackgroundColor() const {}

SkColor IconLabelBubbleView::GetForegroundColor() const {}

bool IconLabelBubbleView::IconColorShouldMatchForeground() const {}

void IconLabelBubbleView::SetCustomForegroundColorId(
    const ui::ColorId color_id) {}

void IconLabelBubbleView::SetCustomBackgroundColorId(
    const ui::ColorId color_id) {}

void IconLabelBubbleView::UpdateLabelColors() {}

void IconLabelBubbleView::UpdateBackground() {}

void IconLabelBubbleView::SetUseTonalColorsWhenExpanded(bool use_tonal_colors) {}

bool IconLabelBubbleView::ShouldShowSeparator() const {}

bool IconLabelBubbleView::ShouldShowLabelAfterAnimation() const {}

int IconLabelBubbleView::GetWidthBetween(int min, int max) const {}

bool IconLabelBubbleView::IsShrinking() const {}

bool IconLabelBubbleView::ShowBubble(const ui::Event& event) {}

bool IconLabelBubbleView::IsBubbleShowing() const {}

void IconLabelBubbleView::OnTouchUiChanged() {}

gfx::Size IconLabelBubbleView::CalculatePreferredSize(
    const views::SizeBounds& available_size) const {}

bool IconLabelBubbleView::OnMousePressed(const ui::MouseEvent& event) {}

void IconLabelBubbleView::OnThemeChanged() {}

bool IconLabelBubbleView::IsTriggerableEvent(const ui::Event& event) {}

bool IconLabelBubbleView::ShouldUpdateInkDropOnClickCanceled() const {}

void IconLabelBubbleView::NotifyClick(const ui::Event& event) {}

void IconLabelBubbleView::OnFocus() {}

void IconLabelBubbleView::OnBlur() {}

void IconLabelBubbleView::AnimationEnded(const gfx::Animation* animation) {}

void IconLabelBubbleView::AnimationProgressed(const gfx::Animation* animation) {}

void IconLabelBubbleView::AnimationCanceled(const gfx::Animation* animation) {}

void IconLabelBubbleView::SetImageModel(const ui::ImageModel& image_model) {}

gfx::Size IconLabelBubbleView::GetSizeForLabelWidth(int label_width) const {}

void IconLabelBubbleView::UpdateBorder() {}

int IconLabelBubbleView::GetInternalSpacing() const {}

int IconLabelBubbleView::GetExtraInternalSpacing() const {}

int IconLabelBubbleView::GetWidthBetweenIconAndSeparator() const {}

int IconLabelBubbleView::GetEndPaddingWithSeparator() const {}

void IconLabelBubbleView::SetUpForAnimation() {}

void IconLabelBubbleView::SetUpForInOutAnimation(base::TimeDelta duration) {}

void IconLabelBubbleView::AnimateIn(std::optional<int> string_id) {}

void IconLabelBubbleView::AnimateOut() {}

void IconLabelBubbleView::ResetSlideAnimation(bool show_label) {}

void IconLabelBubbleView::ReduceAnimationTimeForTesting() {}

void IconLabelBubbleView::PauseAnimation() {}

void IconLabelBubbleView::UnpauseAnimation() {}

double IconLabelBubbleView::GetAnimationValue() const {}

void IconLabelBubbleView::ShowAnimation() {}

void IconLabelBubbleView::HideAnimation() {}

// TODO(josephjoopark): Refactor using addCircle().
SkPath IconLabelBubbleView::GetHighlightPath() const {}

bool IconLabelBubbleView::PaintedOnSolidBackground() const {}

BEGIN_METADATA()