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/tabs/web_state_list_order_controller.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
Index: ios/shared/chrome/browser/tabs/web_state_list_order_controller.h
diff --git a/ios/shared/chrome/browser/tabs/web_state_list_order_controller.h b/ios/shared/chrome/browser/tabs/web_state_list_order_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4dcd94d7afa28e706346289bbbd0c7c2d44adbc
--- /dev/null
+++ b/ios/shared/chrome/browser/tabs/web_state_list_order_controller.h
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_ORDER_CONTROLLER_H_
+#define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_ORDER_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "ui/base/page_transition_types.h"
+
+class WebStateList;
+
+namespace web {
+class WebState;
+}
+
+// WebStateListOrderController allows different types of ordering and
+// selection heuristics to be plugged into WebStateList.
+class WebStateListOrderController {
+ public:
+ explicit WebStateListOrderController(WebStateList* web_state_list);
+ ~WebStateListOrderController();
+
+ // Determines where to place a newly opened WebState by using the supplied
+ // transition, opener and background flag.
+ int DetermineInsertionIndex(ui::PageTransition transition,
+ web::WebState* opener) const;
+
+ private:
+ WebStateList* web_state_list_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebStateListOrderController);
+};
+
+#endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_ORDER_CONTROLLER_H_
« no previous file with comments | « ios/shared/chrome/browser/tabs/web_state_list.mm ('k') | ios/shared/chrome/browser/tabs/web_state_list_order_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698