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

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

Issue 2699833004: Add WebStateListOrderController to control WebState insertion. (Closed)
Patch Set: 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
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 6d537a7624b44c9adf5e054d708de0a8c61b4100..3190fa19893ae0b6e04373a11c931194ba154d82 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;
@@ -73,6 +75,15 @@ class WebStateList {
web::WebState* web_state,
web::WebState* opener);
+ // Adds a WebState at the best position in the WebStateList given the
+ // specified insertion index, transition, etc. An optional opener for the new
+ // WebState may be passed. Pass kInvalidIndex for |index| to append it to the
marq (ping after 24h) 2017/02/17 13:33:00 I would have a mild preference for a separate Appe
sdefresne 2017/02/20 16:12:55 Done.
+ // WebStateList.
+ void AddWebState(int index,
+ 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);
@@ -117,6 +128,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_;

Powered by Google App Engine
This is Rietveld 408576698