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

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

Issue 2798863004: [ios] Extend BrowserList API. (Closed)
Patch Set: Revert name change of GetBrowserAtIndex(). Created 3 years, 8 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
« no previous file with comments | « no previous file | ios/shared/chrome/browser/ui/browser_list/browser_list.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | ios/shared/chrome/browser/ui/browser_list/browser_list.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698