Commit ab1215df authored by manukh's avatar manukh Committed by Commit Bot

[omnibox] [chrome://omnibox] Include chrome version in export JSON.

This CL includes version info (e.g. version, channel, OS, CL, etc) in
the JSON download and copy exports. This was already included in batch
exports.

Bug: 891303, 987279
Change-Id: Ic1b04046320b366b56b7629edbe65892d4fc3c70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432045Reviewed-by: default avatarOrin Jaworski <orinj@chromium.org>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810781}
parent 42e85210
......@@ -263,11 +263,6 @@ class ExportDelegate {
const variationInfo =
await sendWithPromise('requestVariationInfo', true);
const pathInfo = await sendWithPromise('requestPathInfo');
const loadTimeDataKeys = ['cl', 'command_line', 'executable_path',
'language', 'official', 'os_type', 'profile_path', 'useragent',
'version', 'version_bitsize', 'version_modifier'];
const versionDetails = Object.fromEntries(
loadTimeDataKeys.map(key => [key, loadTimeData.getValue(key)]));
const now = new Date();
const fileName = `omnibox_batch_${ExportDelegate.getTimeStamp(now)}.json`;
......@@ -280,7 +275,7 @@ class ExportDelegate {
description: '',
authorTool: 'chrome://omnibox',
batchName,
versionDetails,
versionDetails : ExportDelegate.getVersionDetails_(),
variationInfo,
pathInfo,
appVersion: navigator.appVersion,
......@@ -338,6 +333,7 @@ class ExportDelegate {
/** @private @return {OmniboxExport} */
get exportData_() {
return {
versionDetails : ExportDelegate.getVersionDetails_(),
queryInputs: this.omniboxInput_.queryInputs,
displayInputs: this.omniboxInput_.displayInputs,
responsesHistory: this.omniboxOutput_.responsesHistory,
......@@ -370,6 +366,15 @@ class ExportDelegate {
const iso = date.toISOString();
return iso.replace(/:/g, '').split('.')[0];
}
/** @private @return {Object} */
static getVersionDetails_() {
const loadTimeDataKeys = ['cl', 'command_line', 'executable_path',
'language', 'official', 'os_type', 'profile_path', 'useragent',
'version', 'version_processor_variation', 'version_modifier'];
return Object.fromEntries(
loadTimeDataKeys.map(key => [key, loadTimeData.getValue(key)]));
}
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment