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


Java OfflinePageDownloadItem類代碼示例

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


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

示例1: onAllOfflinePagesRetrieved

import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
/** Called when the user's offline page history has been gathered. */
private void onAllOfflinePagesRetrieved(List<OfflinePageDownloadItem> result) {
    if (mOfflinePageItems.isInitialized()) return;
    assert mOfflinePageItems.size() == 0;

    for (OfflinePageDownloadItem item : result) {
        addDownloadHistoryItemWrapper(createOfflinePageItemWrapper(item));
    }

    RecordHistogram.recordCountHistogram("Android.DownloadManager.InitialCount.OfflinePage",
            result.size());

    mOfflinePageItems.setIsInitialized();
    onItemsRetrieved(LoadingStateDelegate.OFFLINE_PAGES);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:16,代碼來源:DownloadHistoryAdapter.java

示例2: initializeOfflinePageBridge

import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
private void initializeOfflinePageBridge() {
    mOfflinePageObserver = new OfflinePageDownloadBridge.Observer() {
        @Override
        public void onItemsLoaded() {
            onAllOfflinePagesRetrieved(getOfflinePageBridge().getAllItems());
        }

        @Override
        public void onItemAdded(OfflinePageDownloadItem item) {
            addDownloadHistoryItemWrapper(createOfflinePageItemWrapper(item));
            updateDisplayedItems();
        }

        @Override
        public void onItemDeleted(String guid) {
            if (mOfflinePageItems.removeItem(guid) != null) updateDisplayedItems();
        }

        @Override
        public void onItemUpdated(OfflinePageDownloadItem item) {
            int index = mOfflinePageItems.findItemIndex(item.getGuid());
            if (index != BackendItems.INVALID_INDEX) {
                OfflinePageItemWrapper wrapper = createOfflinePageItemWrapper(item);
                mOfflinePageItems.set(index, wrapper);
                mFilePathsToItemsMap.replaceItem(wrapper);
                updateDisplayedItems();
            }
        }

        /** Re-filter the items if needed. */
        private void updateDisplayedItems() {
            if (mFilter == DownloadFilter.FILTER_ALL || mFilter == DownloadFilter.FILTER_PAGE) {
                filter(mFilter);
            }
        }
    };
    getOfflinePageBridge().addObserver(mOfflinePageObserver);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:39,代碼來源:DownloadHistoryAdapter.java

示例3: OfflinePageItemWrapper

import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
OfflinePageItemWrapper(OfflinePageDownloadItem item, BackendProvider provider,
        ComponentName component) {
    super(provider, component);
    mItem = item;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:6,代碼來源:DownloadHistoryItemWrapper.java

示例4: getItem

import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
@Override
public OfflinePageDownloadItem getItem() {
    return mItem;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:5,代碼來源:DownloadHistoryItemWrapper.java

示例5: getAllItems

import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
/** See {@link OfflinePageDownloadBridge#getAllItems}. */
List<OfflinePageDownloadItem> getAllItems();
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:3,代碼來源:BackendProvider.java

示例6: createOfflinePageItemWrapper

import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
private OfflinePageItemWrapper createOfflinePageItemWrapper(OfflinePageDownloadItem item) {
    return new OfflinePageItemWrapper(item, mBackendProvider, mParentComponent);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:4,代碼來源:DownloadHistoryAdapter.java


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