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() { ...@@ -75,11 +75,12 @@ bool ShouldAttemptRestart() {
return false; return false;
} }
// Returns the enterprise display domain after enrollment, or an empty string. // Returns the manager of the domain (either the domain name or the email of the
std::string GetEnterpriseDisplayDomain() { // admin of the domain) after enrollment, or an empty string.
std::string GetEnterpriseDomainManager() {
policy::BrowserPolicyConnectorChromeOS* connector = policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos(); g_browser_process->platform_part()->browser_policy_connector_chromeos();
return connector->GetEnterpriseDisplayDomain(); return connector->GetEnterpriseDomainManager();
} }
} // namespace } // namespace
...@@ -382,8 +383,8 @@ void EnrollmentScreen::OnDeviceEnrolled() { ...@@ -382,8 +383,8 @@ void EnrollmentScreen::OnDeviceEnrolled() {
VLOG(1) << "Device enrolled."; VLOG(1) << "Device enrolled.";
enrollment_succeeded_ = true; enrollment_succeeded_ = true;
// Some info to be shown on the success screen. // Some info to be shown on the success screen.
view_->SetEnterpriseDomainAndDeviceType(GetEnterpriseDisplayDomain(), view_->SetEnterpriseDomainInfo(GetEnterpriseDomainManager(),
ui::GetChromeOSDeviceName()); ui::GetChromeOSDeviceName());
enrollment_helper_->GetDeviceAttributeUpdatePermission(); enrollment_helper_->GetDeviceAttributeUpdatePermission();
...@@ -429,8 +430,8 @@ void EnrollmentScreen::OnDeviceAttributeUpdatePermission(bool granted) { ...@@ -429,8 +430,8 @@ void EnrollmentScreen::OnDeviceAttributeUpdatePermission(bool granted) {
void EnrollmentScreen::OnRestoreAfterRollbackCompleted() { void EnrollmentScreen::OnRestoreAfterRollbackCompleted() {
// Pass the enterprise domain and the device type to be shown. // Pass the enterprise domain and the device type to be shown.
view_->SetEnterpriseDomainAndDeviceType(GetEnterpriseDisplayDomain(), view_->SetEnterpriseDomainInfo(GetEnterpriseDomainManager(),
ui::GetChromeOSDeviceName()); ui::GetChromeOSDeviceName());
// Show the success screen // Show the success screen
StartupUtils::MarkDeviceRegistered( StartupUtils::MarkDeviceRegistered(
base::BindOnce(&EnrollmentScreen::ShowEnrollmentStatusOnSuccess, base::BindOnce(&EnrollmentScreen::ShowEnrollmentStatusOnSuccess,
......
...@@ -54,10 +54,9 @@ class EnrollmentScreenView { ...@@ -54,10 +54,9 @@ class EnrollmentScreenView {
virtual void SetEnrollmentConfig(Controller* controller, virtual void SetEnrollmentConfig(Controller* controller,
const policy::EnrollmentConfig& config) = 0; const policy::EnrollmentConfig& config) = 0;
// Sets the enterprise domain and the device type to be shown for the user. // Sets the enterprise manager and the device type to be shown for the user.
virtual void SetEnterpriseDomainAndDeviceType( virtual void SetEnterpriseDomainInfo(const std::string& manager,
const std::string& domain, const base::string16& device_type) = 0;
const base::string16& device_type) = 0;
// Shows the contents of the screen. // Shows the contents of the screen.
virtual void Show() = 0; virtual void Show() = 0;
......
...@@ -35,8 +35,8 @@ class MockEnrollmentScreenView : public EnrollmentScreenView { ...@@ -35,8 +35,8 @@ class MockEnrollmentScreenView : public EnrollmentScreenView {
SetEnrollmentConfig, SetEnrollmentConfig,
(Controller*, const policy::EnrollmentConfig& config)); (Controller*, const policy::EnrollmentConfig& config));
MOCK_METHOD(void, MOCK_METHOD(void,
SetEnterpriseDomainAndDeviceType, SetEnterpriseDomainInfo,
(const std::string& domain, const base::string16& device_type)); (const std::string& manager, const base::string16& device_type));
MOCK_METHOD(void, Show, ()); MOCK_METHOD(void, Show, ());
MOCK_METHOD(void, Hide, ()); MOCK_METHOD(void, Hide, ());
MOCK_METHOD(void, ShowSigninScreen, ()); MOCK_METHOD(void, ShowSigninScreen, ());
......
...@@ -138,9 +138,9 @@ ...@@ -138,9 +138,9 @@
icon1x="oobe-32:enterprise" icon2x="oobe-64:enterprise"> icon1x="oobe-32:enterprise" icon2x="oobe-64:enterprise">
</hd-iron-icon> </hd-iron-icon>
<!-- Hide the subtitle if the domain could not be determined. --> <!-- 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"> slot="subtitle">
<div>[[successText_(locale, deviceName_, enrolledDomain_)]]</div> <div>[[successText_(locale, deviceName_, domainManager_)]]</div>
</div> </div>
<div slot="footer" class="flex layout vertical center end-justified"> <div slot="footer" class="flex layout vertical center end-justified">
<img srcset="images/enrollment_success_illustration_1x.png 1x, <img srcset="images/enrollment_success_illustration_1x.png 1x,
......
...@@ -42,7 +42,7 @@ Polymer({ ...@@ -42,7 +42,7 @@ Polymer({
'doReload', 'doReload',
'setAdJoinConfiguration', 'setAdJoinConfiguration',
'setAdJoinParams', 'setAdJoinParams',
'setEnterpriseDomainAndDeviceType', 'setEnterpriseDomainInfo',
'showAttributePromptStep', 'showAttributePromptStep',
'showError', 'showError',
'showStep', 'showStep',
...@@ -59,9 +59,10 @@ Polymer({ ...@@ -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, type: String,
value: '', value: '',
}, },
...@@ -356,11 +357,11 @@ Polymer({ ...@@ -356,11 +357,11 @@ Polymer({
/** /**
* Sets the type of the device and the enterprise domain to be shown. * Sets the type of the device and the enterprise domain to be shown.
* *
* @param {string} enterprise_domain * @param {string} manager
* @param {string} device_type * @param {string} device_type
*/ */
setEnterpriseDomainAndDeviceType(enterprise_domain, device_type) { setEnterpriseDomainInfo(manager, device_type) {
this.enrolledDomain_ = enterprise_domain; this.domainManager_ = manager;
this.deviceName_ = device_type; this.deviceName_ = device_type;
}, },
......
...@@ -339,10 +339,10 @@ void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() { ...@@ -339,10 +339,10 @@ void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() {
ShowStep(kEnrollmentStepWorking); ShowStep(kEnrollmentStepWorking);
} }
void EnrollmentScreenHandler::SetEnterpriseDomainAndDeviceType( void EnrollmentScreenHandler::SetEnterpriseDomainInfo(
const std::string& domain, const std::string& manager,
const base::string16& device_type) { const base::string16& device_type) {
CallJS("login.OAuthEnrollmentScreen.setEnterpriseDomainAndDeviceType", domain, CallJS("login.OAuthEnrollmentScreen.setEnterpriseDomainInfo", manager,
device_type); device_type);
} }
......
...@@ -71,9 +71,8 @@ class EnrollmentScreenHandler ...@@ -71,9 +71,8 @@ class EnrollmentScreenHandler
void SetEnrollmentConfig(Controller* controller, void SetEnrollmentConfig(Controller* controller,
const policy::EnrollmentConfig& config) override; const policy::EnrollmentConfig& config) override;
void SetEnterpriseDomainAndDeviceType( void SetEnterpriseDomainInfo(const std::string& manager,
const std::string& domain, const base::string16& device_type) override;
const base::string16& device_type) override;
void Show() override; void Show() override;
void Hide() override; void Hide() override;
void ShowSigninScreen() override; void ShowSigninScreen() 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