Commit b521e13f authored by Renee Wright's avatar Renee Wright Committed by Commit Bot

Add a special about-page license message for when Crostini is installed

This message is also supposed to link to
/run/imageloader/cros-termina/<version>/about_os_credits.html on the
CrOS machine, but that is not present unless Termina is running. I
think that part will be more involved, so I want to do it in a second
CL.

Bug: 858832
Change-Id: I1ab11af69de6434ddcfacd4987951a05e50b3889
Reviewed-on: https://chromium-review.googlesource.com/1143169
Commit-Queue: Renée Wright <rjwright@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579703}
parent 50094223
......@@ -4,6 +4,7 @@
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../icons.html">
<link rel="import" href="../lifetime_browser_proxy.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_page/main_page_behavior.html">
<link rel="import" href="../settings_page/settings_animated_pages.html">
......@@ -264,7 +265,10 @@
<div class="info-section">
<div class="secondary">$i18nRaw{aboutProductLicense}</div>
<if expr="chromeos">
<div class="secondary">$i18nRaw{aboutProductOsLicense}</div>
<div class="secondary"
inner-h-t-m-l="[[getAboutProductOsLicense_(
showCrostiniLicense_)]]">
</div>
</if>
</div>
<if expr="_google_chrome">
......
......@@ -42,6 +42,15 @@ Polymer({
/** @private */
hasEndOfLife_: Boolean,
/** @private */
showCrostini: Boolean,
/** @private */
showCrostiniLicense_: {
type: Boolean,
value: false,
},
// </if>
// <if expr="_google_chrome and is_macosx">
......@@ -133,6 +142,7 @@ Polymer({
'currentChannel_)',
'updateShowButtonContainer_(' +
'showRelaunch_, showRelaunchAndPowerwash_, showCheckUpdates_)',
'handleCrostiniEnabledChanged_(prefs.crostini.enabled.value)',
// </if>
],
......@@ -513,6 +523,26 @@ Polymer({
return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED);
},
/**
* @param {boolean} showCrostiniLicense True if Crostini is enabled and
* Crostini UI is allowed.
* @return {string}
* @private
*/
getAboutProductOsLicense_: function(showCrostiniLicense) {
return showCrostiniLicense ?
this.i18nAdvanced('aboutProductOsWithLinuxLicense') :
this.i18nAdvanced('aboutProductOsLicense');
},
/**
* @param {boolean} enabled True if Crostini is enabled.
* @private
*/
handleCrostiniEnabledChanged_: function(enabled) {
this.showCrostiniLicense_ = enabled && this.showCrostini;
},
/**
* @return {boolean}
* @private
......
......@@ -54,7 +54,9 @@
</settings-basic-page>
</template>
<template is="dom-if" if="[[showPages_.about]]">
<settings-about-page in-search-mode="[[inSearchMode_]]">
<settings-about-page in-search-mode="[[inSearchMode_]]"
prefs="{{prefs}}"
show-crostini="[[showCrostini]]">
</settings-about-page>
</template>
<div id="overscroll" style="padding-bottom: [[overscroll_]]px"></div>
......
......@@ -322,6 +322,11 @@ AboutHandler* AboutHandler::Create(content::WebUIDataSource* html_source,
IDS_ABOUT_CROS_VERSION_LICENSE,
base::ASCIIToUTF16(chrome::kChromeUIOSCreditsURL));
html_source->AddString("aboutProductOsLicense", os_license);
base::string16 os_with_linux_license = l10n_util::GetStringFUTF16(
IDS_ABOUT_CROS_WITH_LINUX_VERSION_LICENSE,
base::ASCIIToUTF16(chrome::kChromeUIOSCreditsURL));
html_source->AddString("aboutProductOsWithLinuxLicense",
os_with_linux_license);
html_source->AddBoolean("aboutEnterpriseManaged", IsEnterpriseManaged());
base::Time build_time = base::SysInfo::GetLsbReleaseTime();
......
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