Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Move code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T committed Aug 22, 2019
1 parent a78ba6e commit 57e3338
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
16 changes: 0 additions & 16 deletions Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3074,24 +3074,8 @@ extension BrowserViewController: PreferencesObserver {
setupTabs()
updateTabsBarVisibility()
updateApplicationShortcuts()

tabManager.removeAll()

// Clear all persistent data
let clearables: [Clearable] = [
HistoryClearable(),
CacheClearable(),
CookiesAndCacheClearable(),
PasswordsClearable(profile: self.profile)
]

// Reset tab manager configuration
tabManager.resetConfiguration()
ClearPrivateDataTableViewController.clearPrivateData(clearables).uponQueue(DispatchQueue.main) { _ in

// Clear saved tab data
TabMO.deleteAll()
}
case Preferences.Shields.blockAdsAndTracking.key,
Preferences.Shields.httpsEverywhere.key,
Preferences.Shields.blockScripts.key,
Expand Down
10 changes: 10 additions & 0 deletions Client/Frontend/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ class SettingsViewController: TableViewController {

alert.addAction(UIAlertAction(title: Strings.OKString, style: .default, handler: { _ in
Preferences.Privacy.privateBrowsingOnly.value = value

let clearables: [Clearable] = [
HistoryClearable(),
CacheClearable(),
CookiesAndCacheClearable(),
PasswordsClearable(profile: self.profile)
]
ClearPrivateDataTableViewController.clearPrivateData(clearables).uponQueue(DispatchQueue.main) { _ in
TabMO.deleteAll()
}
}))

self.present(alert, animated: true, completion: nil)
Expand Down

0 comments on commit 57e3338

Please sign in to comment.