OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.download; | 5 package org.chromium.chrome.browser.download; |
6 | 6 |
7 import android.app.DownloadManager; | 7 import android.app.DownloadManager; |
8 import android.content.ActivityNotFoundException; | 8 import android.content.ActivityNotFoundException; |
9 import android.content.BroadcastReceiver; | 9 import android.content.BroadcastReceiver; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 } | 1595 } |
1596 | 1596 |
1597 /** | 1597 /** |
1598 * Parse the DownloadUmaStatsEntry from the shared preference. | 1598 * Parse the DownloadUmaStatsEntry from the shared preference. |
1599 */ | 1599 */ |
1600 private void parseUMAStatsEntriesFromSharedPrefs() { | 1600 private void parseUMAStatsEntriesFromSharedPrefs() { |
1601 if (mSharedPrefs.contains(DOWNLOAD_UMA_ENTRY)) { | 1601 if (mSharedPrefs.contains(DOWNLOAD_UMA_ENTRY)) { |
1602 Set<String> entries = | 1602 Set<String> entries = |
1603 DownloadManagerService.getStoredDownloadInfo(mSharedPrefs, D
OWNLOAD_UMA_ENTRY); | 1603 DownloadManagerService.getStoredDownloadInfo(mSharedPrefs, D
OWNLOAD_UMA_ENTRY); |
1604 for (String entryString : entries) { | 1604 for (String entryString : entries) { |
1605 mUmaEntries.add(DownloadUmaStatsEntry.parseFromString(entryStrin
g)); | 1605 DownloadUmaStatsEntry entry = DownloadUmaStatsEntry.parseFromStr
ing(entryString); |
| 1606 if (entry != null) mUmaEntries.add(entry); |
1606 } | 1607 } |
1607 } | 1608 } |
1608 } | 1609 } |
1609 | 1610 |
1610 /** Adds a new DownloadHistoryAdapter to the list. */ | 1611 /** Adds a new DownloadHistoryAdapter to the list. */ |
1611 @Override | 1612 @Override |
1612 public void addDownloadHistoryAdapter(DownloadHistoryAdapter adapter) { | 1613 public void addDownloadHistoryAdapter(DownloadHistoryAdapter adapter) { |
1613 mHistoryAdapters.addObserver(adapter); | 1614 mHistoryAdapters.addObserver(adapter); |
1614 DownloadSharedPreferenceHelper.getInstance().addObserver(adapter); | 1615 DownloadSharedPreferenceHelper.getInstance().addObserver(adapter); |
1615 } | 1616 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 boolean isOffTheRecord); | 1824 boolean isOffTheRecord); |
1824 private native void nativeRemoveDownload(long nativeDownloadManagerService,
String downloadGuid, | 1825 private native void nativeRemoveDownload(long nativeDownloadManagerService,
String downloadGuid, |
1825 boolean isOffTheRecord); | 1826 boolean isOffTheRecord); |
1826 private native void nativeGetAllDownloads( | 1827 private native void nativeGetAllDownloads( |
1827 long nativeDownloadManagerService, boolean isOffTheRecord); | 1828 long nativeDownloadManagerService, boolean isOffTheRecord); |
1828 private native void nativeCheckForExternallyRemovedDownloads( | 1829 private native void nativeCheckForExternallyRemovedDownloads( |
1829 long nativeDownloadManagerService, boolean isOffTheRecord); | 1830 long nativeDownloadManagerService, boolean isOffTheRecord); |
1830 private native void nativeUpdateLastAccessTime( | 1831 private native void nativeUpdateLastAccessTime( |
1831 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); | 1832 long nativeDownloadManagerService, String downloadGuid, boolean isOf
fTheRecord); |
1832 } | 1833 } |
OLD | NEW |