| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/extensions/api/metrics_private/metrics_private_api.h" | 5 #include "chrome/browser/extensions/api/metrics_private/metrics_private_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/common/extensions/api/metrics_private.h" | 13 #include "chrome/common/extensions/api/metrics_private.h" |
| 14 #include "chrome/common/extensions/extension.h" | |
| 15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 16 #include "components/variations/variations_associated_data.h" | 15 #include "components/variations/variations_associated_data.h" |
| 17 #include "content/public/browser/user_metrics.h" | 16 #include "content/public/browser/user_metrics.h" |
| 17 #include "extensions/common/extension.h" |
| 18 | 18 |
| 19 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
| 20 #include "chrome/browser/chromeos/settings/cros_settings.h" | 20 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 21 #endif // OS_CHROMEOS | 21 #endif // OS_CHROMEOS |
| 22 | 22 |
| 23 namespace extensions { | 23 namespace extensions { |
| 24 | 24 |
| 25 namespace GetIsCrashReportingEnabled = | 25 namespace GetIsCrashReportingEnabled = |
| 26 api::metrics_private::GetIsCrashReportingEnabled; | 26 api::metrics_private::GetIsCrashReportingEnabled; |
| 27 namespace GetVariationParams = api::metrics_private::GetVariationParams; | 27 namespace GetVariationParams = api::metrics_private::GetVariationParams; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 bool MetricsPrivateRecordLongTimeFunction::RunImpl() { | 209 bool MetricsPrivateRecordLongTimeFunction::RunImpl() { |
| 210 scoped_ptr<RecordLongTime::Params> params( | 210 scoped_ptr<RecordLongTime::Params> params( |
| 211 RecordLongTime::Params::Create(*args_)); | 211 RecordLongTime::Params::Create(*args_)); |
| 212 EXTENSION_FUNCTION_VALIDATE(params.get()); | 212 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 213 static const int kOneHourMs = 60 * 60 * 1000; | 213 static const int kOneHourMs = 60 * 60 * 1000; |
| 214 return RecordValue(params->metric_name, base::HISTOGRAM, | 214 return RecordValue(params->metric_name, base::HISTOGRAM, |
| 215 1, kOneHourMs, 50, params->value); | 215 1, kOneHourMs, 50, params->value); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace extensions | 218 } // namespace extensions |
| OLD | NEW |