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

Side by Side Diff: ios/chrome/browser/ui/browser_list_ios.h

Issue 2615003002: Use ChromeBrowserStateManager instead of BrowserListIOS. (Closed)
Patch Set: Fix ios_chrome_perftests. Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/browser_ios.h ('k') | ios/chrome/browser/ui/browser_list_ios.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_CHROME_BROWSER_UI_BROWSER_LIST_IOS_H_
6 #define IOS_CHROME_BROWSER_UI_BROWSER_LIST_IOS_H_
7
8 #include <vector>
9
10 #import "ios/chrome/browser/ui/browser_ios.h"
11
12 namespace ios {
13 class ChromeBrowserState;
14 }
15
16 // Modeled after chrome/browser/ui/browser_list.
17
18 class BrowserListIOS {
19 public:
20 typedef std::vector<id<BrowserIOS>> BrowserVector;
21 typedef BrowserVector::iterator iterator;
22 typedef BrowserVector::const_iterator const_iterator;
23
24 // Note: browsers are not retained, just like desktop browser lists, their
25 // management is outside the list.
26 static void AddBrowser(id<BrowserIOS> browser);
27 static void RemoveBrowser(id<BrowserIOS> browser);
28
29 static id<BrowserIOS> GetLastActiveWithBrowserState(
30 ios::ChromeBrowserState* browser_state);
31
32 static const_iterator begin();
33 static const_iterator end();
34
35 static bool empty() { return !browsers_ || browsers_->empty(); }
36 static size_t size() { return browsers_ ? browsers_->size() : 0; }
37
38 // Returns true if at least one incognito session is active.
39 static bool IsOffTheRecordSessionActive();
40
41 private:
42 static BrowserVector* browsers_;
43
44 static void EnsureBrowsersIsValid();
45 };
46
47 #endif // IOS_CHROME_BROWSER_UI_BROWSER_LIST_IOS_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/browser_ios.h ('k') | ios/chrome/browser/ui/browser_list_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698