Browse Source

Clear webdata when the cookies are cleared

master
Anthony Restaino 10 years ago
parent
commit
5c1b765616
  1. 4
      res/menu/incognito.xml
  2. 4
      src/acr/browser/lightning/BrowserActivity.java
  3. 6
      src/acr/browser/lightning/PrivacySettingsActivity.java

4
res/menu/incognito.xml

@ -16,5 +16,9 @@ @@ -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>

4
src/acr/browser/lightning/BrowserActivity.java

@ -1295,6 +1295,10 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll @@ -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);

6
src/acr/browser/lightning/PrivacySettingsActivity.java

@ -44,8 +44,6 @@ public class PrivacySettingsActivity extends ThemableSettingsActivity { @@ -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 { @@ -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) {

Loading…
Cancel
Save