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

Side by Side Diff: ios/clean/chrome/browser/model/browser_list.h

Issue 2727353006: Introduce BrowserList and Browser classes for iOS. (Closed)
Patch Set: Add blank line. Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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_CLEAN_CHROME_BROWSER_MODEL_BROWSER_LIST_H_
6 #define IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_LIST_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/supports_user_data.h"
12 #include "ios/clean/chrome/browser/model/browser.h"
13
14 namespace ios {
15 class ChromeBrowserState;
16 }
17
18 // BrowserList attaches Browsers instance to a ChromeBrowserState.
19 class BrowserList : public base::SupportsUserData::Data {
20 public:
21 explicit BrowserList(ios::ChromeBrowserState* browser_state);
22 ~BrowserList() override;
23
24 static BrowserList* FromBrowserState(ios::ChromeBrowserState* browser_state);
25
26 // Returns the number of open Browsers.
27 int GetBrowserCount() const;
28
29 // Returns whether the specified index is valid.
30 int ContainsIndex(int index) const;
31
32 // Returns the Browser at the specified index.
33 Browser* GetBrowserAtIndex(int index) const;
34
35 // Creates and returns a new Browser instance.
36 Browser* CreateNewBrowser();
37
38 // Closes the Browser at the specified index.
39 void CloseBrowserAtIndex(int index);
40
41 private:
42 std::vector<std::unique_ptr<Browser>> browsers_;
43 ios::ChromeBrowserState* browser_state_;
44
45 DISALLOW_COPY_AND_ASSIGN(BrowserList);
46 };
47
48 #endif // IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_LIST_H_
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/model/browser.mm ('k') | ios/clean/chrome/browser/model/browser_list.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698