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

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

Issue 2687353003: Created SerializableUserDataManager. (Closed)
Patch Set: self review, added unittest 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
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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 forBrowserState:[_tabModel browserState]]; 289 forBrowserState:[_tabModel browserState]];
290 DCHECK(window); 290 DCHECK(window);
291 NSArray* sessions = window.sessions; 291 NSArray* sessions = window.sessions;
292 if (!sessions.count) 292 if (!sessions.count)
293 return; 293 return;
294 sessions::TabRestoreService* const tabRestoreService = 294 sessions::TabRestoreService* const tabRestoreService =
295 IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState); 295 IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState);
296 tabRestoreService->LoadTabsFromLastSession(); 296 tabRestoreService->LoadTabsFromLastSession();
297 297
298 web::WebState::CreateParams params(_browserState); 298 web::WebState::CreateParams params(_browserState);
299 for (CRWNavigationManagerStorage* session in sessions) { 299 for (CRWSessionStorage* session in sessions) {
300 std::unique_ptr<web::WebState> webState = 300 std::unique_ptr<web::WebState> webState =
301 web::WebState::Create(params, session); 301 web::WebState::Create(params, session);
302 // 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
303 // tabModel. 303 // tabModel.
304 tabRestoreService->CreateHistoricalTab( 304 tabRestoreService->CreateHistoricalTab(
305 sessions::IOSLiveTab::GetForWebState(webState.get()), 0); 305 sessions::IOSLiveTab::GetForWebState(webState.get()), 0);
306 } 306 }
307 return; 307 return;
308 } 308 }
309 309
310 @end 310 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/sessions/session_service.mm » ('j') | ios/chrome/browser/sessions/session_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698