Search in sources :

Example 1 with WebViewDatabase

use of android.webkit.WebViewDatabase in project Lightning-Browser by anthonycr.

the class WebUtils method clearHistory.

public static void clearHistory(@NonNull Context context, @NonNull HistoryRepository historyRepository, @NonNull Scheduler databaseScheduler) {
    historyRepository.deleteHistory().subscribeOn(databaseScheduler).subscribe();
    WebViewDatabase webViewDatabase = WebViewDatabase.getInstance(context);
    webViewDatabase.clearFormData();
    webViewDatabase.clearHttpAuthUsernamePassword();
    Utils.trimCache(context);
}
Also used : WebViewDatabase(android.webkit.WebViewDatabase)

Example 2 with WebViewDatabase

use of android.webkit.WebViewDatabase in project Lightning-Browser by anthonycr.

the class WebUtils method clearHistory.

public static void clearHistory(@NonNull Context context) {
    HistoryModel.deleteHistory().subscribeOn(Schedulers.io()).subscribe();
    WebViewDatabase m = WebViewDatabase.getInstance(context);
    m.clearFormData();
    m.clearHttpAuthUsernamePassword();
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
        //noinspection deprecation
        m.clearUsernamePassword();
        //noinspection deprecation
        WebIconDatabase.getInstance().removeAllIcons();
    }
    Utils.trimCache(context);
}
Also used : WebViewDatabase(android.webkit.WebViewDatabase)

Example 3 with WebViewDatabase

use of android.webkit.WebViewDatabase in project focus-android by mozilla-mobile.

the class SystemWebView method cleanup.

@Override
public void cleanup() {
    clearFormData();
    clearHistory();
    clearMatches();
    clearSslPreferences();
    clearCache(true);
    // We don't care about the callback - we just want to make sure cookies are gone
    CookieManager.getInstance().removeAllCookies(null);
    WebStorage.getInstance().deleteAllData();
    final WebViewDatabase webViewDatabase = WebViewDatabase.getInstance(getContext());
    // It isn't entirely clear how this differs from WebView.clearFormData()
    webViewDatabase.clearFormData();
    webViewDatabase.clearHttpAuthUsernamePassword();
    deleteContentFromKnownLocations(getContext());
}
Also used : WebViewDatabase(android.webkit.WebViewDatabase)

Example 4 with WebViewDatabase

use of android.webkit.WebViewDatabase in project Rocket by mozilla-tw.

the class WebkitView method cleanup.

@Override
public void cleanup() {
    clearFormData();
    clearHistory();
    clearMatches();
    clearSslPreferences();
    clearCache(true);
    // We don't care about the viewClient - we just want to make sure cookies are gone
    CookieManager.getInstance().removeAllCookies(null);
    WebStorage.getInstance().deleteAllData();
    final WebViewDatabase webViewDatabase = WebViewDatabase.getInstance(getContext());
    // It isn't entirely clear how this differs from WebView.clearFormData()
    webViewDatabase.clearFormData();
    webViewDatabase.clearHttpAuthUsernamePassword();
}
Also used : WebViewDatabase(android.webkit.WebViewDatabase)

Aggregations

WebViewDatabase (android.webkit.WebViewDatabase)4