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

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

Issue 2699833004: Add WebStateListOrderController to control WebState insertion. (Closed)
Patch Set: Address comments. Created 3 years, 10 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 | « ios/shared/chrome/browser/tabs/BUILD.gn ('k') | ios/shared/chrome/browser/tabs/web_state_list.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 854e12778e13d81eae545f938a14caad565b165c..6cf8472bdbbb309f29bddb874ddb1fa52133561d 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list.h
+++ b/ios/shared/chrome/browser/tabs/web_state_list.h
@@ -10,8 +10,10 @@
#include "base/macros.h"
#include "base/observer_list.h"
+#include "ui/base/page_transition_types.h"
class WebStateListObserver;
+class WebStateListOrderController;
namespace web {
class WebState;
@@ -77,6 +79,13 @@ class WebStateList {
web::WebState* web_state,
web::WebState* opener);
+ // Inserts the specified WebState at the best position in the WebStateList
+ // given the specified transition, opener (optional, may be null), etc. It
+ // defaults to inserting the WebState at the end of the list.
+ void AppendWebState(ui::PageTransition transition,
+ web::WebState* web_state,
+ web::WebState* opener);
+
// Moves the WebState at the specified index to another index.
void MoveWebStateAt(int from_index, int to_index);
@@ -118,6 +127,10 @@ class WebStateList {
const WebStateOwnership web_state_ownership_;
std::vector<std::unique_ptr<WebStateWrapper>> web_state_wrappers_;
+ // An object that determines where new WebState should be inserted and where
+ // selection should move when a WebState is detached.
+ std::unique_ptr<WebStateListOrderController> order_controller_;
+
// List of observers notified of changes to the model.
base::ObserverList<WebStateListObserver, true> observers_;
« no previous file with comments | « ios/shared/chrome/browser/tabs/BUILD.gn ('k') | ios/shared/chrome/browser/tabs/web_state_list.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698