OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TAB_DELEGATE_H__ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__ |
6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/sessions/session_id.h" | 10 #include "chrome/browser/sessions/session_id.h" |
11 | 11 |
12 class Profile; | 12 class Profile; |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class NavigationEntry; | 15 class NavigationEntry; |
16 } | 16 } |
17 | 17 |
18 namespace browser_sync { | 18 namespace browser_sync { |
19 | 19 |
20 // A SyncedTabDelegate is used to insulate the sync code from depending | 20 // A SyncedTabDelegate is used to insulate the sync code from depending |
21 // directly on WebContents, NavigationController, and the extensions TabHelper. | 21 // directly on WebContents, NavigationController, and the extensions TabHelper. |
22 class SyncedTabDelegate { | 22 class SyncedTabDelegate { |
23 public: | 23 public: |
24 virtual ~SyncedTabDelegate() {} | 24 virtual ~SyncedTabDelegate() {} |
25 | 25 |
26 // Methods from TabContents. | 26 // Methods from TabContents. |
27 | 27 |
28 virtual SessionID::id_type GetWindowId() const = 0; | 28 virtual const SessionID& GetWindowId() const = 0; |
29 virtual SessionID::id_type GetSessionId() const = 0; | 29 virtual const SessionID& GetSessionId() const = 0; |
30 virtual bool IsBeingDestroyed() const = 0; | 30 virtual bool IsBeingDestroyed() const = 0; |
31 virtual Profile* profile() const = 0; | 31 virtual Profile* profile() const = 0; |
32 | 32 |
33 // Method derived from extensions TabHelper. | 33 // Method derived from extensions TabHelper. |
34 | 34 |
35 virtual std::string GetExtensionAppId() const = 0; | 35 virtual std::string GetExtensionAppId() const = 0; |
36 | 36 |
37 // Methods from NavigationController. | 37 // Methods from NavigationController. |
38 | 38 |
39 virtual int GetCurrentEntryIndex() const = 0; | 39 virtual int GetCurrentEntryIndex() const = 0; |
40 virtual int GetEntryCount() const = 0; | 40 virtual int GetEntryCount() const = 0; |
41 virtual int GetPendingEntryIndex() const = 0; | 41 virtual int GetPendingEntryIndex() const = 0; |
42 virtual content::NavigationEntry* GetPendingEntry() const = 0; | 42 virtual content::NavigationEntry* GetPendingEntry() const = 0; |
43 virtual content::NavigationEntry* GetEntryAtIndex(int i) const = 0; | 43 virtual content::NavigationEntry* GetEntryAtIndex(int i) const = 0; |
44 virtual content::NavigationEntry* GetActiveEntry() const = 0; | 44 virtual content::NavigationEntry* GetActiveEntry() const = 0; |
| 45 virtual int64 GetSyncSessionId() const = 0; |
| 46 virtual void SetSyncSessionId(const int64 sync_id) = 0; |
| 47 virtual bool IsTabInMemory() const = 0; |
45 | 48 |
46 virtual bool IsPinned() const = 0; | 49 virtual bool IsPinned() const = 0; |
47 }; | 50 }; |
48 | 51 |
49 } // namespace browser_sync | 52 } // namespace browser_sync |
50 | 53 |
51 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__ | 54 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__ |
OLD | NEW |