#include "extensions/common/command.h"
#include <stddef.h>
#include <string_view>
#include "base/check.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/android_buildflags.h"
#include "build/build_config.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_constants.h"
#include "ui/base/accelerators/media_keys_listener.h"
namespace extensions {
errors;
keys;
values;
namespace {
static const char kMissing[] = …;
static const char kCommandKeyNotSupported[] = …;
#if BUILDFLAG(IS_CHROMEOS)
static const int kMaxTokenSize = 4;
#else
static const int kMaxTokenSize = …;
#endif
bool DoesRequireModifier(const std::string& accelerator) { … }
ui::Accelerator ParseImpl(const std::string& accelerator,
const std::string& platform_key,
int index,
bool should_parse_media_keys,
std::u16string* error) { … }
std::string NormalizeShortcutSuggestion(const std::string& suggestion,
const std::string& platform) { … }
}
Command::Command() : … { … }
Command::Command(const std::string& command_name,
const std::u16string& description,
const std::string& accelerator,
bool global)
: … { … }
Command::Command(const Command& other) = default;
Command::~Command() = default;
std::string Command::CommandPlatform() { … }
ui::Accelerator Command::StringToAccelerator(const std::string& accelerator,
const std::string& command_name) { … }
std::string Command::AcceleratorToString(const ui::Accelerator& accelerator) { … }
bool Command::IsMediaKey(const ui::Accelerator& accelerator) { … }
bool Command::IsActionRelatedCommand(const std::string& command_name) { … }
bool Command::Parse(const base::Value::Dict& command,
const std::string& command_name,
int index,
std::u16string* error) { … }
}