| Index: ios/shared/chrome/browser/ui/browser_list/browser_list.h
|
| diff --git a/ios/shared/chrome/browser/ui/browser_list/browser_list.h b/ios/shared/chrome/browser/ui/browser_list/browser_list.h
|
| index 6f4446d93134276b5307c4ac13e53cd73ad5e798..8cb960aeee4c7bb7d8b23eca7862c18292fc43b8 100644
|
| --- a/ios/shared/chrome/browser/ui/browser_list/browser_list.h
|
| +++ b/ios/shared/chrome/browser/ui/browser_list/browser_list.h
|
| @@ -24,8 +24,8 @@ class BrowserList : public base::SupportsUserData::Data {
|
|
|
| static BrowserList* FromBrowserState(ios::ChromeBrowserState* browser_state);
|
|
|
| - // Returns the number of open Browsers.
|
| - int GetBrowserCount() const;
|
| + // Returns the number of Browsers in the BrowserList.
|
| + int count() const { return static_cast<int>(browsers_.size()); }
|
|
|
| // Returns whether the specified index is valid.
|
| int ContainsIndex(int index) const;
|
| @@ -33,12 +33,18 @@ class BrowserList : public base::SupportsUserData::Data {
|
| // Returns the Browser at the specified index.
|
| Browser* GetBrowserAtIndex(int index) const;
|
|
|
| + // Returns the index of the specified Browser, or kInvalidIndex if not found.
|
| + int GetIndexOfBrowser(const Browser* browser) const;
|
| +
|
| // Creates and returns a new Browser instance.
|
| Browser* CreateNewBrowser();
|
|
|
| // Closes the Browser at the specified index.
|
| void CloseBrowserAtIndex(int index);
|
|
|
| + // Invalid index.
|
| + static const int kInvalidIndex = -1;
|
| +
|
| private:
|
| ios::ChromeBrowserState* browser_state_;
|
| std::vector<std::unique_ptr<Browser>> browsers_;
|
|
|