blob: 042ac60c6d34eee8772a574cb0948934cfe8a481 [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/download/download_stats.h"
#include "base/metrics/histogram.h"
void RecordDownloadShelfClose(int size, int in_progress, bool autoclose) {
static const int kMaxShelfSize = 16;
if (autoclose) {
UMA_HISTOGRAM_ENUMERATION(
"Download.ShelfSizeOnAutoClose", size, kMaxShelfSize);
UMA_HISTOGRAM_ENUMERATION(
"Download.ShelfInProgressSizeOnAutoClose", in_progress, kMaxShelfSize);
} else {
UMA_HISTOGRAM_ENUMERATION(
"Download.ShelfSizeOnUserClose", size, kMaxShelfSize);
UMA_HISTOGRAM_ENUMERATION(
"Download.ShelfInProgressSizeOnUserClose", in_progress, kMaxShelfSize);
}
}
void RecordDownloadCount(ChromeDownloadCountTypes type) {
UMA_HISTOGRAM_ENUMERATION(
"Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
}
void RecordDownloadSource(ChromeDownloadSource source) {
UMA_HISTOGRAM_ENUMERATION(
"Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY);
}