Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ManageSpaceActivity.java

Issue 2953853002: [Android Site Settings] Disable fetching important sites when not needed (Closed)
Patch Set: comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698