| 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.content.ComponentName; | 7 import android.content.ComponentName; |
| 8 import android.support.v7.widget.RecyclerView.ViewHolder; | 8 import android.support.v7.widget.RecyclerView.ViewHolder; |
| 9 import android.view.LayoutInflater; | 9 import android.view.LayoutInflater; |
| 10 import android.view.ViewGroup; | 10 import android.view.ViewGroup; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 public long getTotalDownloadSize() { | 179 public long getTotalDownloadSize() { |
| 180 long totalSize = 0; | 180 long totalSize = 0; |
| 181 totalSize += mRegularDownloadItems.getTotalBytes(); | 181 totalSize += mRegularDownloadItems.getTotalBytes(); |
| 182 totalSize += mIncognitoDownloadItems.getTotalBytes(); | 182 totalSize += mIncognitoDownloadItems.getTotalBytes(); |
| 183 totalSize += mOfflinePageItems.getTotalBytes(); | 183 totalSize += mOfflinePageItems.getTotalBytes(); |
| 184 return totalSize; | 184 return totalSize; |
| 185 } | 185 } |
| 186 | 186 |
| 187 @Override | 187 @Override |
| 188 protected int getTimedItemViewResId() { | 188 protected int getTimedItemViewResId() { |
| 189 return R.layout.download_date_view; | 189 return R.layout.date_view; |
| 190 } | 190 } |
| 191 | 191 |
| 192 @Override | 192 @Override |
| 193 public ViewHolder createViewHolder(ViewGroup parent) { | 193 public ViewHolder createViewHolder(ViewGroup parent) { |
| 194 DownloadItemView v = (DownloadItemView) LayoutInflater.from(parent.getCo
ntext()).inflate( | 194 DownloadItemView v = (DownloadItemView) LayoutInflater.from(parent.getCo
ntext()).inflate( |
| 195 R.layout.download_item_view, parent, false); | 195 R.layout.download_item_view, parent, false); |
| 196 v.setSelectionDelegate(getSelectionDelegate()); | 196 v.setSelectionDelegate(getSelectionDelegate()); |
| 197 return new DownloadHistoryItemViewHolder(v); | 197 return new DownloadHistoryItemViewHolder(v); |
| 198 } | 198 } |
| 199 | 199 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 itemCounts[DownloadFilter.FILTER_VIDEO]); | 405 itemCounts[DownloadFilter.FILTER_VIDEO]); |
| 406 } | 406 } |
| 407 | 407 |
| 408 private void recordTotalDownloadCountHistogram() { | 408 private void recordTotalDownloadCountHistogram() { |
| 409 // The total count intentionally leaves out incognito downloads. This sh
ould be revisited | 409 // The total count intentionally leaves out incognito downloads. This sh
ould be revisited |
| 410 // if/when incognito downloads are persistently available in downloads h
ome. | 410 // if/when incognito downloads are persistently available in downloads h
ome. |
| 411 RecordHistogram.recordCountHistogram("Android.DownloadManager.InitialCou
nt.Total", | 411 RecordHistogram.recordCountHistogram("Android.DownloadManager.InitialCou
nt.Total", |
| 412 mRegularDownloadItems.size() + mOfflinePageItems.size()); | 412 mRegularDownloadItems.size() + mOfflinePageItems.size()); |
| 413 } | 413 } |
| 414 } | 414 } |
| OLD | NEW |