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

Unified Diff: ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm

Issue 2712743008: Remove -insertTabWithWebState:atIndex: from TabModel. (Closed)
Patch Set: Rebase. Created 3 years, 10 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
« no previous file with comments | « ios/chrome/browser/sessions/DEPS ('k') | ios/chrome/browser/tabs/tab.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm
diff --git a/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm b/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm
index ce782676dc0a5ff79865caa7c11e76cd7efb174b..dcbc5d2227875772a3275bc3c6f67e15271c50a1 100644
--- a/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm
+++ b/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm
@@ -15,13 +15,9 @@
#import "ios/chrome/browser/tabs/tab.h"
#import "ios/chrome/browser/tabs/tab_model.h"
#import "ios/chrome/browser/tabs/tab_model_list.h"
-#import "ios/web/navigation/navigation_manager_impl.h"
#include "ios/web/public/navigation_item.h"
-#import "ios/web/web_state/web_state_impl.h"
#import "net/base/mac/url_conversions.h"
-using web::WebStateImpl;
-
TabRestoreServiceDelegateImplIOS::TabRestoreServiceDelegateImplIOS(
ios::ChromeBrowserState* browser_state)
: browser_state_(browser_state) {}
@@ -78,17 +74,13 @@ sessions::LiveTab* TabRestoreServiceDelegateImplIOS::AddRestoredTab(
const sessions::PlatformSpecificTabData* tab_platform_data,
const std::string& user_agent_override) {
DCHECK_LT(selected_navigation, static_cast<int>(navigations.size()));
-
- std::unique_ptr<WebStateImpl> webState(new WebStateImpl(browser_state_));
- std::vector<std::unique_ptr<web::NavigationItem>> items =
+ DCHECK_GE(tab_index, 0);
+ web::ScopedNavigationItemList items =
sessions::IOSSerializedNavigationBuilder::ToNavigationItems(navigations);
- webState->GetNavigationManagerImpl().ReplaceSessionHistory(
- std::move(items), selected_navigation);
- TabModel* tabModel = tab_model();
- Tab* tab =
- [tabModel insertTabWithWebState:std::move(webState) atIndex:tab_index];
- // TODO(crbug.com/661636): Handle tab-switch animation somehow...
- [tabModel setCurrentTab:tab];
+ [tab_model() insertTabWithNavigationItems:std::move(items)
+ selectedNavigationIndex:selected_navigation
+ atIndex:static_cast<NSUInteger>(tab_index)
+ inBackground:NO];
return nullptr;
}
« no previous file with comments | « ios/chrome/browser/sessions/DEPS ('k') | ios/chrome/browser/tabs/tab.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698