OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.preferences.website; | 5 package org.chromium.chrome.browser.preferences.website; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.ActivityManager; | 9 import android.app.ActivityManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 StoredDataClearedCallback { | 296 StoredDataClearedCallback { |
297 // We keep track of the number of sites waiting to be cleared, and when
it reaches 0 we can | 297 // We keep track of the number of sites waiting to be cleared, and when
it reaches 0 we can |
298 // set our testing variable. | 298 // set our testing variable. |
299 private int mNumSitesClearing; | 299 private int mNumSitesClearing; |
300 | 300 |
301 /** | 301 /** |
302 * We fetch all the websites and clear all the non-important data. This
happens | 302 * We fetch all the websites and clear all the non-important data. This
happens |
303 * asynchronously, and at the end we update the UI with the new storage
numbers. | 303 * asynchronously, and at the end we update the UI with the new storage
numbers. |
304 */ | 304 */ |
305 public void clearData() { | 305 public void clearData() { |
306 WebsitePermissionsFetcher fetcher = new WebsitePermissionsFetcher(th
is); | 306 WebsitePermissionsFetcher fetcher = new WebsitePermissionsFetcher(th
is, true); |
307 fetcher.fetchPreferencesForCategory( | 307 fetcher.fetchPreferencesForCategory( |
308 SiteSettingsCategory.fromString(SiteSettingsCategory.CATEGOR
Y_USE_STORAGE)); | 308 SiteSettingsCategory.fromString(SiteSettingsCategory.CATEGOR
Y_USE_STORAGE)); |
309 } | 309 } |
310 | 310 |
311 @Override | 311 @Override |
312 public void onStoredDataCleared() { | 312 public void onStoredDataCleared() { |
313 mNumSitesClearing--; | 313 mNumSitesClearing--; |
314 if (mNumSitesClearing <= 0) clearUnimportantDataDone(); | 314 if (mNumSitesClearing <= 0) clearUnimportantDataDone(); |
315 } | 315 } |
316 | 316 |
(...skipping 25 matching lines...) Expand all Loading... |
342 ActivityInfo activityInfo = getPackageManager().getActivityInfo(getC
omponentName(), 0); | 342 ActivityInfo activityInfo = getPackageManager().getActivityInfo(getC
omponentName(), 0); |
343 if (activityInfo.exported) { | 343 if (activityInfo.exported) { |
344 throw new IllegalStateException("ManageSpaceActivity must not be
exported."); | 344 throw new IllegalStateException("ManageSpaceActivity must not be
exported."); |
345 } | 345 } |
346 } catch (NameNotFoundException ex) { | 346 } catch (NameNotFoundException ex) { |
347 // Something terribly wrong has happened. | 347 // Something terribly wrong has happened. |
348 throw new RuntimeException(ex); | 348 throw new RuntimeException(ex); |
349 } | 349 } |
350 } | 350 } |
351 } | 351 } |
OLD | NEW |