Clear webdata when the cookies are cleared

This commit is contained in:
Anthony Restaino 2015-05-01 08:58:11 -04:00
parent 79d32127f4
commit 5c1b765616
3 changed files with 12 additions and 2 deletions

View File

@ -16,5 +16,9 @@
<item
android:id="@+id/action_bookmarks"
android:title="@string/action_bookmarks"/>
<item
android:id="@+id/action_reading_mode"
android:title="@string/reading_mode"/>
</menu>

View File

@ -1295,6 +1295,10 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
public void clearCookies() {
// TODO Break out web storage deletion into its own option/action
// TODO clear web storage for all sites that are visited in Incognito mode
WebStorage storage = WebStorage.getInstance();
storage.deleteAllData();
CookieManager c = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
c.removeAllCookies(null);

View File

@ -44,8 +44,6 @@ public class PrivacySettingsActivity extends ThemableSettingsActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// TODO WARNING: SharedPreferences.edit() without a corresponding
// commit() or apply() call
mPreferences = PreferenceManager.getInstance();
mSystemBrowser = mPreferences.getSystemBrowserPresent();
@ -429,6 +427,10 @@ public class PrivacySettingsActivity extends ThemableSettingsActivity {
@SuppressWarnings("deprecation")
public void clearCookies() {
// TODO Break out web storage deletion into its own option/action
// TODO clear web storage for all sites that are visited in Incognito mode
WebStorage storage = WebStorage.getInstance();
storage.deleteAllData();
CookieManager c = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {