OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 "components/metrics/export/useraction_sample.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/stringprintf.h" |
| 11 #include "components/metrics/export/metric_sample.h" |
| 12 |
| 13 namespace metrics { |
| 14 |
| 15 UserActionSample::UserActionSample(const std::string& action_name) |
| 16 : MetricSample(MetricSample::USER_ACTION, action_name) {} |
| 17 |
| 18 UserActionSample::~UserActionSample() {} |
| 19 |
| 20 std::string UserActionSample::ToString() const { |
| 21 return base::StringPrintf("useraction%c%s%c", '\0', name().c_str(), '\0'); |
| 22 } |
| 23 |
| 24 // static |
| 25 scoped_ptr<UserActionSample> UserActionSample::ReadUserAction( |
| 26 const std::string& action) { |
| 27 return scoped_ptr<UserActionSample>(new UserActionSample(action)); |
| 28 } |
| 29 |
| 30 } // namespace metrics |
OLD | NEW |