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

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

Issue 2766413004: [ios] Change API to inform WebStateList of opener-opened relationship. (Closed)
Patch Set: Address comments. 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
« 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 e7654555150a81d15279ba914e6833ee990a932f..e7f9fe7bb7f47b016a1484e8e46450c492c6576c 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list.h
+++ b/ios/shared/chrome/browser/tabs/web_state_list.h
@@ -16,6 +16,7 @@
class WebStateListDelegate;
class WebStateListObserver;
class WebStateListOrderController;
+struct WebStateOpener;
namespace web {
class WebState;
@@ -58,13 +59,14 @@ class WebStateList {
// WebState is not in the model.
int GetIndexOfWebState(const web::WebState* web_state) const;
- // Returns the WebState that opened the WebState at the specified index or
- // null if there is no opener on record.
- web::WebState* GetOpenerOfWebStateAt(int index) const;
+ // Returns information about the opener of the WebState at the specified
+ // index. The structure |opener| will be null if there is no opener.
+ WebStateOpener GetOpenerOfWebStateAt(int index) const;
- // Sets the opener for WebState at the specified index. The |opener| must be
- // in the WebStateList.
- void SetOpenerOfWebStateAt(int index, web::WebState* opener);
+ // Stores information about the opener of the WebState at the specified
+ // index. The WebStateOpener |opener| must be non-null and the WebState
+ // must be in WebStateList.
+ void SetOpenerOfWebStateAt(int index, WebStateOpener opener);
// Returns the index of the next WebState in the sequence of WebStates opened
// from the specified WebState after |start_index|, or kInvalidIndex if there
@@ -82,28 +84,24 @@ class WebStateList {
int start_index,
bool use_group) const;
- // Inserts the specified WebState at the specified index with an optional
- // opener (null if there is no opener).
- void InsertWebState(int index,
- web::WebState* web_state,
- web::WebState* opener);
+ // Inserts the specified WebState at the specified index.
+ void InsertWebState(int index, web::WebState* web_state);
// 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.
+ // given the specified transition, opener, 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);
+ WebStateOpener opener);
// Moves the WebState at the specified index to another index.
void MoveWebStateAt(int from_index, int to_index);
// Replaces the WebState at the specified index with new WebState. Returns
// the old WebState at that index to the caller (abandon ownership of the
- // returned WebState). An optional opener for the new WebState may be passed.
+ // returned WebState).
web::WebState* ReplaceWebStateAt(int index,
- web::WebState* web_state,
- web::WebState* opener) WARN_UNUSED_RESULT;
+ web::WebState* web_state) WARN_UNUSED_RESULT;
// Detaches the WebState at the specified index. Returns the detached WebState
// to the caller (abandon ownership of the returned WebState).
« 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