diff options
Diffstat (limited to 'sync/protocol')
-rw-r--r-- | sync/protocol/app_specifics.proto | 15 | ||||
-rw-r--r-- | sync/protocol/proto_enum_conversions.cc | 12 | ||||
-rw-r--r-- | sync/protocol/proto_enum_conversions.h | 5 | ||||
-rw-r--r-- | sync/protocol/proto_value_conversions.cc | 1 |
4 files changed, 31 insertions, 2 deletions
diff --git a/sync/protocol/app_specifics.proto b/sync/protocol/app_specifics.proto index a7f09ec..374a219 100644 --- a/sync/protocol/app_specifics.proto +++ b/sync/protocol/app_specifics.proto @@ -47,7 +47,7 @@ message AppSpecifics { optional ExtensionSpecifics extension = 1; // Notification settings. - optional AppNotificationSettings notification_settings = 2; + optional AppNotificationSettings notification_settings = 2; // This controls where on a page this application icon will appear. optional string app_launch_ordinal = 3; @@ -56,5 +56,16 @@ message AppSpecifics { // This values only provide the order within the application pages, not within // all of the panels in the NTP. optional string page_ordinal = 4; -} + // The possible launch types for an app. + // This enum should be kept in sync with extensions::LaunchType. + enum LaunchType { + PINNED = 0; + REGULAR = 1; + FULLSCREEN = 2; + WINDOW = 3; + } + + // This describes how the extension should be launched. + optional LaunchType launch_type = 5; +} diff --git a/sync/protocol/proto_enum_conversions.cc b/sync/protocol/proto_enum_conversions.cc index af95822..c624efe 100644 --- a/sync/protocol/proto_enum_conversions.cc +++ b/sync/protocol/proto_enum_conversions.cc @@ -170,6 +170,18 @@ const char* GetActionString(sync_pb::SyncEnums::Action action) { } +const char* GetLaunchTypeString(sync_pb::AppSpecifics::LaunchType launch_type) { + ASSERT_ENUM_BOUNDS(sync_pb::AppSpecifics, LaunchType, PINNED, WINDOW); + switch (launch_type) { + ENUM_CASE(sync_pb::AppSpecifics, PINNED); + ENUM_CASE(sync_pb::AppSpecifics, REGULAR); + ENUM_CASE(sync_pb::AppSpecifics, FULLSCREEN); + ENUM_CASE(sync_pb::AppSpecifics, WINDOW); + } + NOTREACHED(); + return ""; +} + const char* GetDeviceTypeString( sync_pb::SyncEnums::DeviceType device_type) { ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, DeviceType, TYPE_WIN, TYPE_TABLET); diff --git a/sync/protocol/proto_enum_conversions.h b/sync/protocol/proto_enum_conversions.h index 6812cb7..224abbc 100644 --- a/sync/protocol/proto_enum_conversions.h +++ b/sync/protocol/proto_enum_conversions.h @@ -9,6 +9,7 @@ #include "sync/base/sync_export.h" #include "sync/protocol/app_list_specifics.pb.h" +#include "sync/protocol/app_specifics.pb.h" #include "sync/protocol/client_debug_info.pb.h" #include "sync/protocol/session_specifics.pb.h" #include "sync/protocol/sync.pb.h" @@ -49,6 +50,10 @@ SYNC_EXPORT_PRIVATE const char* GetErrorTypeString( SYNC_EXPORT_PRIVATE const char* GetActionString( sync_pb::SyncEnums::Action action); +SYNC_EXPORT_PRIVATE const char* GetLaunchTypeString( + sync_pb::AppSpecifics::LaunchType launch_type); + + const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type); const char* GetFaviconTypeString(sync_pb::SessionTab::FaviconType favicon_type); diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc index b142919..be639425 100644 --- a/sync/protocol/proto_value_conversions.cc +++ b/sync/protocol/proto_value_conversions.cc @@ -389,6 +389,7 @@ base::DictionaryValue* AppSpecificsToValue( SET(notification_settings, AppSettingsToValue); SET_STR(app_launch_ordinal); SET_STR(page_ordinal); + SET_ENUM(launch_type, GetLaunchTypeString); return value; } |