OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SESSIONS_SESSION_ID_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_ID_H_ |
6 #define CHROME_BROWSER_SESSIONS_SESSION_ID_H_ | 6 #define CHROME_BROWSER_SESSIONS_SESSION_ID_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 | 10 |
11 class NavigationController; | 11 class NavigationController; |
12 class SessionService; | 12 class SessionService; |
| 13 namespace browser_sync { |
| 14 class SessionModelAssociator; |
| 15 } |
13 | 16 |
14 // Uniquely identifies a tab or window for the duration of a session. | 17 // Uniquely identifies a tab or window for the duration of a session. |
15 class SessionID { | 18 class SessionID { |
16 public: | 19 public: |
17 typedef int32 id_type; | 20 typedef int32 id_type; |
18 | 21 |
19 SessionID(); | 22 SessionID(); |
20 ~SessionID() {} | 23 ~SessionID() {} |
21 | 24 |
22 // Returns the underlying id. | 25 // Returns the underlying id. |
23 id_type id() const { return id_; } | 26 id_type id() const { return id_; } |
24 | 27 |
25 private: | 28 private: |
26 friend class NavigationController; | 29 friend class NavigationController; |
27 friend class SessionService; | 30 friend class SessionService; |
| 31 friend class browser_sync::SessionModelAssociator; |
28 | 32 |
29 explicit SessionID(id_type id) : id_(id) {} | 33 explicit SessionID(id_type id) : id_(id) {} |
30 | 34 |
31 // Resets the id. This is used when restoring a session | 35 // Resets the id. This is used when restoring a session |
32 void set_id(id_type id) { id_ = id; } | 36 void set_id(id_type id) { id_ = id; } |
33 | 37 |
34 id_type id_; | 38 id_type id_; |
35 }; | 39 }; |
36 | 40 |
37 #endif // CHROME_BROWSER_SESSIONS_SESSION_ID_H_ | 41 #endif // CHROME_BROWSER_SESSIONS_SESSION_ID_H_ |
OLD | NEW |