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

Side by Side Diff: ios/chrome/browser/crash_report/crash_restore_helper.mm

Issue 2655253002: Revert of Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/sessions/session_service.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "ios/chrome/browser/crash_report/crash_restore_helper.h" 5 #import "ios/chrome/browser/crash_report/crash_restore_helper.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 // If the infobar is dismissed without restoring the tabs (either by closing 282 // If the infobar is dismissed without restoring the tabs (either by closing
283 // it with the cross or after a navigation), all the entries will be added to 283 // it with the cross or after a navigation), all the entries will be added to
284 // the recently closed tabs. 284 // the recently closed tabs.
285 _sessionRestored = YES; 285 _sessionRestored = YES;
286 286
287 SessionWindowIOS* window = [[SessionServiceIOS sharedService] 287 SessionWindowIOS* window = [[SessionServiceIOS sharedService]
288 loadWindowFromPath:[self sessionBackupPath] 288 loadWindowFromPath:[self sessionBackupPath]
289 forBrowserState:[_tabModel browserState]]; 289 forBrowserState:[_tabModel browserState]];
290 DCHECK(window); 290 DCHECK(window);
291 NSArray* sessions = window.sessions; 291 if (!window.unclaimedSessions)
292 if (!sessions.count)
293 return; 292 return;
294 sessions::TabRestoreService* const tabRestoreService = 293 sessions::TabRestoreService* const tabRestoreService =
295 IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState); 294 IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState);
296 tabRestoreService->LoadTabsFromLastSession(); 295 tabRestoreService->LoadTabsFromLastSession();
297 296
298 web::WebState::CreateParams params(_browserState); 297 while (window.unclaimedSessions) {
299 for (CRWNavigationManagerStorage* session in sessions) {
300 std::unique_ptr<web::WebState> webState =
301 web::WebState::Create(params, session);
302 // Add all tabs at the 0 position as the position is relative to an old 298 // Add all tabs at the 0 position as the position is relative to an old
303 // tabModel. 299 // tabModel.
300 std::unique_ptr<web::WebStateImpl> webState = [window nextSession];
304 tabRestoreService->CreateHistoricalTab( 301 tabRestoreService->CreateHistoricalTab(
305 sessions::IOSLiveTab::GetForWebState(webState.get()), 0); 302 sessions::IOSLiveTab::GetForWebState(webState.get()), 0);
306 } 303 }
307 return; 304 return;
308 } 305 }
309 306
310 @end 307 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/sessions/session_service.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698