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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list.h

Issue 2748793002: [ios] Add a delegate to WebStateList class. (Closed)
Patch Set: Browser owns the BrowserWebStateListDelegate. 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 side-by-side diff with in-line comments
Download patch
Index: ios/shared/chrome/browser/tabs/web_state_list.h
diff --git a/ios/shared/chrome/browser/tabs/web_state_list.h b/ios/shared/chrome/browser/tabs/web_state_list.h
index ba3e9b8bf0bcdf696e0ff48bd3cac1701a59152f..e7654555150a81d15279ba914e6833ee990a932f 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list.h
+++ b/ios/shared/chrome/browser/tabs/web_state_list.h
@@ -13,6 +13,7 @@
#include "base/observer_list.h"
#include "ui/base/page_transition_types.h"
+class WebStateListDelegate;
class WebStateListObserver;
class WebStateListOrderController;
@@ -30,7 +31,7 @@ class WebStateList {
WebStateOwned,
};
- explicit WebStateList(WebStateOwnership ownership = WebStateBorrowed);
+ WebStateList(WebStateListDelegate* delegate, WebStateOwnership ownership);
~WebStateList();
// Returns whether the model is empty or not.
@@ -121,6 +122,8 @@ class WebStateList {
static const int kInvalidIndex = -1;
private:
+ class WebStateWrapper;
+
// Sets the opener of any WebState that reference the WebState at the
// specified index to null.
void ClearOpenersReferencing(int index);
@@ -139,8 +142,14 @@ class WebStateList {
bool use_group,
int n) const;
- class WebStateWrapper;
+ // The WebStateList delegate.
+ WebStateListDelegate* delegate_;
+
+ // Whether this WebStateList owns the WebState it hosts.
+ // TODO(crbug.com/546222): remove once this is always "owned".
const WebStateOwnership web_state_ownership_;
+
+ // Wrappers to the WebStates hosted by the WebStateList.
std::vector<std::unique_ptr<WebStateWrapper>> web_state_wrappers_;
// An object that determines where new WebState should be inserted and where

Powered by Google App Engine
This is Rietveld 408576698