OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNCED_TAB_DELEGATE_H_ | 5 #ifndef IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNCED_TAB_DELEGATE_H_ |
6 #define IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNCED_TAB_DELEGATE_H_ | 6 #define IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNCED_TAB_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/sessions/core/session_id.h" | 14 #include "components/sessions/core/session_id.h" |
15 #include "components/sync_sessions/synced_tab_delegate.h" | 15 #include "components/sync_sessions/synced_tab_delegate.h" |
16 #include "ios/web/public/web_state/web_state_user_data.h" | 16 #include "ios/web/public/web_state/web_state_user_data.h" |
17 | 17 |
18 class IOSChromeSyncedTabDelegate | 18 class IOSChromeSyncedTabDelegate |
19 : public sync_sessions::SyncedTabDelegate, | 19 : public sync_sessions::SyncedTabDelegate, |
20 public web::WebStateUserData<IOSChromeSyncedTabDelegate> { | 20 public web::WebStateUserData<IOSChromeSyncedTabDelegate> { |
21 public: | 21 public: |
22 ~IOSChromeSyncedTabDelegate() override; | 22 ~IOSChromeSyncedTabDelegate() override; |
23 | 23 |
24 // SyncedTabDelegate: | 24 // SyncedTabDelegate: |
25 SessionID::id_type GetWindowId() const override; | 25 SessionID::id_type GetWindowId() const override; |
26 SessionID::id_type GetSessionId() const override; | 26 SessionID::id_type GetSessionId() const override; |
27 bool IsBeingDestroyed() const override; | 27 bool IsBeingDestroyed() const override; |
| 28 SessionID::id_type GetSourceTabID() const override; |
28 std::string GetExtensionAppId() const override; | 29 std::string GetExtensionAppId() const override; |
29 bool IsInitialBlankNavigation() const override; | 30 bool IsInitialBlankNavigation() const override; |
30 int GetCurrentEntryIndex() const override; | 31 int GetCurrentEntryIndex() const override; |
31 int GetEntryCount() const override; | 32 int GetEntryCount() const override; |
32 GURL GetVirtualURLAtIndex(int i) const override; | 33 GURL GetVirtualURLAtIndex(int i) const override; |
33 GURL GetFaviconURLAtIndex(int i) const override; | 34 GURL GetFaviconURLAtIndex(int i) const override; |
34 ui::PageTransition GetTransitionAtIndex(int i) const override; | 35 ui::PageTransition GetTransitionAtIndex(int i) const override; |
35 void GetSerializedNavigationAtIndex( | 36 void GetSerializedNavigationAtIndex( |
36 int i, | 37 int i, |
37 sessions::SerializedNavigationEntry* serialized_entry) const override; | 38 sessions::SerializedNavigationEntry* serialized_entry) const override; |
38 bool ProfileIsSupervised() const override; | 39 bool ProfileIsSupervised() const override; |
39 const std::vector<std::unique_ptr<const sessions::SerializedNavigationEntry>>* | 40 const std::vector<std::unique_ptr<const sessions::SerializedNavigationEntry>>* |
40 GetBlockedNavigations() const override; | 41 GetBlockedNavigations() const override; |
41 bool IsPlaceholderTab() const override; | 42 bool IsPlaceholderTab() const override; |
42 int GetSyncId() const override; | 43 int GetSyncId() const override; |
43 void SetSyncId(int sync_id) override; | 44 void SetSyncId(int sync_id) override; |
44 bool ShouldSync(sync_sessions::SyncSessionsClient* sessions_client) override; | 45 bool ShouldSync(sync_sessions::SyncSessionsClient* sessions_client) override; |
45 | 46 |
46 private: | 47 private: |
47 explicit IOSChromeSyncedTabDelegate(web::WebState* web_state); | 48 explicit IOSChromeSyncedTabDelegate(web::WebState* web_state); |
48 friend class web::WebStateUserData<IOSChromeSyncedTabDelegate>; | 49 friend class web::WebStateUserData<IOSChromeSyncedTabDelegate>; |
49 | 50 |
50 web::WebState* web_state_; | 51 web::WebState* web_state_; |
51 int sync_session_id_; | 52 int sync_session_id_; |
52 | 53 |
53 DISALLOW_COPY_AND_ASSIGN(IOSChromeSyncedTabDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(IOSChromeSyncedTabDelegate); |
54 }; | 55 }; |
55 | 56 |
56 #endif // IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNCED_TAB_DELEGATE_H_ | 57 #endif // IOS_CHROME_BROWSER_SYNC_IOS_CHROME_SYNCED_TAB_DELEGATE_H_ |
OLD | NEW |