#include "chrome/browser/ui/views/bookmarks/bookmark_button.h"
#include "base/metrics/histogram_functions.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/predictors/loading_predictor.h"
#include "chrome/browser/predictors/loading_predictor_config.h"
#include "chrome/browser/predictors/loading_predictor_factory.h"
#include "chrome/browser/preloading/chrome_preloading.h"
#include "chrome/browser/preloading/prerender/prerender_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_button_util.h"
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/navigation_handle.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/widget/tooltip_manager.h"
enum class PreloadBookmarkMetricsEvent { … };
const base::FeatureParam<int> kPreconnectStartDelayOnMouseHoverByMiliseconds{ … };
const base::FeatureParam<int> kPrerenderStartDelayOnMouseHoverByMiliseconds{ … };
const base::FeatureParam<bool> kPrerenderBookmarkBarOnMousePressedTrigger{ … };
const base::FeatureParam<bool> kPrerenderBookmarkBarOnMouseHoverTrigger{ … };
BookmarkButtonBase::BookmarkButtonBase(PressedCallback callback,
const std::u16string& title)
: … { … }
BookmarkButtonBase::~BookmarkButtonBase() = default;
views::View* BookmarkButtonBase::GetTooltipHandlerForPoint(
const gfx::Point& point) { … }
bool BookmarkButtonBase::IsTriggerableEvent(const ui::Event& e) { … }
std::unique_ptr<views::LabelButtonBorder>
BookmarkButtonBase::CreateDefaultBorder() const { … }
void BookmarkButtonBase::GetAccessibleNodeData(ui::AXNodeData* node_data) { … }
BEGIN_METADATA(…)
BookmarkButton::BookmarkButton(PressedCallback callback,
const GURL& url,
const std::u16string& title,
const raw_ptr<Browser> browser)
: … { … }
BookmarkButton::~BookmarkButton() = default;
std::u16string BookmarkButton::GetTooltipText(const gfx::Point& p) const { … }
void BookmarkButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { … }
void BookmarkButton::AdjustAccessibleName(std::u16string& new_name,
ax::mojom::NameFrom& name_from) { … }
void BookmarkButton::SetText(const std::u16string& text) { … }
void BookmarkButton::OnMouseEntered(const ui::MouseEvent& event) { … }
void BookmarkButton::OnMouseExited(const ui::MouseEvent& event) { … }
bool BookmarkButton::OnMousePressed(const ui::MouseEvent& event) { … }
void BookmarkButton::OnMouseMoved(const ui::MouseEvent& event) { … }
void BookmarkButton::StartPreconnecting(GURL url) { … }
void BookmarkButton::StartPrerendering(GURL url) { … }
BEGIN_METADATA(…)