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_UI_SYNC_TAB_CONTENTS_SYNCED_TAB_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_TAB_CONTENTS_SYNCED_TAB_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_SYNC_TAB_CONTENTS_SYNCED_TAB_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_SYNC_TAB_CONTENTS_SYNCED_TAB_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | |
10 #include "components/sessions/core/session_id.h" | 9 #include "components/sessions/core/session_id.h" |
| 10 #include "components/sync_sessions/synced_tab_delegate.h" |
11 #include "content/public/browser/web_contents_user_data.h" | 11 #include "content/public/browser/web_contents_user_data.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class WebContents; | 14 class WebContents; |
15 } | 15 } |
16 | 16 |
17 class TabContentsSyncedTabDelegate | 17 class TabContentsSyncedTabDelegate |
18 : public browser_sync::SyncedTabDelegate, | 18 : public browser_sync::SyncedTabDelegate, |
19 public content::WebContentsUserData<TabContentsSyncedTabDelegate> { | 19 public content::WebContentsUserData<TabContentsSyncedTabDelegate> { |
20 public: | 20 public: |
21 ~TabContentsSyncedTabDelegate() override; | 21 ~TabContentsSyncedTabDelegate() override; |
22 | 22 |
23 // Methods from SyncedTabDelegate. | 23 // SyncedTabDelegate: |
24 SessionID::id_type GetWindowId() const override; | 24 SessionID::id_type GetWindowId() const override; |
25 SessionID::id_type GetSessionId() const override; | 25 SessionID::id_type GetSessionId() const override; |
26 bool IsBeingDestroyed() const override; | 26 bool IsBeingDestroyed() const override; |
27 Profile* profile() const override; | |
28 std::string GetExtensionAppId() const override; | 27 std::string GetExtensionAppId() const override; |
29 bool IsInitialBlankNavigation() const override; | 28 bool IsInitialBlankNavigation() const override; |
30 int GetCurrentEntryIndex() const override; | 29 int GetCurrentEntryIndex() const override; |
31 int GetEntryCount() const override; | 30 int GetEntryCount() const override; |
32 int GetPendingEntryIndex() const override; | 31 GURL GetVirtualURLAtIndex(int i) const override; |
33 content::NavigationEntry* GetPendingEntry() const override; | 32 GURL GetFaviconURLAtIndex(int i) const override; |
34 content::NavigationEntry* GetEntryAtIndex(int i) const override; | 33 ui::PageTransition GetTransitionAtIndex(int i) const override; |
35 content::NavigationEntry* GetActiveEntry() const override; | 34 void GetSerializedNavigationAtIndex( |
| 35 int i, |
| 36 sessions::SerializedNavigationEntry* serialized_entry) const override; |
36 bool ProfileIsSupervised() const override; | 37 bool ProfileIsSupervised() const override; |
37 const std::vector<const content::NavigationEntry*>* GetBlockedNavigations() | 38 const std::vector<const sessions::SerializedNavigationEntry*>* |
38 const override; | 39 GetBlockedNavigations() const override; |
39 bool IsPinned() const override; | 40 bool IsPlaceholderTab() const override; |
40 bool HasWebContents() const override; | |
41 content::WebContents* GetWebContents() const override; | |
42 int GetSyncId() const override; | 41 int GetSyncId() const override; |
43 void SetSyncId(int sync_id) override; | 42 void SetSyncId(int sync_id) override; |
| 43 bool ShouldSync(sync_sessions::SyncSessionsClient* sessions_client) override; |
44 | 44 |
45 private: | 45 private: |
46 explicit TabContentsSyncedTabDelegate(content::WebContents* web_contents); | 46 explicit TabContentsSyncedTabDelegate(content::WebContents* web_contents); |
47 friend class content::WebContentsUserData<TabContentsSyncedTabDelegate>; | 47 friend class content::WebContentsUserData<TabContentsSyncedTabDelegate>; |
48 | 48 |
49 content::WebContents* web_contents_; | 49 content::WebContents* web_contents_; |
50 int sync_session_id_; | 50 int sync_session_id_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(TabContentsSyncedTabDelegate); | 52 DISALLOW_COPY_AND_ASSIGN(TabContentsSyncedTabDelegate); |
53 }; | 53 }; |
54 | 54 |
55 #endif // CHROME_BROWSER_UI_SYNC_TAB_CONTENTS_SYNCED_TAB_DELEGATE_H_ | 55 #endif // CHROME_BROWSER_UI_SYNC_TAB_CONTENTS_SYNCED_TAB_DELEGATE_H_ |
OLD | NEW |