#include "chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.h"
#include <string>
#include <type_traits>
#include "base/metrics/user_metrics.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_actions.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/side_panel/side_panel_action_callback.h"
#include "chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.h"
#include "chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container_layout.h"
#include "chrome/browser/ui/views/toolbar/pinned_toolbar_button_status_indicator.h"
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
#include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h"
#include "chrome/grit/generated_resources.h"
#include "ui/actions/action_id.h"
#include "ui/actions/actions.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/menu_separator_types.h"
#include "ui/color/color_id.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/button_controller.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/view_utils.h"
namespace {
const gfx::VectorIcon kEmptyIcon;
}
DEFINE_UI_CLASS_PROPERTY_TYPE(…)
DEFINE_UI_CLASS_PROPERTY_KEY(…)
PinnedActionToolbarButton::PinnedActionToolbarButton(
Browser* browser,
actions::ActionId action_id,
PinnedToolbarActionsContainer* container)
: … { … }
PinnedActionToolbarButton::~PinnedActionToolbarButton() { … }
bool PinnedActionToolbarButton::IsActive() { … }
base::AutoReset<bool> PinnedActionToolbarButton::SetNeedsDelayedDestruction(
bool needs_delayed_destruction) { … }
void PinnedActionToolbarButton::SetIconVisibility(bool is_visible) { … }
void PinnedActionToolbarButton::AddHighlight() { … }
void PinnedActionToolbarButton::ResetHighlight() { … }
void PinnedActionToolbarButton::SetPinned(bool pinned) { … }
bool PinnedActionToolbarButton::OnKeyPressed(const ui::KeyEvent& event) { … }
gfx::Size PinnedActionToolbarButton::CalculatePreferredSize(
const views::SizeBounds& available_size) const { … }
void PinnedActionToolbarButton::Layout(PassKey) { … }
bool PinnedActionToolbarButton::OnMousePressed(const ui::MouseEvent& event) { … }
void PinnedActionToolbarButton::OnMouseReleased(const ui::MouseEvent& event) { … }
void PinnedActionToolbarButton::GetAccessibleNodeData(
ui::AXNodeData* node_data) { … }
void PinnedActionToolbarButton::UpdateIcon() { … }
bool PinnedActionToolbarButton::ShouldShowEphemerallyInToolbar() { … }
void PinnedActionToolbarButton::SetActionEngaged(bool action_engaged) { … }
void PinnedActionToolbarButton::HideStatusIndicator() { … }
void PinnedActionToolbarButton::UpdateStatusIndicator() { … }
std::unique_ptr<ui::SimpleMenuModel>
PinnedActionToolbarButton::CreateMenuModel() { … }
void PinnedActionToolbarButton::OnAnchorCountChanged(size_t anchor_count) { … }
bool PinnedActionToolbarButton::IsItemForCommandIdDynamic(
int command_id) const { … }
std::u16string PinnedActionToolbarButton::GetLabelForCommandId(
int command_id) const { … }
ui::ImageModel PinnedActionToolbarButton::GetIconForCommandId(
int command_id) const { … }
void PinnedActionToolbarButton::ExecuteCommand(int command_id,
int event_flags) { … }
bool PinnedActionToolbarButton::IsCommandIdEnabled(int command_id) const { … }
void PinnedActionToolbarButton::UpdatePinnedStateForContextMenu() { … }
std::unique_ptr<views::ActionViewInterface>
PinnedActionToolbarButton::GetActionViewInterface() { … }
PinnedActionToolbarButtonActionViewInterface::
PinnedActionToolbarButtonActionViewInterface(
PinnedActionToolbarButton* action_view)
: … { … }
void PinnedActionToolbarButtonActionViewInterface::ActionItemChangedImpl(
actions::ActionItem* action_item) { … }
void PinnedActionToolbarButtonActionViewInterface::InvokeActionImpl(
actions::ActionItem* action_item) { … }
void PinnedActionToolbarButtonActionViewInterface::OnViewChangedImpl(
actions::ActionItem* action_item) { … }
BEGIN_METADATA(…)