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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_opener.mm

Issue 2766413004: [ios] Change API to inform WebStateList of opener-opened relationship. (Closed)
Patch Set: Rebase on origin/master. 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_opener.mm
diff --git a/ios/shared/chrome/browser/tabs/web_state_opener.mm b/ios/shared/chrome/browser/tabs/web_state_opener.mm
new file mode 100644
index 0000000000000000000000000000000000000000..c4652af864db69e3644d7de56f6eee49507b95db
--- /dev/null
+++ b/ios/shared/chrome/browser/tabs/web_state_opener.mm
@@ -0,0 +1,20 @@
+// 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.
+
+#import "ios/shared/chrome/browser/tabs/web_state_opener.h"
+
+#import "ios/web/public/navigation_manager.h"
+#import "ios/web/public/web_state/web_state.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+WebStateOpener::WebStateOpener(web::WebState* opener, int navigation_index)
+ : opener(opener), navigation_index(navigation_index) {
+ if (opener && navigation_index < 0) {
+ this->navigation_index =
+ opener->GetNavigationManager()->GetLastCommittedItemIndex();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698