| OLD | NEW |
| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 browser_state_ = browser_state; | 87 browser_state_ = browser_state; |
| 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(BOOL opened_by_dom) { |
| 98 BOOL opened_by_dom) { | |
| 99 SetSessionController([[CRWSessionController alloc] | 98 SetSessionController([[CRWSessionController alloc] |
| 100 initWithWindowName:window_name | 99 initWithBrowserState:browser_state_ |
| 101 openedByDOM:opened_by_dom | 100 openedByDOM:opened_by_dom]); |
| 102 browserState:browser_state_]); | |
| 103 } | 101 } |
| 104 | 102 |
| 105 void NavigationManagerImpl::ReplaceSessionHistory( | 103 void NavigationManagerImpl::ReplaceSessionHistory( |
| 106 std::vector<std::unique_ptr<web::NavigationItem>> items, | 104 std::vector<std::unique_ptr<web::NavigationItem>> items, |
| 107 int current_index) { | 105 int current_index) { |
| 108 SetSessionController([[CRWSessionController alloc] | 106 SetSessionController([[CRWSessionController alloc] |
| 109 initWithNavigationItems:std::move(items) | 107 initWithBrowserState:browser_state_ |
| 110 currentIndex:current_index | 108 navigationItems:std::move(items) |
| 111 browserState:browser_state_]); | 109 currentIndex:current_index]); |
| 112 } | 110 } |
| 113 | 111 |
| 114 void NavigationManagerImpl::SetFacadeDelegate( | 112 void NavigationManagerImpl::SetFacadeDelegate( |
| 115 NavigationManagerFacadeDelegate* facade_delegate) { | 113 NavigationManagerFacadeDelegate* facade_delegate) { |
| 116 facade_delegate_ = facade_delegate; | 114 facade_delegate_ = facade_delegate; |
| 117 } | 115 } |
| 118 | 116 |
| 119 NavigationManagerFacadeDelegate* NavigationManagerImpl::GetFacadeDelegate() | 117 NavigationManagerFacadeDelegate* NavigationManagerImpl::GetFacadeDelegate() |
| 120 const { | 118 const { |
| 121 return facade_delegate_; | 119 return facade_delegate_; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 409 } |
| 412 | 410 |
| 413 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { | 411 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { |
| 414 DCHECK_GT(index, 0); | 412 DCHECK_GT(index, 0); |
| 415 DCHECK_LT(index, GetItemCount()); | 413 DCHECK_LT(index, GetItemCount()); |
| 416 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); | 414 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); |
| 417 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; | 415 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; |
| 418 } | 416 } |
| 419 | 417 |
| 420 } // namespace web | 418 } // namespace web |
| OLD | NEW |