| 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 #import "ios/chrome/browser/tabs/tab_model.h" | 5 #import "ios/chrome/browser/tabs/tab_model.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 DCHECK(window); | 701 DCHECK(window); |
| 702 | 702 |
| 703 if (!window.sessions.count) | 703 if (!window.sessions.count) |
| 704 return NO; | 704 return NO; |
| 705 | 705 |
| 706 int oldCount = _webStateList->count(); | 706 int oldCount = _webStateList->count(); |
| 707 DCHECK_GE(oldCount, 0); | 707 DCHECK_GE(oldCount, 0); |
| 708 | 708 |
| 709 web::WebState::CreateParams createParams(_browserState); | 709 web::WebState::CreateParams createParams(_browserState); |
| 710 DeserializeWebStateList( | 710 DeserializeWebStateList( |
| 711 _webStateList.get(), window, | 711 _webStateList.get(), window, webUsageEnabled_, |
| 712 base::BindRepeating(&web::WebState::CreateWithStorageSession, | 712 base::BindRepeating(&web::WebState::CreateWithStorageSession, |
| 713 createParams)); | 713 createParams)); |
| 714 | 714 |
| 715 DCHECK_GT(_webStateList->count(), oldCount); | 715 DCHECK_GT(_webStateList->count(), oldCount); |
| 716 int restoredCount = _webStateList->count() - oldCount; | 716 int restoredCount = _webStateList->count() - oldCount; |
| 717 DCHECK_EQ(window.sessions.count, static_cast<NSUInteger>(restoredCount)); | 717 DCHECK_EQ(window.sessions.count, static_cast<NSUInteger>(restoredCount)); |
| 718 | 718 |
| 719 scoped_refptr<web::CertificatePolicyCache> policyCache = | 719 scoped_refptr<web::CertificatePolicyCache> policyCache = |
| 720 web::BrowserState::GetCertificatePolicyCache(_browserState); | 720 web::BrowserState::GetCertificatePolicyCache(_browserState); |
| 721 | 721 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 } | 788 } |
| 789 | 789 |
| 790 // Called when UIApplicationWillEnterForegroundNotification is received. | 790 // Called when UIApplicationWillEnterForegroundNotification is received. |
| 791 - (void)applicationWillEnterForeground:(NSNotification*)notify { | 791 - (void)applicationWillEnterForeground:(NSNotification*)notify { |
| 792 if (_tabUsageRecorder) { | 792 if (_tabUsageRecorder) { |
| 793 _tabUsageRecorder->AppWillEnterForeground(); | 793 _tabUsageRecorder->AppWillEnterForeground(); |
| 794 } | 794 } |
| 795 } | 795 } |
| 796 | 796 |
| 797 @end | 797 @end |
| OLD | NEW |