Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java

Issue 2542203002: [Android History] Add Android history manager UI and bridge (Closed)
Patch Set: Rebase, drop changes to time.* Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698