當前位置: 首頁>>代碼示例>>Java>>正文


Java StoredDataClearedCallback類代碼示例

本文整理匯總了Java中org.chromium.chrome.browser.preferences.website.Website.StoredDataClearedCallback的典型用法代碼示例。如果您正苦於以下問題:Java StoredDataClearedCallback類的具體用法?Java StoredDataClearedCallback怎麽用?Java StoredDataClearedCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StoredDataClearedCallback類屬於org.chromium.chrome.browser.preferences.website.Website包,在下文中一共展示了StoredDataClearedCallback類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearStorage

import org.chromium.chrome.browser.preferences.website.Website.StoredDataClearedCallback; //導入依賴的package包/類
/**
 * This clears all the storage for websites that are displayed to the user. This happens
 * asynchronously, and then we call {@link #getInfoForOrigins()} when we're done.
 */
public void clearStorage() {
    if (mWebsites == null) {
        return;
    }
    RecordUserAction.record("MobileSettingsStorageClearAll");

    // The goal is to refresh the info for origins again after we've cleared all of them, so we
    // wait until the last website is cleared to refresh the origin list.
    final int[] numLeft = new int[1];
    numLeft[0] = mWebsites.size();
    for (int i = 0; i < mWebsites.size(); i++) {
        WebsitePreference preference = mWebsites.get(i);
        preference.site().clearAllStoredData(new StoredDataClearedCallback() {
            @Override
            public void onStoredDataCleared() {
                if (--numLeft[0] <= 0) {
                    getInfoForOrigins();
                }
            }
        });
    }
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:27,代碼來源:SingleCategoryPreferences.java


注:本文中的org.chromium.chrome.browser.preferences.website.Website.StoredDataClearedCallback類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。