| OLD | NEW |
| 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.download.ui; | 5 package org.chromium.chrome.browser.download.ui; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.ComponentName; | 8 import android.content.ComponentName; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.res.Resources; | 10 import android.content.res.Resources; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 int iconSize = resources.getDimensionPixelSize(R.dimen.downloads_ite
m_icon_size); | 83 int iconSize = resources.getDimensionPixelSize(R.dimen.downloads_ite
m_icon_size); |
| 84 | 84 |
| 85 mOfflinePageBridge = new OfflinePageDownloadBridge( | 85 mOfflinePageBridge = new OfflinePageDownloadBridge( |
| 86 Profile.getLastUsedProfile().getOriginalProfile()); | 86 Profile.getLastUsedProfile().getOriginalProfile()); |
| 87 mSelectionDelegate = new DownloadItemSelectionDelegate(); | 87 mSelectionDelegate = new DownloadItemSelectionDelegate(); |
| 88 mThumbnailProvider = new ThumbnailProviderImpl(iconSize); | 88 mThumbnailProvider = new ThumbnailProviderImpl(iconSize); |
| 89 } | 89 } |
| 90 | 90 |
| 91 @Override | 91 @Override |
| 92 public DownloadDelegate getDownloadDelegate() { | 92 public DownloadDelegate getDownloadDelegate() { |
| 93 return DownloadManagerService.getDownloadManagerService( | 93 return DownloadManagerService.getDownloadManagerService(); |
| 94 ContextUtils.getApplicationContext()); | |
| 95 } | 94 } |
| 96 | 95 |
| 97 @Override | 96 @Override |
| 98 public OfflinePageDownloadBridge getOfflinePageBridge() { | 97 public OfflinePageDownloadBridge getOfflinePageBridge() { |
| 99 return mOfflinePageBridge; | 98 return mOfflinePageBridge; |
| 100 } | 99 } |
| 101 | 100 |
| 102 @Override | 101 @Override |
| 103 public ThumbnailProvider getThumbnailProvider() { | 102 public ThumbnailProvider getThumbnailProvider() { |
| 104 return mThumbnailProvider; | 103 return mThumbnailProvider; |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 public SpaceDisplay getSpaceDisplayForTests() { | 533 public SpaceDisplay getSpaceDisplayForTests() { |
| 535 return mSpaceDisplay; | 534 return mSpaceDisplay; |
| 536 } | 535 } |
| 537 | 536 |
| 538 /** Sets a BackendProvider that is used in place of a real one. */ | 537 /** Sets a BackendProvider that is used in place of a real one. */ |
| 539 @VisibleForTesting | 538 @VisibleForTesting |
| 540 public static void setProviderForTests(BackendProvider provider) { | 539 public static void setProviderForTests(BackendProvider provider) { |
| 541 sProviderForTests = provider; | 540 sProviderForTests = provider; |
| 542 } | 541 } |
| 543 } | 542 } |
| OLD | NEW |