Commit 28ede294 authored by Brian Malcolm's avatar Brian Malcolm Committed by Commit Bot

Enrollment Screen - show manager on successful enrollment

The manager for Dasher domains will be the domain name (foo.com), but
for FlexOrgs the manager will be the email address of the FlexOrg
administrator (admin@foo.com).

BUG=chromium:1081272

Change-Id: I872a2c3bc6208656387f45de122b79e0d8a71e03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2453443
Commit-Queue: Brian Malcolm <bmalcolm@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Cr-Commit-Position: refs/heads/master@{#814878}
parent e39e1fd9
......@@ -75,11 +75,12 @@ bool ShouldAttemptRestart() {
return false;
}
// Returns the enterprise display domain after enrollment, or an empty string.
std::string GetEnterpriseDisplayDomain() {
// Returns the manager of the domain (either the domain name or the email of the
// admin of the domain) after enrollment, or an empty string.
std::string GetEnterpriseDomainManager() {
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
return connector->GetEnterpriseDisplayDomain();
return connector->GetEnterpriseDomainManager();
}
} // namespace
......@@ -382,7 +383,7 @@ void EnrollmentScreen::OnDeviceEnrolled() {
VLOG(1) << "Device enrolled.";
enrollment_succeeded_ = true;
// Some info to be shown on the success screen.
view_->SetEnterpriseDomainAndDeviceType(GetEnterpriseDisplayDomain(),
view_->SetEnterpriseDomainInfo(GetEnterpriseDomainManager(),
ui::GetChromeOSDeviceName());
enrollment_helper_->GetDeviceAttributeUpdatePermission();
......@@ -429,7 +430,7 @@ void EnrollmentScreen::OnDeviceAttributeUpdatePermission(bool granted) {
void EnrollmentScreen::OnRestoreAfterRollbackCompleted() {
// Pass the enterprise domain and the device type to be shown.
view_->SetEnterpriseDomainAndDeviceType(GetEnterpriseDisplayDomain(),
view_->SetEnterpriseDomainInfo(GetEnterpriseDomainManager(),
ui::GetChromeOSDeviceName());
// Show the success screen
StartupUtils::MarkDeviceRegistered(
......
......@@ -54,9 +54,8 @@ class EnrollmentScreenView {
virtual void SetEnrollmentConfig(Controller* controller,
const policy::EnrollmentConfig& config) = 0;
// Sets the enterprise domain and the device type to be shown for the user.
virtual void SetEnterpriseDomainAndDeviceType(
const std::string& domain,
// Sets the enterprise manager and the device type to be shown for the user.
virtual void SetEnterpriseDomainInfo(const std::string& manager,
const base::string16& device_type) = 0;
// Shows the contents of the screen.
......
......@@ -35,8 +35,8 @@ class MockEnrollmentScreenView : public EnrollmentScreenView {
SetEnrollmentConfig,
(Controller*, const policy::EnrollmentConfig& config));
MOCK_METHOD(void,
SetEnterpriseDomainAndDeviceType,
(const std::string& domain, const base::string16& device_type));
SetEnterpriseDomainInfo,
(const std::string& manager, const base::string16& device_type));
MOCK_METHOD(void, Show, ());
MOCK_METHOD(void, Hide, ());
MOCK_METHOD(void, ShowSigninScreen, ());
......
......@@ -138,9 +138,9 @@
icon1x="oobe-32:enterprise" icon2x="oobe-64:enterprise">
</hd-iron-icon>
<!-- Hide the subtitle if the domain could not be determined. -->
<div hidden="[[isEmpty_(enrolledDomain_)]]" class="self-start"
<div hidden="[[isEmpty_(domainManager_)]]" class="self-start"
slot="subtitle">
<div>[[successText_(locale, deviceName_, enrolledDomain_)]]</div>
<div>[[successText_(locale, deviceName_, domainManager_)]]</div>
</div>
<div slot="footer" class="flex layout vertical center end-justified">
<img srcset="images/enrollment_success_illustration_1x.png 1x,
......
......@@ -42,7 +42,7 @@ Polymer({
'doReload',
'setAdJoinConfiguration',
'setAdJoinParams',
'setEnterpriseDomainAndDeviceType',
'setEnterpriseDomainInfo',
'showAttributePromptStep',
'showError',
'showStep',
......@@ -59,9 +59,10 @@ Polymer({
},
/**
* Domain the device was enrolled to.
* Manager of the enrolled domain. Either a domain (foo.com) or an email
* address (admin@foo.com).
*/
enrolledDomain_: {
domainManager_: {
type: String,
value: '',
},
......@@ -356,11 +357,11 @@ Polymer({
/**
* Sets the type of the device and the enterprise domain to be shown.
*
* @param {string} enterprise_domain
* @param {string} manager
* @param {string} device_type
*/
setEnterpriseDomainAndDeviceType(enterprise_domain, device_type) {
this.enrolledDomain_ = enterprise_domain;
setEnterpriseDomainInfo(manager, device_type) {
this.domainManager_ = manager;
this.deviceName_ = device_type;
},
......
......@@ -339,10 +339,10 @@ void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() {
ShowStep(kEnrollmentStepWorking);
}
void EnrollmentScreenHandler::SetEnterpriseDomainAndDeviceType(
const std::string& domain,
void EnrollmentScreenHandler::SetEnterpriseDomainInfo(
const std::string& manager,
const base::string16& device_type) {
CallJS("login.OAuthEnrollmentScreen.setEnterpriseDomainAndDeviceType", domain,
CallJS("login.OAuthEnrollmentScreen.setEnterpriseDomainInfo", manager,
device_type);
}
......
......@@ -71,8 +71,7 @@ class EnrollmentScreenHandler
void SetEnrollmentConfig(Controller* controller,
const policy::EnrollmentConfig& config) override;
void SetEnterpriseDomainAndDeviceType(
const std::string& domain,
void SetEnterpriseDomainInfo(const std::string& manager,
const base::string16& device_type) override;
void Show() override;
void Hide() override;
......
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