BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / download / download_stats.cc
blob890411a3a21bc3c873c235df8b527089c6c34cf1
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;
11 if (autoclose) {
12 UMA_HISTOGRAM_ENUMERATION(
13 "Download.ShelfSizeOnAutoClose", size, kMaxShelfSize);
14 UMA_HISTOGRAM_ENUMERATION(
15 "Download.ShelfInProgressSizeOnAutoClose", in_progress, kMaxShelfSize);
16 } else {
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",
37 danger_type,
38 content::DOWNLOAD_DANGER_TYPE_MAX);
41 void RecordOpenedDangerousConfirmDialog(
42 content::DownloadDangerType danger_type) {
43 UMA_HISTOGRAM_ENUMERATION("Download.ShowDangerousDownloadConfirmationPrompt",
44 danger_type,
45 content::DOWNLOAD_DANGER_TYPE_MAX);
48 void RecordDownloadOpenMethod(ChromeDownloadOpenMethod open_method) {
49 UMA_HISTOGRAM_ENUMERATION("Download.OpenMethod",
50 open_method,
51 DOWNLOAD_OPEN_METHOD_LAST_ENTRY);