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

Unified Diff: chrome/browser/ui/browser_list.h

Issue 10690151: Move implementation of BrowserList onto an inner, instantiatable class, BrowserListImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/browser_list.h
===================================================================
--- chrome/browser/ui/browser_list.h (revision 146126)
+++ chrome/browser/ui/browser_list.h (working copy)
@@ -25,6 +25,7 @@
}
namespace chrome {
+class BrowserListObserver;
namespace internal {
void NotifyNotDefaultBrowserCallback();
}
@@ -52,31 +53,14 @@
typedef BrowserVector::const_iterator const_iterator;
typedef BrowserVector::const_reverse_iterator const_reverse_iterator;
- // It is not allowed to change the global window list (add or remove any
- // browser windows while handling observer callbacks.
- class Observer {
- public:
- // Called immediately after a browser is added to the list
- virtual void OnBrowserAdded(Browser* browser) {}
-
- // Called immediately after a browser is removed from the list
- virtual void OnBrowserRemoved(Browser* browser) {}
-
- // Called immediately after a browser is set active (SetLastActive)
- virtual void OnBrowserSetLastActive(Browser* browser) {}
-
- protected:
- virtual ~Observer() {}
- };
-
// Adds and removes browsers from the global list. The browser object should
// be valid BEFORE these calls (for the benefit of observers), so notify and
// THEN delete the object.
static void AddBrowser(Browser* browser);
static void RemoveBrowser(Browser* browser);
- static void AddObserver(Observer* observer);
- static void RemoveObserver(Observer* observer);
+ static void AddObserver(chrome::BrowserListObserver* observer);
+ static void RemoveObserver(chrome::BrowserListObserver* observer);
// Called by Browser objects when their window is activated (focused). This
// allows us to determine what the last active Browser was.
@@ -143,9 +127,6 @@
// THIS FUNCTION IS PRIVATE AND NOT TO BE USED AS A REPLACEMENT FOR RELEVANT
// CONTEXT.
static Browser* GetLastActive();
-
- // Helper method to remove a browser instance from a list of browsers
- static void RemoveBrowserFrom(Browser* browser, BrowserVector* browser_list);
};
#endif // CHROME_BROWSER_UI_BROWSER_LIST_H_

Powered by Google App Engine
This is Rietveld 408576698