Home | History | Annotate | Download | only in download
      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.
      4 
      5 #include "chrome/browser/download/download_stats.h"
      6 
      7 #include "base/metrics/histogram.h"
      8 
      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);
     21   }
     22 }
     23 
     24 void RecordDownloadCount(ChromeDownloadCountTypes type) {
     25   UMA_HISTOGRAM_ENUMERATION(
     26       "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
     27 }
     28 
     29 void RecordDownloadSource(ChromeDownloadSource source) {
     30   UMA_HISTOGRAM_ENUMERATION(
     31       "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY);
     32 }
     33