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

Side by Side Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2720613005: Refactor serialisation of openerId & openerNavigationIndex. (Closed)
Patch Set: Fix CRWSessionController's initializer comment. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 [session_controller_ setBrowserState:browser_state]; 88 [session_controller_ setBrowserState:browser_state];
89 } 89 }
90 90
91 void NavigationManagerImpl::SetSessionController( 91 void NavigationManagerImpl::SetSessionController(
92 CRWSessionController* session_controller) { 92 CRWSessionController* session_controller) {
93 session_controller_.reset(session_controller); 93 session_controller_.reset(session_controller);
94 [session_controller_ setNavigationManager:this]; 94 [session_controller_ setNavigationManager:this];
95 } 95 }
96 96
97 void NavigationManagerImpl::InitializeSession(NSString* window_name, 97 void NavigationManagerImpl::InitializeSession(NSString* window_name,
98 NSString* opener_id, 98 BOOL opened_by_dom) {
99 BOOL opened_by_dom,
100 int opener_navigation_index) {
101 SetSessionController([[CRWSessionController alloc] 99 SetSessionController([[CRWSessionController alloc]
102 initWithWindowName:window_name 100 initWithWindowName:window_name
103 openerId:opener_id
104 openedByDOM:opened_by_dom 101 openedByDOM:opened_by_dom
105 openerNavigationIndex:opener_navigation_index
106 browserState:browser_state_]); 102 browserState:browser_state_]);
107 } 103 }
108 104
109 void NavigationManagerImpl::ReplaceSessionHistory( 105 void NavigationManagerImpl::ReplaceSessionHistory(
110 std::vector<std::unique_ptr<web::NavigationItem>> items, 106 std::vector<std::unique_ptr<web::NavigationItem>> items,
111 int current_index) { 107 int current_index) {
112 SetSessionController([[CRWSessionController alloc] 108 SetSessionController([[CRWSessionController alloc]
113 initWithNavigationItems:std::move(items) 109 initWithNavigationItems:std::move(items)
114 currentIndex:current_index 110 currentIndex:current_index
115 browserState:browser_state_]); 111 browserState:browser_state_]);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 411 }
416 412
417 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { 413 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const {
418 DCHECK_GT(index, 0); 414 DCHECK_GT(index, 0);
419 DCHECK_LT(index, GetItemCount()); 415 DCHECK_LT(index, GetItemCount());
420 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); 416 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType();
421 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; 417 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK;
422 } 418 }
423 419
424 } // namespace web 420 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.h ('k') | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698