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

Unified Diff: chrome/browser/sessions/tab_restore_service.h

Issue 6660028: Decouple TabRestoreService from Browser (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add doc references and fix lint Created 9 years, 9 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/sessions/tab_restore_service.h
diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h
index 8ad7321235871e280655e440df85482724e3d8d4..341f64cee50b5480637c489f059653ff342d60ca 100644
--- a/chrome/browser/sessions/tab_restore_service.h
+++ b/chrome/browser/sessions/tab_restore_service.h
@@ -17,9 +17,9 @@
#include "chrome/browser/sessions/session_types.h"
#include "content/browser/in_process_webkit/session_storage_namespace.h"
-class Browser;
class NavigationController;
class Profile;
+class TabRestoreServiceDelegate;
class TabRestoreServiceObserver;
struct SessionWindow;
@@ -127,15 +127,15 @@ class TabRestoreService : public BaseSessionService {
// Creates a Tab to represent |tab| and notifies observers the list of
// entries has changed.
- void CreateHistoricalTab(NavigationController* tab);
+ void CreateHistoricalTab(NavigationController* tab, int index);
// Invoked when a browser is closing. If |browser| is a tabbed browser with
// at least one tab, a Window is created, added to entries and observers are
// notified.
- void BrowserClosing(Browser* browser);
+ void BrowserClosing(TabRestoreServiceDelegate* browser);
sky 2011/03/11 17:40:37 rename argument to delegate (comment applies to al
torne_google.com 2011/03/14 15:07:25 Done.
// Invoked when the browser is done closing.
- void BrowserClosed(Browser* browser);
+ void BrowserClosed(TabRestoreServiceDelegate* browser);
// Removes all entries from the list and notifies observers the list
// of tabs has changed.
@@ -148,13 +148,13 @@ class TabRestoreService : public BaseSessionService {
// Restores the most recently closed entry. Does nothing if there are no
// entries to restore. If the most recently restored entry is a tab, it is
// added to |browser|.
- void RestoreMostRecentEntry(Browser* browser);
+ void RestoreMostRecentEntry(TabRestoreServiceDelegate* browser);
// Restores an entry by id. If there is no entry with an id matching |id|,
// this does nothing. If |replace_existing_tab| is true and id identifies a
// tab, the newly created tab replaces the selected tab in |browser|. If
// |browser| is NULL, this creates a new window for the entry.
- void RestoreEntryById(Browser* browser,
+ void RestoreEntryById(TabRestoreServiceDelegate* browser,
SessionID::id_type id,
bool replace_existing_tab);
@@ -194,9 +194,10 @@ class TabRestoreService : public BaseSessionService {
};
// Populates the tab's navigations from the NavigationController, and its
- // browser_id and tabstrip_index from the browser.
+ // browser_id and pinned state from the browser.
void PopulateTab(Tab* tab,
- Browser* browser,
+ int index,
+ TabRestoreServiceDelegate* browser,
NavigationController* controller);
// Notifies observers the tabs have changed.
@@ -261,9 +262,9 @@ class TabRestoreService : public BaseSessionService {
// tab. If |replace_existing_tab| is true, the newly created tab replaces the
// selected tab in |browser|. If |browser| is NULL, this creates a new window
// for the entry. This returns the Browser into which the tab was restored.
- Browser* RestoreTab(const Tab& tab,
- Browser* browser,
- bool replace_existing_tab);
+ TabRestoreServiceDelegate* RestoreTab(const Tab& tab,
+ TabRestoreServiceDelegate* browser,
+ bool replace_existing_tab);
// Returns true if |tab| has more than one navigation. If |tab| has more
// than one navigation |tab->current_navigation_index| is constrained based
@@ -323,7 +324,7 @@ class TabRestoreService : public BaseSessionService {
// Set of tabs that we've received a BrowserClosing method for but no
sky 2011/03/11 17:40:37 tabs-> delegates. Field should be renamed to deleg
torne_google.com 2011/03/14 15:07:25 Done.
// corresponding BrowserClosed. We cache the set of browsers closing to
// avoid creating historical tabs for them.
- std::set<Browser*> closing_browsers_;
+ std::set<TabRestoreServiceDelegate*> closing_browsers_;
// Used when loading previous tabs/session.
CancelableRequestConsumer load_consumer_;
@@ -340,4 +341,3 @@ class TabRestoreService : public BaseSessionService {
};
#endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_
-
« no previous file with comments | « no previous file | chrome/browser/sessions/tab_restore_service.cc » ('j') | chrome/browser/sessions/tab_restore_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698