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

Unified Diff: components/version_ui/version_handler_helper.cc

Issue 1486403002: Mojo-ifying chrome://version. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 5 years 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: components/version_ui/version_handler_helper.cc
diff --git a/components/version_ui/version_handler_helper.cc b/components/version_ui/version_handler_helper.cc
index 2a9c2a1c1e13dad4c77079059a9124fde519a405..522238303ec655c4b4b7e985d3aea05140869c36 100644
--- a/components/version_ui/version_handler_helper.cc
+++ b/components/version_ui/version_handler_helper.cc
@@ -13,8 +13,9 @@
namespace version_ui {
-scoped_ptr<base::Value> GetVariationsList() {
- std::vector<std::string> variations;
+scoped_ptr<std::vector<std::string>> GetVariations() {
+ scoped_ptr<std::vector<std::string>> variations(
+ new std::vector<std::string>);
#if !defined(NDEBUG)
base::FieldTrial::ActiveGroups active_groups;
base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
@@ -25,20 +26,26 @@ scoped_ptr<base::Value> GetVariationsList() {
for (const auto& group : active_groups) {
std::string line = group.trial_name + ":" + group.group_name;
base::ReplaceChars(line, "-", kNonBreakingHyphenUTF8String, &line);
- variations.push_back(line);
+ variations->push_back(line);
}
#else
// In release mode, display the hashes only.
- variations::GetFieldTrialActiveGroupIdsAsStrings(&variations);
+ variations::GetFieldTrialActiveGroupIdsAsStrings(variations.get());
#endif
+ return variations.Pass();
+}
+#if defined(OS_IOS)
+scoped_ptr<base::Value> GetVariationsList() {
+ scoped_ptr<std::vector<std::string>> variations = GetVariations();
scoped_ptr<base::ListValue> variations_list(new base::ListValue);
- for (std::vector<std::string>::const_iterator it = variations.begin();
- it != variations.end(); ++it) {
+ for (std::vector<std::string>::const_iterator it = variations->begin();
+ it != variations->end(); ++it) {
variations_list->Append(new base::StringValue(*it));
}
return variations_list.Pass();
}
+#endif
} // namespace version_ui

Powered by Google App Engine
This is Rietveld 408576698