OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 |
12 #include "chrome/browser/sessions/session_id.h" | |
11 | 13 |
12 struct SessionWindow; | 14 struct SessionWindow; |
13 | 15 |
14 namespace browser_sync { | 16 namespace browser_sync { |
15 | 17 |
16 // Defines a synced session for use by session sync. A synced session is a | 18 // Defines a synced session for use by session sync. A synced session is a |
17 // list of windows along with a unique session identifer (tag) and meta-data | 19 // list of windows along with a unique session identifer (tag) and meta-data |
18 // about the device being synced. | 20 // about the device being synced. |
19 struct SyncedSession { | 21 struct SyncedSession { |
22 typedef std::map<SessionID::id_type, SessionWindow*> SyncedWindowMap; | |
23 | |
20 // The type of device. | 24 // The type of device. |
21 enum DeviceType { | 25 enum DeviceType { |
22 TYPE_UNSET = 0, | 26 TYPE_UNSET = 0, |
23 TYPE_WIN = 1, | 27 TYPE_WIN = 1, |
24 TYPE_MACOSX = 2, | 28 TYPE_MACOSX = 2, |
25 TYPE_LINUX = 3, | 29 TYPE_LINUX = 3, |
26 TYPE_CHROMEOS = 4, | 30 TYPE_CHROMEOS = 4, |
27 TYPE_OTHER = 5 | 31 TYPE_OTHER = 5 |
28 }; | 32 }; |
29 | 33 |
30 SyncedSession(); | 34 SyncedSession(); |
31 ~SyncedSession(); | 35 ~SyncedSession(); |
32 | 36 |
33 // Unique tag for each session. | 37 // Unique tag for each session. |
34 std::string session_tag; | 38 std::string session_tag; |
35 // User-visible name | 39 // User-visible name |
36 std::string session_name; | 40 std::string session_name; |
41 | |
42 // Type of device this session is from. | |
37 DeviceType device_type; | 43 DeviceType device_type; |
38 std::vector<SessionWindow*> windows; | 44 |
45 // Map of windows that make up this session. Windowws are owned by the session | |
akalin
2011/09/26 21:57:24
Windowws -> Windows
Nicolas Zea
2011/09/26 22:55:26
Done.
| |
46 // itself and free'd on destruction. | |
47 SyncedWindowMap windows; | |
48 | |
49 private: | |
50 DISALLOW_COPY_AND_ASSIGN(SyncedSession); | |
39 }; | 51 }; |
40 | 52 |
41 } // namespace browser_sync | 53 } // namespace browser_sync |
42 | 54 |
43 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_ | 55 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_ |
OLD | NEW |