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

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

Issue 1360993002: Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compilation fix after 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 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 if (!window.unclaimedSessions) 291 NSArray* sessions = window.sessions;
292 if (!sessions.count)
292 return; 293 return;
293 sessions::TabRestoreService* const tabRestoreService = 294 sessions::TabRestoreService* const tabRestoreService =
294 IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState); 295 IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState);
295 tabRestoreService->LoadTabsFromLastSession(); 296 tabRestoreService->LoadTabsFromLastSession();
296 297
297 while (window.unclaimedSessions) { 298 web::WebState::CreateParams params(_browserState);
299 for (CRWNavigationManagerStorage* session in sessions) {
300 std::unique_ptr<web::WebState> webState =
301 web::WebState::Create(params, session);
298 // Add all tabs at the 0 position as the position is relative to an old 302 // Add all tabs at the 0 position as the position is relative to an old
299 // tabModel. 303 // tabModel.
300 std::unique_ptr<web::WebStateImpl> webState = [window nextSession];
301 tabRestoreService->CreateHistoricalTab( 304 tabRestoreService->CreateHistoricalTab(
302 sessions::IOSLiveTab::GetForWebState(webState.get()), 0); 305 sessions::IOSLiveTab::GetForWebState(webState.get()), 0);
303 } 306 }
304 return; 307 return;
305 } 308 }
306 309
307 @end 310 @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