Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Unified Diff: chrome/browser/extensions/api/metrics_private/metrics_private_api.cc

Issue 17496005: Add a private API method metricsPrivate.getFieldTrial(), which returns (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
diff --git a/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc b/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
index 08ac6f3452b69f437bbf066b6f983bd9174c9700..f65d80e80c3f05c015d4071833c830126fd8f2a4 100644
--- a/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
+++ b/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
@@ -22,6 +23,7 @@ namespace extensions {
namespace GetIsCrashReportingEnabled =
api::metrics_private::GetIsCrashReportingEnabled;
+namespace GetFieldTrial = api::metrics_private::GetFieldTrial;
namespace RecordUserAction = api::metrics_private::RecordUserAction;
namespace RecordValue = api::metrics_private::RecordValue;
namespace RecordPercentage = api::metrics_private::RecordPercentage;
@@ -66,6 +68,14 @@ bool MetricsPrivateGetIsCrashReportingEnabledFunction::RunImpl() {
return true;
}
+bool MetricsPrivateGetFieldTrialFunction::RunImpl() {
+ std::string name;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &name));
+
+ SetResult(new base::StringValue(base::FieldTrialList::FindFullName(name)));
+ return true;
+}
+
bool MetricsPrivateRecordUserActionFunction::RunImpl() {
scoped_ptr<RecordUserAction::Params> params(
RecordUserAction::Params::Create(*args_));

Powered by Google App Engine
This is Rietveld 408576698