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

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

Issue 2915863002: Photo Picker dialog: Add UMA statistics. (Closed)
Patch Set: Address feedback from Theresa Created 3 years, 6 months 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; 5 package org.chromium.chrome.browser.download;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.PendingIntent; 8 import android.app.PendingIntent;
9 import android.content.ActivityNotFoundException; 9 import android.content.ActivityNotFoundException;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 private static final String TAG = "download"; 88 private static final String TAG = "download";
89 89
90 private static final String DEFAULT_MIME_TYPE = "*/*"; 90 private static final String DEFAULT_MIME_TYPE = "*/*";
91 private static final String MIME_TYPE_DELIMITER = "/"; 91 private static final String MIME_TYPE_DELIMITER = "/";
92 private static final String MIME_TYPE_VIDEO = "video"; 92 private static final String MIME_TYPE_VIDEO = "video";
93 93
94 private static final String EXTRA_IS_OFF_THE_RECORD = 94 private static final String EXTRA_IS_OFF_THE_RECORD =
95 "org.chromium.chrome.browser.download.IS_OFF_THE_RECORD"; 95 "org.chromium.chrome.browser.download.IS_OFF_THE_RECORD";
96 96
97 private static final long BYTES_PER_KILOBYTE = 1024; 97 public static final int BYTES_PER_KILOBYTE = 1024;
98 private static final long BYTES_PER_MEGABYTE = 1024 * 1024; 98 public static final int BYTES_PER_MEGABYTE = 1024 * 1024;
99 private static final long BYTES_PER_GIGABYTE = 1024 * 1024 * 1024; 99 public static final int BYTES_PER_GIGABYTE = 1024 * 1024 * 1024;
Theresa 2017/06/01 15:58:04 These should move to a place that makes sense for
100 100
101 @VisibleForTesting 101 @VisibleForTesting
102 static final long SECONDS_PER_MINUTE = TimeUnit.MINUTES.toSeconds(1); 102 static final long SECONDS_PER_MINUTE = TimeUnit.MINUTES.toSeconds(1);
103 @VisibleForTesting 103 @VisibleForTesting
104 static final long SECONDS_PER_HOUR = TimeUnit.HOURS.toSeconds(1); 104 static final long SECONDS_PER_HOUR = TimeUnit.HOURS.toSeconds(1);
105 @VisibleForTesting 105 @VisibleForTesting
106 static final long SECONDS_PER_DAY = TimeUnit.DAYS.toSeconds(1); 106 static final long SECONDS_PER_DAY = TimeUnit.DAYS.toSeconds(1);
107 107
108 @VisibleForTesting 108 @VisibleForTesting
109 static final String ELLIPSIS = "\u2026"; 109 static final String ELLIPSIS = "\u2026";
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 public static Date getDateAtMidnight(long timestamp) { 880 public static Date getDateAtMidnight(long timestamp) {
881 Calendar cal = Calendar.getInstance(); 881 Calendar cal = Calendar.getInstance();
882 cal.setTimeInMillis(timestamp); 882 cal.setTimeInMillis(timestamp);
883 cal.set(Calendar.HOUR_OF_DAY, 0); 883 cal.set(Calendar.HOUR_OF_DAY, 0);
884 cal.set(Calendar.MINUTE, 0); 884 cal.set(Calendar.MINUTE, 0);
885 cal.set(Calendar.SECOND, 0); 885 cal.set(Calendar.SECOND, 0);
886 cal.set(Calendar.MILLISECOND, 0); 886 cal.set(Calendar.MILLISECOND, 0);
887 return cal.getTime(); 887 return cal.getTime();
888 } 888 }
889 } 889 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698