| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_ | 5 #ifndef IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_ |
| 6 #define IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_ | 6 #define IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/sessions/core/session_id.h" | 9 #include "components/sessions/core/session_id.h" |
| 10 #include "components/sync_sessions/synced_window_delegate.h" | 10 #include "components/sync_sessions/synced_window_delegate.h" |
| 11 | 11 |
| 12 @class TabModel; | 12 class WebStateList; |
| 13 | 13 |
| 14 namespace browser_sync { | 14 namespace browser_sync { |
| 15 class SyncedTabDelegate; | 15 class SyncedTabDelegate; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // A TabModelSyncedWindowDelegate is the iOS-based implementation of | 18 // A TabModelSyncedWindowDelegate is the iOS-based implementation of |
| 19 // SyncedWindowDelegate. | 19 // SyncedWindowDelegate. |
| 20 class TabModelSyncedWindowDelegate | 20 class TabModelSyncedWindowDelegate |
| 21 : public sync_sessions::SyncedWindowDelegate { | 21 : public sync_sessions::SyncedWindowDelegate { |
| 22 public: | 22 public: |
| 23 explicit TabModelSyncedWindowDelegate(TabModel* tab_model); | 23 TabModelSyncedWindowDelegate(WebStateList* web_state_list, |
| 24 SessionID session_id); |
| 24 ~TabModelSyncedWindowDelegate() override; | 25 ~TabModelSyncedWindowDelegate() override; |
| 25 | 26 |
| 26 // SyncedWindowDelegate: | 27 // SyncedWindowDelegate: |
| 27 bool HasWindow() const override; | 28 bool HasWindow() const override; |
| 28 SessionID::id_type GetSessionId() const override; | 29 SessionID::id_type GetSessionId() const override; |
| 29 int GetTabCount() const override; | 30 int GetTabCount() const override; |
| 30 int GetActiveIndex() const override; | 31 int GetActiveIndex() const override; |
| 31 bool IsApp() const override; | 32 bool IsApp() const override; |
| 32 bool IsTypeTabbed() const override; | 33 bool IsTypeTabbed() const override; |
| 33 bool IsTypePopup() const override; | 34 bool IsTypePopup() const override; |
| 34 bool IsTabPinned(const sync_sessions::SyncedTabDelegate* tab) const override; | 35 bool IsTabPinned(const sync_sessions::SyncedTabDelegate* tab) const override; |
| 35 sync_sessions::SyncedTabDelegate* GetTabAt(int index) const override; | 36 sync_sessions::SyncedTabDelegate* GetTabAt(int index) const override; |
| 36 // Return the tab id for the tab at |index|. | 37 // Return the tab id for the tab at |index|. |
| 37 SessionID::id_type GetTabIdAt(int index) const override; | 38 SessionID::id_type GetTabIdAt(int index) const override; |
| 38 bool IsSessionRestoreInProgress() const override; | 39 bool IsSessionRestoreInProgress() const override; |
| 39 bool ShouldSync() const override; | 40 bool ShouldSync() const override; |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 TabModel* tab_model_; // weak, owns us. | 43 WebStateList* web_state_list_; |
| 44 SessionID session_id_; |
| 43 | 45 |
| 44 DISALLOW_COPY_AND_ASSIGN(TabModelSyncedWindowDelegate); | 46 DISALLOW_COPY_AND_ASSIGN(TabModelSyncedWindowDelegate); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_ | 49 #endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_ |
| OLD | NEW |