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 "chrome/browser/extensions/api/experience_sampling_private/experience_sampling_private_api.h"
6
7#include "base/metrics/field_trial.h"
8#include "chrome/common/extensions/api/experience_sampling_private.h"
9
10namespace sampling = extensions::api::experience_sampling_private;
11
12namespace extensions {
13
14bool ExperienceSamplingPrivateGetBrowserInfoFunction::RunAsync() {
15  std::string field_trials;
16  sampling::BrowserInfo info;
17
18  base::FieldTrialList::StatesToString(&field_trials);
19  info.variations = field_trials;
20
21  SetResult(info.ToValue().release());
22  SendResponse(true /* success */);
23  return true;
24}
25
26}  // namespace extensions
27