refactor: Chromium code style for enum classes (#26165)

This commit is contained in:
Milan Burda 2020-10-27 18:51:45 +01:00 committed by GitHub
parent dbf2931f0e
commit 1c99a9b425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 300 additions and 295 deletions

View file

@ -15,34 +15,34 @@
namespace electron {
enum class JumpListResult : int {
SUCCESS = 0,
kSuccess = 0,
// In JS code this error will manifest as an exception.
ARGUMENT_ERROR = 1,
kArgumentError = 1,
// Generic error, the runtime logs may provide some clues.
GENERIC_ERROR = 2,
kGenericError = 2,
// Custom categories can't contain separators.
CUSTOM_CATEGORY_SEPARATOR_ERROR = 3,
kCustomCategorySeparatorError = 3,
// The app isn't registered to handle a file type found in a custom category.
MISSING_FILE_TYPE_REGISTRATION_ERROR = 4,
kMissingFileTypeRegistrationError = 4,
// Custom categories can't be created due to user privacy settings.
CUSTOM_CATEGORY_ACCESS_DENIED_ERROR = 5,
kCustomCategoryAccessDeniedError = 5,
};
struct JumpListItem {
enum class Type {
// A task will launch an app (usually the one that created the Jump List)
// with specific arguments.
TASK,
kTask,
// Separators can only be inserted between items in the standard Tasks
// category, they can't appear in custom categories.
SEPARATOR,
kSeparator,
// A file link will open a file using the app that created the Jump List,
// for this to work the app must be registered as a handler for the file
// type (though the app doesn't have to be the default handler).
FILE
kFile
};
Type type = Type::TASK;
Type type = Type::kTask;
// For tasks this is the path to the program executable, for file links this
// is the full filename.
base::FilePath path;
@ -61,18 +61,18 @@ struct JumpListItem {
struct JumpListCategory {
enum class Type {
// A custom category can contain tasks and files, but not separators.
CUSTOM,
kCustom,
// Frequent/Recent categories are managed by the OS, their name and items
// can't be set by the app (though items can be set indirectly).
FREQUENT,
RECENT,
kFrequent,
kRecent,
// The standard Tasks category can't be renamed by the app, but the app
// can set the items that should appear in this category, and those items
// can include tasks, files, and separators.
TASKS
kTasks
};
Type type = Type::TASKS;
Type type = Type::kTasks;
base::string16 name;
std::vector<JumpListItem> items;