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

Side by Side Diff: chrome/browser/ui/webui/version_handler.cc

Issue 286063004: Move active field trial API to variations component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/omnibox/omnibox_field_trial_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/webui/version_handler.h" 5 #include "chrome/browser/ui/webui/version_handler.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/plugins/plugin_prefs.h" 11 #include "chrome/browser/plugins/plugin_prefs.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/common/metrics/variations/variations_util.h" 13 #include "components/variations/active_field_trials.h"
14 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/plugin_service.h" 15 #include "content/public/browser/plugin_service.h"
16 #include "content/public/browser/web_ui.h" 16 #include "content/public/browser/web_ui.h"
17 #include "content/public/common/content_constants.h" 17 #include "content/public/common/content_constants.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
19 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
20 #include "url/gurl.h" 20 #include "url/gurl.h"
21 21
22 namespace { 22 namespace {
23 23
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const std::string kNonBreakingHyphenUTF8String( 94 const std::string kNonBreakingHyphenUTF8String(
95 reinterpret_cast<const char*>(kNonBreakingHyphenUTF8)); 95 reinterpret_cast<const char*>(kNonBreakingHyphenUTF8));
96 for (size_t i = 0; i < active_groups.size(); ++i) { 96 for (size_t i = 0; i < active_groups.size(); ++i) {
97 std::string line = active_groups[i].trial_name + ":" + 97 std::string line = active_groups[i].trial_name + ":" +
98 active_groups[i].group_name; 98 active_groups[i].group_name;
99 base::ReplaceChars(line, "-", kNonBreakingHyphenUTF8String, &line); 99 base::ReplaceChars(line, "-", kNonBreakingHyphenUTF8String, &line);
100 variations.push_back(line); 100 variations.push_back(line);
101 } 101 }
102 #else 102 #else
103 // In release mode, display the hashes only. 103 // In release mode, display the hashes only.
104 chrome_variations::GetFieldTrialActiveGroupIdsAsStrings(&variations); 104 variations::GetFieldTrialActiveGroupIdsAsStrings(&variations);
105 #endif 105 #endif
106 106
107 base::ListValue variations_list; 107 base::ListValue variations_list;
108 for (std::vector<std::string>::const_iterator it = variations.begin(); 108 for (std::vector<std::string>::const_iterator it = variations.begin();
109 it != variations.end(); ++it) { 109 it != variations.end(); ++it) {
110 variations_list.Append(base::Value::CreateStringValue(*it)); 110 variations_list.Append(base::Value::CreateStringValue(*it));
111 } 111 }
112 112
113 // In release mode, this will return an empty list to clear the section. 113 // In release mode, this will return an empty list to clear the section.
114 web_ui()->CallJavascriptFunction("returnVariationInfo", variations_list); 114 web_ui()->CallJavascriptFunction("returnVariationInfo", variations_list);
(...skipping 25 matching lines...) Expand all
140 flash_version = info_array[i].version; 140 flash_version = info_array[i].version;
141 break; 141 break;
142 } 142 }
143 } 143 }
144 } 144 }
145 145
146 base::StringValue arg(flash_version); 146 base::StringValue arg(flash_version);
147 web_ui()->CallJavascriptFunction("returnFlashVersion", arg); 147 web_ui()->CallJavascriptFunction("returnFlashVersion", arg);
148 } 148 }
149 #endif // defined(ENABLE_PLUGINS) 149 #endif // defined(ENABLE_PLUGINS)
OLDNEW
« no previous file with comments | « chrome/browser/omnibox/omnibox_field_trial_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698