| Index: components/sync/base/model_type.h
|
| diff --git a/components/sync/base/model_type.h b/components/sync/base/model_type.h
|
| index eb8365323f7beb9a8e4f57afde54870ea2e6b010..c6d544f5fd5bdf582b7eba22a4bd7685dabc4c52 100644
|
| --- a/components/sync/base/model_type.h
|
| +++ b/components/sync/base/model_type.h
|
| @@ -12,6 +12,7 @@
|
| #include <string>
|
|
|
| #include "base/logging.h"
|
| +#include "components/reading_list/core/reading_list_enable_flags.h"
|
| #include "components/sync/base/enum_set.h"
|
|
|
| namespace base {
|
| @@ -201,11 +202,26 @@ ModelTypeSet ProtocolTypes();
|
| // These are the normal user-controlled types. This is to distinguish from
|
| // ControlTypes which are always enabled. Note that some of these share a
|
| // preference flag, so not all of them are individually user-selectable.
|
| -ModelTypeSet UserTypes();
|
| +constexpr ModelTypeSet UserTypes() {
|
| + return ModelTypeSet::FromRange(FIRST_USER_MODEL_TYPE, LAST_USER_MODEL_TYPE);
|
| +}
|
|
|
| // These are the user-selectable data types.
|
| -ModelTypeSet UserSelectableTypes();
|
| -bool IsUserSelectableType(ModelType model_type);
|
| +constexpr ModelTypeSet UserSelectableTypes() {
|
| + return ModelTypeSet({
|
| + BOOKMARKS, PREFERENCES, PASSWORDS, AUTOFILL, THEMES, TYPED_URLS, EXTENSIONS,
|
| + APPS,
|
| +#if BUILDFLAG(ENABLE_READING_LIST)
|
| + READING_LIST,
|
| +#endif
|
| + PROXY_TABS
|
| + });
|
| +}
|
| +
|
| +constexpr bool IsUserSelectableType(ModelType model_type) {
|
| + return UserSelectableTypes().Has(model_type);
|
| +}
|
| +
|
| ModelTypeNameMap GetUserSelectableTypeNameMap();
|
|
|
| // This is the subset of UserTypes() that can be encrypted.
|
| @@ -213,12 +229,9 @@ ModelTypeSet EncryptableUserTypes();
|
|
|
| // This is the subset of UserTypes() that have priority over other types. These
|
| // types are synced before other user types and are never encrypted.
|
| -ModelTypeSet PriorityUserTypes();
|
| -
|
| -// Proxy types are placeholder types for handling implicitly enabling real
|
| -// types. They do not exist at the server, and are simply used for
|
| -// UI/Configuration logic.
|
| -ModelTypeSet ProxyTypes();
|
| +constexpr ModelTypeSet PriorityUserTypes() {
|
| + return ModelTypeSet({DEVICE_INFO, PRIORITY_PREFERENCES});
|
| +}
|
|
|
| // Returns a list of all control types.
|
| //
|
| @@ -230,12 +243,24 @@ ModelTypeSet ProxyTypes();
|
| // - Their contents are not encrypted automatically.
|
| // - They support custom update application and conflict resolution logic.
|
| // - All change processing occurs on the sync thread (GROUP_PASSIVE).
|
| -ModelTypeSet ControlTypes();
|
| +constexpr ModelTypeSet ControlTypes() {
|
| + return ModelTypeSet::FromRange(FIRST_CONTROL_MODEL_TYPE,
|
| + LAST_CONTROL_MODEL_TYPE);
|
| +}
|
| +
|
| +// Proxy types are placeholder types for handling implicitly enabling real
|
| +// types. They do not exist at the server, and are simply used for
|
| +// UI/Configuration logic.
|
| +constexpr ModelTypeSet ProxyTypes() {
|
| + return ModelTypeSet::FromRange(FIRST_PROXY_TYPE, LAST_PROXY_TYPE);
|
| +}
|
|
|
| // Returns true if this is a control type.
|
| //
|
| // See comment above for more information on what makes these types special.
|
| -bool IsControlType(ModelType model_type);
|
| +constexpr bool IsControlType(ModelType model_type) {
|
| + return ControlTypes().Has(model_type);
|
| +}
|
|
|
| // Core types are those data types used by sync's core functionality (i.e. not
|
| // user data types). These types are always enabled, and include ControlTypes().
|
|
|