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

Unified Diff: chrome/browser/ui/webui/version_handler.cc

Issue 1418653004: [iOS] Support for chrome://version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment from blundell Created 5 years, 2 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
« no previous file with comments | « no previous file | components/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/version_handler.cc
diff --git a/chrome/browser/ui/webui/version_handler.cc b/chrome/browser/ui/webui/version_handler.cc
index 0b6040f62bed82e1f9bf41a5548f178f3453011e..adef9f837ac8e3658003c595886dd5e7e06d84f0 100644
--- a/chrome/browser/ui/webui/version_handler.cc
+++ b/chrome/browser/ui/webui/version_handler.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
#include "components/variations/active_field_trials.h"
+#include "components/version_ui/version_handler_helper.h"
#include "components/version_ui/version_ui_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/plugin_service.h"
@@ -84,34 +85,8 @@ void VersionHandler::HandleRequestVersionInfo(const base::ListValue* args) {
base::Owned(profile_path_buffer)));
// Respond with the variations info immediately.
- std::vector<std::string> variations;
-#if !defined(NDEBUG)
- base::FieldTrial::ActiveGroups active_groups;
- base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
-
- const unsigned char kNonBreakingHyphenUTF8[] = { 0xE2, 0x80, 0x91, '\0' };
- const std::string kNonBreakingHyphenUTF8String(
- reinterpret_cast<const char*>(kNonBreakingHyphenUTF8));
- for (size_t i = 0; i < active_groups.size(); ++i) {
- std::string line = active_groups[i].trial_name + ":" +
- active_groups[i].group_name;
- base::ReplaceChars(line, "-", kNonBreakingHyphenUTF8String, &line);
- variations.push_back(line);
- }
-#else
- // In release mode, display the hashes only.
- variations::GetFieldTrialActiveGroupIdsAsStrings(&variations);
-#endif
-
- base::ListValue variations_list;
- for (std::vector<std::string>::const_iterator it = variations.begin();
- it != variations.end(); ++it) {
- variations_list.Append(new base::StringValue(*it));
- }
-
- // In release mode, this will return an empty list to clear the section.
web_ui()->CallJavascriptFunction(version_ui::kReturnVariationInfo,
- variations_list);
+ *version_ui::GetVariationsList());
}
void VersionHandler::OnGotFilePaths(base::string16* executable_path_data,
« no previous file with comments | « no previous file | components/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698