Commit bdc60900 authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Add ChromeOSVersion and CustomizationId to Help app strings.

These strings are provided to the untrusted js to read and pass up to
the server.

TESTED: Manually on device to check the strings are initialised with
sensible values.

Bug: b/140151178
Change-Id: Id96a28319ed78a68d5bb635ff092c70a976754a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1983688Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Rachel Carpenter <carpenterr@google.com>
Cr-Commit-Position: refs/heads/master@{#728466}
parent eca723d8
......@@ -20,6 +20,7 @@ static_library("help_app_ui") {
"//chromeos/constants",
"//chromeos/resources:help_app_bundle_resources",
"//chromeos/resources:help_app_resources",
"//chromeos/system",
"//content/public/browser",
"//ui/resources:webui_resources_grd_grit",
"//ui/webui",
......
......@@ -9,6 +9,7 @@
#include "chromeos/grit/chromeos_help_app_bundle_resources.h"
#include "chromeos/grit/chromeos_help_app_bundle_resources_map.h"
#include "chromeos/grit/chromeos_help_app_resources.h"
#include "chromeos/system/statistics_provider.h"
#include "content/public/browser/web_ui_data_source.h"
#include "ui/resources/grit/webui_resources.h"
......@@ -30,6 +31,13 @@ content::WebUIDataSource* CreateHelpAppGuestDataSource() {
// Add strings that can be pulled in.
source->AddString("boardName", base::SysInfo::GetLsbReleaseBoard());
source->AddString("chromeOSVersion", base::SysInfo::OperatingSystemVersion());
std::string customization_id;
chromeos::system::StatisticsProvider* provider =
chromeos::system::StatisticsProvider::GetInstance();
provider->GetMachineStatistic(chromeos::system::kCustomizationIdKey,
&customization_id);
source->AddString("customizationId", customization_id);
source->UseStringsJs();
// TODO(crbug.com/1023700): Better solution before launch.
......
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