OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 class Browser; | 12 class Browser; |
13 class Profile; | 13 class Profile; |
14 | 14 |
15 namespace chrome { | 15 namespace chrome { |
16 class BrowserListObserver; | 16 class BrowserListObserver; |
17 } | 17 } |
18 | 18 |
19 // Stores a list of all Browser objects. | 19 // Stores a list of all Browser objects. |
20 class BrowserList { | 20 class BrowserList { |
21 public: | 21 public: |
22 typedef std::vector<Browser*> BrowserVector; | 22 typedef std::vector<Browser*> BrowserVector; |
23 typedef BrowserVector::iterator iterator; | |
24 typedef BrowserVector::const_iterator const_iterator; | 23 typedef BrowserVector::const_iterator const_iterator; |
25 typedef BrowserVector::const_reverse_iterator const_reverse_iterator; | 24 typedef BrowserVector::const_reverse_iterator const_reverse_iterator; |
26 | 25 |
27 // Adds and removes browsers from the global list. The browser object should | 26 // Adds and removes browsers from the global list. The browser object should |
28 // be valid BEFORE these calls (for the benefit of observers), so notify and | 27 // be valid BEFORE these calls (for the benefit of observers), so notify and |
29 // THEN delete the object. | 28 // THEN delete the object. |
30 static void AddBrowser(Browser* browser); | 29 static void AddBrowser(Browser* browser); |
31 static void RemoveBrowser(Browser* browser); | 30 static void RemoveBrowser(Browser* browser); |
32 | 31 |
33 static void AddObserver(chrome::BrowserListObserver* observer); | 32 static void AddObserver(chrome::BrowserListObserver* observer); |
(...skipping 22 matching lines...) Expand all Loading... |
56 static const_reverse_iterator end_last_active(); | 55 static const_reverse_iterator end_last_active(); |
57 | 56 |
58 // Returns true if at least one incognito session is active. | 57 // Returns true if at least one incognito session is active. |
59 static bool IsOffTheRecordSessionActive(); | 58 static bool IsOffTheRecordSessionActive(); |
60 | 59 |
61 // Returns true if at least one incognito session is active for |profile|. | 60 // Returns true if at least one incognito session is active for |profile|. |
62 static bool IsOffTheRecordSessionActiveForProfile(Profile* profile); | 61 static bool IsOffTheRecordSessionActiveForProfile(Profile* profile); |
63 }; | 62 }; |
64 | 63 |
65 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ | 64 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ |
OLD | NEW |