| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" | 5 #include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 int selected_navigation, | 76 int selected_navigation, |
| 77 const std::string& extension_app_id, | 77 const std::string& extension_app_id, |
| 78 bool select, | 78 bool select, |
| 79 bool pin, | 79 bool pin, |
| 80 bool from_last_session, | 80 bool from_last_session, |
| 81 const sessions::PlatformSpecificTabData* tab_platform_data, | 81 const sessions::PlatformSpecificTabData* tab_platform_data, |
| 82 const std::string& user_agent_override) { | 82 const std::string& user_agent_override) { |
| 83 DCHECK_LT(selected_navigation, static_cast<int>(navigations.size())); | 83 DCHECK_LT(selected_navigation, static_cast<int>(navigations.size())); |
| 84 | 84 |
| 85 std::unique_ptr<WebStateImpl> webState(new WebStateImpl(browser_state_)); | 85 std::unique_ptr<WebStateImpl> webState(new WebStateImpl(browser_state_)); |
| 86 ScopedVector<web::NavigationItem> items = | 86 std::vector<std::unique_ptr<web::NavigationItem>> items = |
| 87 sessions::IOSSerializedNavigationBuilder::ToNavigationItems(navigations); | 87 sessions::IOSSerializedNavigationBuilder::ToNavigationItems(navigations); |
| 88 webState->GetNavigationManagerImpl().ReplaceSessionHistory( | 88 webState->GetNavigationManagerImpl().ReplaceSessionHistory( |
| 89 std::move(items), selected_navigation); | 89 std::move(items), selected_navigation); |
| 90 TabModel* tabModel = tab_model(); | 90 TabModel* tabModel = tab_model(); |
| 91 Tab* tab = | 91 Tab* tab = |
| 92 [tabModel insertTabWithWebState:std::move(webState) atIndex:tab_index]; | 92 [tabModel insertTabWithWebState:std::move(webState) atIndex:tab_index]; |
| 93 // TODO(crbug.com/661636): Handle tab-switch animation somehow... | 93 // TODO(crbug.com/661636): Handle tab-switch animation somehow... |
| 94 [tabModel setCurrentTab:tab]; | 94 [tabModel setCurrentTab:tab]; |
| 95 return nullptr; | 95 return nullptr; |
| 96 } | 96 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 110 // to reload. | 110 // to reload. |
| 111 Tab* tab = tab_model().currentTab; | 111 Tab* tab = tab_model().currentTab; |
| 112 [tab replaceHistoryWithNavigations:navigations | 112 [tab replaceHistoryWithNavigations:navigations |
| 113 currentIndex:selected_navigation]; | 113 currentIndex:selected_navigation]; |
| 114 return nullptr; | 114 return nullptr; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void TabRestoreServiceDelegateImplIOS::CloseTab() { | 117 void TabRestoreServiceDelegateImplIOS::CloseTab() { |
| 118 [[tab_model() currentTab] close]; | 118 [[tab_model() currentTab] close]; |
| 119 } | 119 } |
| OLD | NEW |