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

Unified Diff: chrome/browser/ui/android/tab_model/tab_model.h

Issue 10701030: Refactor SyncedWindowDelegateAndroid into TabModel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit fixes Created 8 years, 5 months 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: chrome/browser/ui/android/tab_model/tab_model.h
diff --git a/chrome/browser/ui/android/tab_model/tab_model.h b/chrome/browser/ui/android/tab_model/tab_model.h
new file mode 100644
index 0000000000000000000000000000000000000000..a82f6c3e381387d2cc86adf7c1e12990943919ac
--- /dev/null
+++ b/chrome/browser/ui/android/tab_model/tab_model.h
@@ -0,0 +1,55 @@
+// Copyright (c) 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 CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_
+#define CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_
+
+#include "chrome/browser/sessions/session_id.h"
+
+namespace browser_sync {
+class SyncedWindowDelegate;
+}
+
+namespace content {
+class WebContents;
+}
+
+class Profile;
+class TabContents;
+
+// Abstract representation of a Tab Model for Android. Since Android does
+// not use Browser/BrowserList, this is required to allow Chrome to interact
+// with Android's Tabs and Tab Model.
+class TabModel {
+ public:
+ TabModel();
+ virtual ~TabModel();
+
+ virtual SessionID::id_type GetSessionId() const = 0;
+ virtual int GetTabCount() const = 0;
+ virtual int GetActiveIndex() const = 0;
+ virtual TabContents* GetTabContentsAt(int index) const = 0;
+ virtual SessionID::id_type GetTabIdAt(int index) const = 0;
+
+ // Used for restoring tabs from synced foreign sessions.
+ virtual void CreateTab(content::WebContents* web_contents) = 0;
+
+ // Return true if we are currently restoring sessions asynchronously.
+ virtual bool IsSessionRestoreInProgress() const = 0;
+
+ virtual void OpenClearBrowsingData() const = 0;
+ virtual Profile* GetProfile() const = 0;
+
+ virtual browser_sync::SyncedWindowDelegate* GetSyncedWindowDelegate() = 0;
+
+ protected:
+ // Instructs the TabModel to broadcast a notification that all tabs are now
+ // loaded from storage.
+ void BroadcastSessionRestoreComplete();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TabModel);
+};
+
+#endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_
« no previous file with comments | « chrome/browser/sync/glue/synced_window_delegate_registry.cc ('k') | chrome/browser/ui/android/tab_model/tab_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698