| Index: components/metrics/chromeos/useraction_sample.cc
|
| diff --git a/components/metrics/chromeos/useraction_sample.cc b/components/metrics/chromeos/useraction_sample.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b0a6e40414bd5e7e834897426ecf0828f081a5d6
|
| --- /dev/null
|
| +++ b/components/metrics/chromeos/useraction_sample.cc
|
| @@ -0,0 +1,30 @@
|
| +// Copyright 2014 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 "components/metrics/chromeos/useraction_sample.h"
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/strings/stringprintf.h"
|
| +#include "components/metrics/chromeos/metric_sample.h"
|
| +
|
| +namespace metrics {
|
| +
|
| +UserActionSample::UserActionSample(const std::string& action_name)
|
| + : MetricSample(MetricSample::USER_ACTION, action_name) {}
|
| +
|
| +UserActionSample::~UserActionSample() {}
|
| +
|
| +std::string UserActionSample::ToString() const {
|
| + return base::StringPrintf("useraction%c%s%c", '\0', name().c_str(), '\0');
|
| +}
|
| +
|
| +// static
|
| +scoped_ptr<UserActionSample> UserActionSample::ReadUserAction(
|
| + const std::string& action) {
|
| + return scoped_ptr<UserActionSample>(new UserActionSample(action));
|
| +}
|
| +
|
| +} // namespace metrics
|
|
|