本文整理匯總了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);
}
示例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);
}
示例3: OfflinePageItemWrapper
import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
OfflinePageItemWrapper(OfflinePageDownloadItem item, BackendProvider provider,
ComponentName component) {
super(provider, component);
mItem = item;
}
示例4: getItem
import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
@Override
public OfflinePageDownloadItem getItem() {
return mItem;
}
示例5: getAllItems
import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
/** See {@link OfflinePageDownloadBridge#getAllItems}. */
List<OfflinePageDownloadItem> getAllItems();
示例6: createOfflinePageItemWrapper
import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem; //導入依賴的package包/類
private OfflinePageItemWrapper createOfflinePageItemWrapper(OfflinePageDownloadItem item) {
return new OfflinePageItemWrapper(item, mBackendProvider, mParentComponent);
}