1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/download/download_stats.h"
7 #include "base/metrics/histogram.h"
9 void RecordDownloadShelfClose(int size
, int in_progress
, bool autoclose
) {
10 static const int kMaxShelfSize
= 16;
12 UMA_HISTOGRAM_ENUMERATION(
13 "Download.ShelfSizeOnAutoClose", size
, kMaxShelfSize
);
14 UMA_HISTOGRAM_ENUMERATION(
15 "Download.ShelfInProgressSizeOnAutoClose", in_progress
, kMaxShelfSize
);
17 UMA_HISTOGRAM_ENUMERATION(
18 "Download.ShelfSizeOnUserClose", size
, kMaxShelfSize
);
19 UMA_HISTOGRAM_ENUMERATION(
20 "Download.ShelfInProgressSizeOnUserClose", in_progress
, kMaxShelfSize
);
24 void RecordDownloadCount(ChromeDownloadCountTypes type
) {
25 UMA_HISTOGRAM_ENUMERATION(
26 "Download.CountsChrome", type
, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY
);
29 void RecordDownloadSource(ChromeDownloadSource source
) {
30 UMA_HISTOGRAM_ENUMERATION(
31 "Download.SourcesChrome", source
, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY
);
34 void RecordDangerousDownloadWarningShown(
35 content::DownloadDangerType danger_type
) {
36 UMA_HISTOGRAM_ENUMERATION("Download.DownloadWarningShown",
38 content::DOWNLOAD_DANGER_TYPE_MAX
);
41 void RecordOpenedDangerousConfirmDialog(
42 content::DownloadDangerType danger_type
) {
43 UMA_HISTOGRAM_ENUMERATION("Download.ShowDangerousDownloadConfirmationPrompt",
45 content::DOWNLOAD_DANGER_TYPE_MAX
);
48 void RecordDownloadOpenMethod(ChromeDownloadOpenMethod open_method
) {
49 UMA_HISTOGRAM_ENUMERATION("Download.OpenMethod",
51 DOWNLOAD_OPEN_METHOD_LAST_ENTRY
);