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

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

Issue 3340007: Revert "FBTF: Move the TabRestoreService::Observer into its own file." (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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
« no previous file with comments | « chrome/browser/sessions/session_types.cc ('k') | chrome/browser/sessions/tab_restore_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f9a237b00fd78ea3bf2272e86e8c6891f2f00b6..e12b9d1fc974d875461bebf3c4c42983278234e2 100644
--- a/chrome/browser/sessions/tab_restore_service.h
+++ b/chrome/browser/sessions/tab_restore_service.h
@@ -20,7 +20,6 @@ class Browser;
class NavigationController;
class Profile;
struct SessionWindow;
-class TabRestoreServiceObserver;
// TabRestoreService is responsible for maintaining the most recently closed
// tabs and windows. When a tab is closed
@@ -35,6 +34,21 @@ class TabRestoreServiceObserver;
// add an observer.
class TabRestoreService : public BaseSessionService {
public:
+ // Observer is notified when the set of entries managed by TabRestoreService
+ // changes in some way.
+ class Observer {
+ public:
+ // Sent when the set of entries changes in some way.
+ virtual void TabRestoreServiceChanged(TabRestoreService* service) = 0;
+
+ // Sent to all remaining Observers when TabRestoreService's
+ // destructor is run.
+ virtual void TabRestoreServiceDestroyed(TabRestoreService* service) = 0;
+
+ protected:
+ virtual ~Observer() {}
+ };
+
// Interface used to allow the test to provide a custom time.
class TimeFactory {
public:
@@ -118,8 +132,8 @@ class TabRestoreService : public BaseSessionService {
// Adds/removes an observer. TabRestoreService does not take ownership of
// the observer.
- void AddObserver(TabRestoreServiceObserver* observer);
- void RemoveObserver(TabRestoreServiceObserver* observer);
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
// Creates a Tab to represent |tab| and notifies observers the list of
// entries has changed.
@@ -314,7 +328,7 @@ class TabRestoreService : public BaseSessionService {
// Number of entries we've written.
int entries_written_;
- ObserverList<TabRestoreServiceObserver> observer_list_;
+ ObserverList<Observer> observer_list_;
// Set of tabs that we've received a BrowserClosing method for but no
// corresponding BrowserClosed. We cache the set of browsers closing to
« no previous file with comments | « chrome/browser/sessions/session_types.cc ('k') | chrome/browser/sessions/tab_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698