@@ -590,15 +590,15 @@ - (CWVWebViewConfiguration*)nonPersistentWebViewConfiguration {
590
590
// The incognito BrowserState should be closed when the last incognito tab is
591
591
// closed (i.e. if there are other incognito tabs open in another Scene, the
592
592
// BrowserState must not be destroyed).
593
- - (BOOL )shouldDestroyAndRebuildIncognitoBrowserState {
594
- return _main_profile->HasOffTheRecordChromeBrowserState ();
593
+ - (BOOL )shouldDestroyAndRebuildIncognitoProfile {
594
+ return _main_profile->HasOffTheRecordProfile ();
595
595
}
596
596
597
597
// Matches lastIncognitoTabClosed from Chrome's SceneController
598
598
- (void )notifyLastPrivateTabClosed {
599
599
// If no other window has incognito tab, then destroy and rebuild the
600
600
// BrowserState. Otherwise, just do the state transition animation.
601
- if ([self shouldDestroyAndRebuildIncognitoBrowserState ]) {
601
+ if ([self shouldDestroyAndRebuildIncognitoProfile ]) {
602
602
// Incognito browser state cannot be deleted before all the requests are
603
603
// deleted. Queue empty task on IO thread and destroy the BrowserState
604
604
// when the task has executed, again verifying that no incognito tabs are
@@ -608,8 +608,8 @@ - (void)notifyLastPrivateTabClosed {
608
608
// the cleanup shouldn't proceed.
609
609
610
610
auto cleanup = ^{
611
- if ([self shouldDestroyAndRebuildIncognitoBrowserState ]) {
612
- [self destroyAndRebuildIncognitoBrowserState ];
611
+ if ([self shouldDestroyAndRebuildIncognitoProfile ]) {
612
+ [self destroyAndRebuildIncognitoProfile ];
613
613
}
614
614
};
615
615
@@ -639,8 +639,8 @@ - (void)cleanupBrowser:(Browser*)browser {
639
639
}
640
640
}
641
641
642
- - (void )destroyAndRebuildIncognitoBrowserState {
643
- DCHECK (_main_profile->HasOffTheRecordChromeBrowserState ());
642
+ - (void )destroyAndRebuildIncognitoProfile {
643
+ DCHECK (_main_profile->HasOffTheRecordProfile ());
644
644
_nonPersistentWebViewConfiguration = nil ;
645
645
646
646
ProfileIOS* otrProfile = _main_profile->GetOffTheRecordProfile ();
0 commit comments