Commit c2363c43 authored by Brian Malcolm's avatar Brian Malcolm Committed by Commit Bot

Replace display domain with domain manager in offline login page.

This changes the subtitle that tells the user who is managing this
device. For Dasher domains, it will continue to be a domain (foo.com).
For FlexOrgs, this will be the email of the administrator of the
organization (admin@foo.com).

BUG=chromium:1081272

Change-Id: I41c6eb66115e2e4b9ad7e4427c12935bbcf4b223
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454155Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Brian Malcolm <bmalcolm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814814}
parent cda2c8b4
...@@ -532,7 +532,7 @@ cr.define('cr.ui.login.debug', function() { ...@@ -532,7 +532,7 @@ cr.define('cr.ui.login.debug', function() {
trigger: (screen) => { trigger: (screen) => {
screen.loadAuthExtension({ screen.loadAuthExtension({
screenMode: 1, // Offline screenMode: 1, // Offline
enterpriseDisplayDomain: 'example.com', enterpriseDomainManager: 'example.com',
}); });
}, },
}, },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
Attributes: Attributes:
'showEnterpriseMessage' - If the "manged by" message should be shown. 'showEnterpriseMessage' - If the "manged by" message should be shown.
'domain' - The enterprise domain the device is managed by. 'manager' - The entity (email or domain) the device is managed by.
'emailDomain' - autocomplete domain for the email input. 'emailDomain' - autocomplete domain for the email input.
Events: Events:
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
</div> </div>
<div id="subtitle-container"> <div id="subtitle-container">
<div id="managedBy" class="enterprise-info" <div id="managedBy" class="enterprise-info"
hidden$="[[!domain]]"> hidden$="[[!manager]]">
[[i18nDynamic(locale, 'enterpriseInfoMessage', domain)]] [[i18nDynamic(locale, 'enterpriseInfoMessage', manager)]]
</div> </div>
</div> </div>
<gaia-input-form id="email-input-form" <gaia-input-form id="email-input-form"
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
}, },
/** /**
* Management domain. * Domain manager.
* @type {?string} * @type {?string}
*/ */
domain: { manager: {
type: String, type: String,
value: '', value: '',
}, },
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
reset() { reset() {
this.disabled = false; this.disabled = false;
this.emailDomain = ''; this.emailDomain = '';
this.domain = ''; this.manager = '';
this.email_ = ''; this.email_ = '';
this.fullEmail_ = ''; this.fullEmail_ = '';
this.$.emailInput.isInvalid = false; this.$.emailInput.isInvalid = false;
......
...@@ -1353,8 +1353,8 @@ Polymer({ ...@@ -1353,8 +1353,8 @@ Polymer({
this.startLoadingTimer_(); this.startLoadingTimer_();
const offlineLogin = this.$['offline-gaia']; const offlineLogin = this.$['offline-gaia'];
offlineLogin.reset(); offlineLogin.reset();
if ('enterpriseDisplayDomain' in params) if ('enterpriseDomainManager' in params)
offlineLogin.domain = params['enterpriseDisplayDomain']; offlineLogin.manager = params['enterpriseDomainManager'];
if ('emailDomain' in params) if ('emailDomain' in params)
offlineLogin.emailDomain = '@' + params['emailDomain']; offlineLogin.emailDomain = '@' + params['emailDomain'];
offlineLogin.setEmail(params.email); offlineLogin.setEmail(params.email);
......
...@@ -126,6 +126,9 @@ cr.define('cr.login', function() { ...@@ -126,6 +126,9 @@ cr.define('cr.login', function() {
// Default is |true|. // Default is |true|.
'flow', // One of 'default', 'enterprise', or 'theftprotection'. 'flow', // One of 'default', 'enterprise', or 'theftprotection'.
'enterpriseDisplayDomain', // Current domain name to be displayed. 'enterpriseDisplayDomain', // Current domain name to be displayed.
'enterpriseDomainManager', // Manager of the current domain. Can be
// either a domain name (foo.com) or an email
// address (admin@foo.com).
'enterpriseEnrollmentDomain', // Domain in which hosting device is (or 'enterpriseEnrollmentDomain', // Domain in which hosting device is (or
// should be) enrolled. // should be) enrolled.
'emailDomain', // Value used to prefill domain for email. 'emailDomain', // Value used to prefill domain for email.
......
...@@ -161,6 +161,12 @@ GaiaScreenHandler::GaiaScreenMode GetGaiaScreenMode(const std::string& email, ...@@ -161,6 +161,12 @@ GaiaScreenHandler::GaiaScreenMode GetGaiaScreenMode(const std::string& email,
return GaiaScreenHandler::GAIA_SCREEN_MODE_DEFAULT; return GaiaScreenHandler::GAIA_SCREEN_MODE_DEFAULT;
} }
std::string GetEnterpriseDomainManager() {
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
return connector->GetEnterpriseDomainManager();
}
std::string GetEnterpriseDisplayDomain() { std::string GetEnterpriseDisplayDomain() {
policy::BrowserPolicyConnectorChromeOS* connector = policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos(); g_browser_process->platform_part()->browser_policy_connector_chromeos();
...@@ -487,12 +493,16 @@ void GaiaScreenHandler::LoadGaiaWithPartitionAndVersionAndConsent( ...@@ -487,12 +493,16 @@ void GaiaScreenHandler::LoadGaiaWithPartitionAndVersionAndConsent(
const std::string enterprise_display_domain(GetEnterpriseDisplayDomain()); const std::string enterprise_display_domain(GetEnterpriseDisplayDomain());
const std::string enterprise_enrollment_domain( const std::string enterprise_enrollment_domain(
GetEnterpriseEnrollmentDomain()); GetEnterpriseEnrollmentDomain());
const std::string enterprise_domain_manager(GetEnterpriseDomainManager());
if (!enterprise_display_domain.empty()) if (!enterprise_display_domain.empty())
params.SetString("enterpriseDisplayDomain", enterprise_display_domain); params.SetString("enterpriseDisplayDomain", enterprise_display_domain);
if (!enterprise_enrollment_domain.empty()) { if (!enterprise_enrollment_domain.empty()) {
params.SetString("enterpriseEnrollmentDomain", params.SetString("enterpriseEnrollmentDomain",
enterprise_enrollment_domain); enterprise_enrollment_domain);
} }
if (!enterprise_domain_manager.empty()) {
params.SetString("enterpriseDomainManager", enterprise_domain_manager);
}
params.SetBoolean("enterpriseManagedDevice", params.SetBoolean("enterpriseManagedDevice",
g_browser_process->platform_part() g_browser_process->platform_part()
->browser_policy_connector_chromeos() ->browser_policy_connector_chromeos()
......
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