For #12980 - Unify deleteBrowsingData() and deleteHistoryAndDOMStorages()

The two methods are serving the same purpose, with one calling the other.
This prepares the ground for adding a method to delete icons in only one place
and remove confusion about what that place should be.
pull/35/head
Mugurell 4 years ago committed by Mihai Adrian Carare
parent 4a73993259
commit aa7283def9

@ -53,7 +53,7 @@ fun deleteAndQuit(activity: Activity, coroutineScope: CoroutineScope, snackbar:
private suspend fun DeleteBrowsingDataController.deleteType(type: DeleteBrowsingDataOnQuitType) {
when (type) {
DeleteBrowsingDataOnQuitType.TABS -> deleteTabs()
DeleteBrowsingDataOnQuitType.HISTORY -> deleteHistoryAndDOMStorages()
DeleteBrowsingDataOnQuitType.HISTORY -> deleteBrowsingData()
DeleteBrowsingDataOnQuitType.COOKIES -> deleteCookies()
DeleteBrowsingDataOnQuitType.CACHE -> deleteCachedFiles()
DeleteBrowsingDataOnQuitType.PERMISSIONS -> withContext(IO) {

@ -15,7 +15,6 @@ import kotlin.coroutines.CoroutineContext
interface DeleteBrowsingDataController {
suspend fun deleteTabs()
suspend fun deleteBrowsingData()
suspend fun deleteHistoryAndDOMStorages()
suspend fun deleteCookies()
suspend fun deleteCachedFiles()
suspend fun deleteSitePermissions()
@ -36,14 +35,10 @@ class DefaultDeleteBrowsingDataController(
}
override suspend fun deleteBrowsingData() {
deleteHistoryAndDOMStorages()
}
override suspend fun deleteHistoryAndDOMStorages() {
withContext(coroutineContext) {
engine.clearData(Engine.BrowsingData.select(Engine.BrowsingData.DOM_STORAGES))
historyStorage.deleteEverything()
}
historyStorage.deleteEverything()
}
override suspend fun deleteCookies() {

Loading…
Cancel
Save