Commit 2288d58e authored by zea@chromium.org's avatar zea@chromium.org

[Sync] Update session protos.

BUG=59672
TEST=none


Review URL: http://codereview.chromium.org/7753019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98470 0039d316-1c4b-4281-b951-d872f2087c98
parent 8f2ba5a4
...@@ -89,6 +89,17 @@ const char* GetUpdatesSourceString( ...@@ -89,6 +89,17 @@ const char* GetUpdatesSourceString(
return ""; return "";
} }
const char* GetDeviceTypeString(
sync_pb::SessionHeader::DeviceType device_type) {
ASSERT_ENUM_BOUNDS(sync_pb::SessionHeader, DeviceType, TYPE_PC, TYPE_CROS);
switch (device_type) {
ENUM_CASE(sync_pb::SessionHeader, TYPE_PC);
ENUM_CASE(sync_pb::SessionHeader, TYPE_CROS);
}
NOTREACHED();
return "";
}
#undef ASSERT_ENUM_BOUNDS #undef ASSERT_ENUM_BOUNDS
#undef ENUM_CASE #undef ENUM_CASE
......
...@@ -31,6 +31,9 @@ const char* GetPageTransitionQualifierString( ...@@ -31,6 +31,9 @@ const char* GetPageTransitionQualifierString(
const char* GetUpdatesSourceString( const char* GetUpdatesSourceString(
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source); sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source);
const char* GetDeviceTypeString(
sync_pb::SessionHeader::DeviceType device_type);
} // namespace browser_sync } // namespace browser_sync
#endif // CHROME_BROWSER_SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_ #endif // CHROME_BROWSER_SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_
...@@ -104,6 +104,8 @@ DictionaryValue* SessionHeaderToValue( ...@@ -104,6 +104,8 @@ DictionaryValue* SessionHeaderToValue(
const sync_pb::SessionHeader& proto) { const sync_pb::SessionHeader& proto) {
DictionaryValue* value = new DictionaryValue(); DictionaryValue* value = new DictionaryValue();
SET_REP(window, SessionWindowToValue); SET_REP(window, SessionWindowToValue);
SET_STR(client_name);
SET_ENUM(device_type, GetDeviceTypeString);
return value; return value;
} }
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -20,12 +20,20 @@ message SessionSpecifics { ...@@ -20,12 +20,20 @@ message SessionSpecifics {
// Unique id for the client. // Unique id for the client.
optional string session_tag = 1; optional string session_tag = 1;
optional SessionHeader header = 2; optional SessionHeader header = 2;
optional SessionTab tab = 3; optional SessionTab tab = 3;
} }
// Properties of session sync objects. // Properties of session sync objects.
message SessionHeader { message SessionHeader {
// Each session is composed of windows. // Each session is composed of windows.
repeated SessionWindow window = 2; repeated SessionWindow window = 2;
// A non-unique but human-readable name to describe this client.
optional string client_name = 3;
// The type of device.
enum DeviceType {
TYPE_PC = 1;
TYPE_CROS = 2;
}
optional DeviceType device_type = 4;
} }
message SessionWindow { message SessionWindow {
// Unique (to the owner) id for this window. // Unique (to the owner) id for this window.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment