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

@ -17,4 +17,8 @@
android:id="@+id/action_bookmarks" android:id="@+id/action_bookmarks"
android:title="@string/action_bookmarks"/> android:title="@string/action_bookmarks"/>
<item
android:id="@+id/action_reading_mode"
android:title="@string/reading_mode"/>
</menu> </menu>

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

@ -1295,6 +1295,10 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@SuppressLint("NewApi") @SuppressLint("NewApi")
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void clearCookies() { 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(); CookieManager c = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
c.removeAllCookies(null); c.removeAllCookies(null);

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

@ -44,8 +44,6 @@ public class PrivacySettingsActivity extends ThemableSettingsActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// TODO WARNING: SharedPreferences.edit() without a corresponding
// commit() or apply() call
mPreferences = PreferenceManager.getInstance(); mPreferences = PreferenceManager.getInstance();
mSystemBrowser = mPreferences.getSystemBrowserPresent(); mSystemBrowser = mPreferences.getSystemBrowserPresent();
@ -429,6 +427,10 @@ public class PrivacySettingsActivity extends ThemableSettingsActivity {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void clearCookies() { 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(); CookieManager c = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

Loading…
Cancel
Save