#include "ui/actions/actions.h"
#include <algorithm>
#include <limits>
#include <optional>
#include "base/no_destructor.h"
#include "ui/base/metadata/metadata_impl_macros.h"
namespace actions {
namespace {
class GlobalActionManager : public ActionManager { … };
std::optional<GlobalActionManager>& GetGlobalManager() { … }
}
DEFINE_UI_CLASS_PROPERTY_KEY(…)
ActionList::ActionList(Delegate* delegate) : … { … }
ActionList::~ActionList() = default;
ActionItem* ActionList::AddAction(std::unique_ptr<ActionItem> action_item) { … }
std::unique_ptr<ActionItem> ActionList::RemoveAction(ActionItem* action_item) { … }
void ActionList::Reset() { … }
BaseAction::BaseAction() = default;
BaseAction::~BaseAction() = default;
BaseAction* BaseAction::GetParent() const { … }
ActionItem* BaseAction::AddChild(std::unique_ptr<ActionItem> action_item) { … }
std::unique_ptr<ActionItem> BaseAction::RemoveChild(ActionItem* action_item) { … }
void BaseAction::ActionListChanged() { … }
void BaseAction::ResetActionList() { … }
BEGIN_METADATA_BASE(…)
ScopedActionUpdate::ScopedActionUpdate(ActionItem* action_item)
: … { … }
ScopedActionUpdate::ScopedActionUpdate(
ScopedActionUpdate&& scoped_action_update)
: … { … }
ScopedActionUpdate& ScopedActionUpdate::operator=(
ScopedActionUpdate&& scoped_action_update) = default;
ScopedActionUpdate::~ScopedActionUpdate() { … }
ActionInvocationContext::ContextBuilder::ContextBuilder() = default;
ActionInvocationContext::ContextBuilder::ContextBuilder(ContextBuilder&&) =
default;
ActionInvocationContext::ContextBuilder&
ActionInvocationContext::ContextBuilder::operator=(ContextBuilder&&) = default;
ActionInvocationContext::ContextBuilder::ContextBuilder::~ContextBuilder() =
default;
ActionInvocationContext ActionInvocationContext::ContextBuilder::Build() && { … }
ActionInvocationContext::ActionInvocationContext() = default;
ActionInvocationContext::ActionInvocationContext(ActionInvocationContext&&) =
default;
ActionInvocationContext& ActionInvocationContext::operator=(
ActionInvocationContext&&) = default;
ActionInvocationContext::~ActionInvocationContext() = default;
ActionInvocationContext::ContextBuilder ActionInvocationContext::Builder() { … }
ActionItem::ActionItemBuilder::ActionItemBuilder() { … }
ActionItem::ActionItemBuilder::ActionItemBuilder(
InvokeActionCallback callback) { … }
ActionItem::ActionItemBuilder::ActionItemBuilder(
ActionItem::ActionItemBuilder&&) = default;
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::operator=(
ActionItem::ActionItemBuilder&&) = default;
ActionItem::ActionItemBuilder::~ActionItemBuilder() = default;
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::AddChild(
ActionItemBuilder&& child_item) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::AddChild(
ActionItemBuilder&& child_item) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetAccessibleName(
const std::u16string accessible_name) & { … }
ActionItem::ActionItemBuilder&&
ActionItem::ActionItemBuilder::SetAccessibleName(
const std::u16string accessible_name) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetActionId(
std::optional<ActionId> action_id) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetActionId(
std::optional<ActionId> action_id) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetAccelerator(
ui::Accelerator accelerator) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetAccelerator(
ui::Accelerator accelerator) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetChecked(
bool checked) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetChecked(
bool checked) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetEnabled(
bool enabled) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetEnabled(
bool enabled) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetGroupId(
std::optional<int> group_id) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetGroupId(
std::optional<int> group_id) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetImage(
const ui::ImageModel& image) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetImage(
const ui::ImageModel& image) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetText(
const std::u16string& text) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetText(
const std::u16string& text) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetTooltipText(
const std::u16string& tooltip) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetTooltipText(
const std::u16string& tooltip) && { … }
ActionItem::ActionItemBuilder& ActionItem::ActionItemBuilder::SetVisible(
bool visible) & { … }
ActionItem::ActionItemBuilder&& ActionItem::ActionItemBuilder::SetVisible(
bool visible) && { … }
ActionItem::ActionItemBuilder&
ActionItem::ActionItemBuilder::SetInvokeActionCallback(
InvokeActionCallback callback) & { … }
ActionItem::ActionItemBuilder&&
ActionItem::ActionItemBuilder::SetInvokeActionCallback(
InvokeActionCallback callback) && { … }
ActionItem::ActionItemBuilder&
ActionItem::ActionItemBuilder::SetIsShowingBubble(bool showing_bubble) & { … }
ActionItem::ActionItemBuilder&&
ActionItem::ActionItemBuilder::SetIsShowingBubble(bool showing_bubble) && { … }
std::unique_ptr<ActionItem> ActionItem::ActionItemBuilder::Build() && { … }
void ActionItem::ActionItemBuilder::CreateChildren() { … }
std::unique_ptr<ActionItem::ActionItemBuilder>
ActionItem::ActionItemBuilder::Release() { … }
ActionItem::ActionItem() = default;
ActionItem::ActionItem(InvokeActionCallback callback)
: … { … }
ActionItem::~ActionItem() = default;
std::u16string ActionItem::GetAccessibleName() const { … }
void ActionItem::SetAccessibleName(const std::u16string accessible_name) { … }
std::optional<ActionId> ActionItem::GetActionId() const { … }
void ActionItem::SetActionId(std::optional<ActionId> action_id) { … }
ui::Accelerator ActionItem::GetAccelerator() const { … }
void ActionItem::SetAccelerator(ui::Accelerator accelerator) { … }
void ActionItem::AfterPropertyChange(const void* key, int64_t old_value) { … }
bool ActionItem::GetChecked() const { … }
void ActionItem::SetChecked(bool checked) { … }
bool ActionItem::GetEnabled() const { … }
void ActionItem::SetEnabled(bool enabled) { … }
std::optional<int> ActionItem::GetGroupId() const { … }
void ActionItem::SetGroupId(std::optional<int> group_id) { … }
const ui::ImageModel& ActionItem::GetImage() const { … }
void ActionItem::SetImage(const ui::ImageModel& image) { … }
const std::u16string ActionItem::GetText() const { … }
void ActionItem::SetText(const std::u16string& text) { … }
const std::u16string ActionItem::GetTooltipText() const { … }
void ActionItem::SetTooltipText(const std::u16string& tooltip) { … }
bool ActionItem::GetVisible() const { … }
void ActionItem::SetVisible(bool visible) { … }
void ActionItem::SetInvokeActionCallback(InvokeActionCallback callback) { … }
bool ActionItem::GetIsShowingBubble() const { … }
void ActionItem::SetIsShowingBubble(bool showing_bubble) { … }
[[nodiscard]] base::CallbackListSubscription
ActionItem::AddActionChangedCallback(ActionChangedCallback callback) { … }
void ActionItem::AddSynonyms(std::initializer_list<std::u16string> synonyms) { … }
void ActionItem::InvokeAction(ActionInvocationContext context) { … }
int ActionItem::GetInvokeCount() const { … }
std::optional<base::TimeTicks> ActionItem::GetLastInvokeTime() const { … }
base::WeakPtr<ActionItem> ActionItem::GetAsWeakPtr() { … }
ActionItem::ActionItemBuilder ActionItem::Builder(
InvokeActionCallback callback) { … }
ActionItem::ActionItemBuilder ActionItem::Builder() { … }
ScopedActionUpdate ActionItem::BeginUpdate() { … }
void ActionItem::ActionListChanged() { … }
void ActionItem::ActionItemChanged() { … }
void ActionItem::EndUpdate() { … }
BEGIN_METADATA(…)
ActionManager::ActionManager() { … }
ActionManager::~ActionManager() = default;
ActionManager& ActionManager::Get() { … }
ActionManager& ActionManager::GetForTesting() { … }
void ActionManager::ResetForTesting() { … }
void ActionIdMap::ResetMapsForTesting() { … }
std::optional<ActionIdMap::ActionIdToStringMap>&
ActionIdMap::GetGlobalActionIdToStringMap() { … }
std::optional<ActionIdMap::StringToActionIdMap>&
ActionIdMap::GetGlobalStringToActionIdMap() { … }
#define MAP_ACTION_IDS_TO_STRINGS
#include "ui/actions/action_id_macros.inc"
ActionIdMap::ActionIdToStringMap& ActionIdMap::GetActionIdToStringMap() { … }
#include "ui/actions/action_id_macros.inc"
#undef MAP_ACTION_IDS_TO_STRINGS
#define MAP_STRING_TO_ACTION_IDS
#include "ui/actions/action_id_macros.inc"
ActionIdMap::StringToActionIdMap& ActionIdMap::GetStringToActionIdMap() { … }
#include "ui/actions/action_id_macros.inc"
#undef MAP_STRING_TO_ACTION_IDS
std::optional<std::string> ActionIdMap::ActionIdToString(
const ActionId action_id) { … }
std::optional<ActionId> ActionIdMap::StringToActionId(
const std::string action_id_string) { … }
std::vector<std::optional<std::string>> ActionIdMap::ActionIdsToStrings(
std::vector<ActionId> action_ids) { … }
std::vector<std::optional<ActionId>> ActionIdMap::StringsToActionIds(
std::vector<std::string> action_id_strings) { … }
template <typename T, typename U>
void ActionIdMap::MergeMaps(base::flat_map<T, U>& map1,
base::flat_map<T, U>& map2) { … }
void ActionIdMap::AddActionIdToStringMappings(ActionIdToStringMap map) { … }
void ActionIdMap::AddStringToActionIdMappings(StringToActionIdMap map) { … }
std::pair<ActionId, bool> ActionIdMap::CreateActionId(
const std::string& action_name) { … }
void ActionManager::IndexActions() { … }
ActionItem* ActionManager::FindAction(std::u16string term, ActionItem* scope) { … }
ActionItem* ActionManager::FindAction(ActionId action_id, ActionItem* scope) { … }
ActionItem* ActionManager::FindAction(const ui::KeyEvent& key_event,
ActionItem* scope) { … }
void ActionManager::GetActions(ActionItemVector& items, ActionItem* scope) { … }
ActionItem* ActionManager::AddAction(std::unique_ptr<ActionItem> action_item) { … }
std::unique_ptr<ActionItem> ActionManager::RemoveAction(
ActionItem* action_item) { … }
void ActionManager::ResetActions() { … }
void ActionManager::ResetActionItemInitializerList() { … }
base::CallbackListSubscription ActionManager::AppendActionItemInitializer(
ActionItemInitializerList::CallbackType initializer) { … }
ActionItem* ActionManager::FindActionImpl(ActionId action_id,
const ActionList& list) { … }
void ActionManager::GetActionsImpl(ActionItem* item, ActionItemVector& items) { … }
BEGIN_METADATA_BASE(…)
}