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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 browser_state_ = browser_state; | 90 browser_state_ = browser_state; |
91 [session_controller_ setBrowserState:browser_state]; | 91 [session_controller_ setBrowserState:browser_state]; |
92 } | 92 } |
93 | 93 |
94 void NavigationManagerImpl::SetSessionController( | 94 void NavigationManagerImpl::SetSessionController( |
95 CRWSessionController* session_controller) { | 95 CRWSessionController* session_controller) { |
96 session_controller_.reset(session_controller); | 96 session_controller_.reset(session_controller); |
97 [session_controller_ setNavigationManager:this]; | 97 [session_controller_ setNavigationManager:this]; |
98 } | 98 } |
99 | 99 |
100 void NavigationManagerImpl::InitializeSession(BOOL opened_by_dom) { | 100 void NavigationManagerImpl::InitializeSession() { |
101 SetSessionController([[CRWSessionController alloc] | 101 SetSessionController( |
102 initWithBrowserState:browser_state_ | 102 [[CRWSessionController alloc] initWithBrowserState:browser_state_]); |
103 openedByDOM:opened_by_dom]); | |
104 } | 103 } |
105 | 104 |
106 void NavigationManagerImpl::ReplaceSessionHistory( | 105 void NavigationManagerImpl::ReplaceSessionHistory( |
107 std::vector<std::unique_ptr<web::NavigationItem>> items, | 106 std::vector<std::unique_ptr<web::NavigationItem>> items, |
108 int current_index) { | 107 int current_index) { |
109 SetSessionController([[CRWSessionController alloc] | 108 SetSessionController([[CRWSessionController alloc] |
110 initWithBrowserState:browser_state_ | 109 initWithBrowserState:browser_state_ |
111 navigationItems:std::move(items) | 110 navigationItems:std::move(items) |
112 currentIndex:current_index]); | 111 currentIndex:current_index]); |
113 } | 112 } |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 const ScopedNavigationItemImplList& items = [session_controller_ items]; | 453 const ScopedNavigationItemImplList& items = [session_controller_ items]; |
455 while (index >= 0) { | 454 while (index >= 0) { |
456 NavigationItem* item = items[index--].get(); | 455 NavigationItem* item = items[index--].get(); |
457 if (!client->IsAppSpecificURL(item->GetVirtualURL())) | 456 if (!client->IsAppSpecificURL(item->GetVirtualURL())) |
458 return item; | 457 return item; |
459 } | 458 } |
460 return nullptr; | 459 return nullptr; |
461 } | 460 } |
462 | 461 |
463 } // namespace web | 462 } // namespace web |
OLD | NEW |