Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: ios/chrome/browser/tabs/tab_model_synced_window_delegate.h

Issue 2585233003: Upstream Chrome on iOS source code [2/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/tabs/tab_model_synced_window_delegate.h
diff --git a/ios/chrome/browser/tabs/tab_model_synced_window_delegate.h b/ios/chrome/browser/tabs/tab_model_synced_window_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..01368a8cddaae00093ba43a49c006a8b41822aa8
--- /dev/null
+++ b/ios/chrome/browser/tabs/tab_model_synced_window_delegate.h
@@ -0,0 +1,47 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_
+#define IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_
+
+#include "base/macros.h"
+#include "components/sessions/core/session_id.h"
+#include "components/sync_sessions/synced_window_delegate.h"
+
+@class TabModel;
+
+namespace browser_sync {
+class SyncedTabDelegate;
+}
+
+// A TabModelSyncedWindowDelegate is the iOS-based implementation of
+// SyncedWindowDelegate.
+class TabModelSyncedWindowDelegate
+ : public sync_sessions::SyncedWindowDelegate {
+ public:
+ explicit TabModelSyncedWindowDelegate(TabModel* tab_model);
+ ~TabModelSyncedWindowDelegate() override;
+
+ // SyncedWindowDelegate:
+ bool HasWindow() const override;
+ SessionID::id_type GetSessionId() const override;
+ int GetTabCount() const override;
+ int GetActiveIndex() const override;
+ bool IsApp() const override;
+ bool IsTypeTabbed() const override;
+ bool IsTypePopup() const override;
+ bool IsTabPinned(const sync_sessions::SyncedTabDelegate* tab) const override;
+ sync_sessions::SyncedTabDelegate* GetTabAt(int index) const override;
+ // Return the tab id for the tab at |index|.
+ SessionID::id_type GetTabIdAt(int index) const override;
+ bool IsSessionRestoreInProgress() const override;
+ bool ShouldSync() const override;
+
+ private:
+ TabModel* tab_model_; // weak, owns us.
+
+ DISALLOW_COPY_AND_ASSIGN(TabModelSyncedWindowDelegate);
+};
+
+#endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_SYNCED_WINDOW_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698