Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
index 126e2c34c89ae9eb6c8ffdc00e3cbfb59d8f20ca..ab7bda00b4eff13a105131c087a81c0c06e68a58 100644 |
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
@@ -40,6 +40,7 @@ |
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
#include "chrome/browser/chromeos/login/wizard_controller.h" |
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
+#include "chrome/browser/chromeos/policy/consumer_management_service.h" |
#include "chrome/browser/chromeos/policy/device_local_account.h" |
#include "chrome/browser/chromeos/profiles/profile_helper.h" |
#include "chrome/browser/chromeos/settings/cros_settings.h" |
@@ -299,12 +300,13 @@ SigninScreenHandler::SigninScreenHandler( |
if (keyboard) |
keyboard->AddObserver(this); |
- CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- PrefService* prefs = g_browser_process->local_state(); |
+ const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
+ policy::BrowserPolicyConnectorChromeOS* connector = |
+ g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
is_enrolling_consumer_management_ = |
command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement) && |
- prefs->GetBoolean(prefs::kConsumerManagementEnrollmentRequested); |
- |
+ connector->GetConsumerManagementService()->GetEnrollmentState() == |
+ policy::ConsumerManagementService::ENROLLMENT_ENROLLING; |
} |
SigninScreenHandler::~SigninScreenHandler() { |
@@ -431,8 +433,8 @@ void SigninScreenHandler::Show(const LoginScreenContext& context) { |
std::string email; |
if (is_enrolling_consumer_management_) { |
- // We don't check if the value of the owner email is trusted because it is |
- // only used to pre-fill the email field in Gaia sign-in page and a cached |
+ // We don't check if the value of the owner e-mail is trusted because it is |
+ // only used to pre-fill the e-mail field in Gaia sign-in page and a cached |
// value is sufficient. |
CrosSettings::Get()->GetString(kDeviceOwner, &email); |
} else { |
@@ -1345,8 +1347,10 @@ void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id, |
} |
void SigninScreenHandler::HandleCancelConsumerManagementEnrollment() { |
- PrefService* prefs = g_browser_process->local_state(); |
- prefs->SetBoolean(prefs::kConsumerManagementEnrollmentRequested, false); |
+ policy::BrowserPolicyConnectorChromeOS* connector = |
+ g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
+ connector->GetConsumerManagementService()->SetEnrollmentState( |
+ policy::ConsumerManagementService::ENROLLMENT_CANCELED); |
is_enrolling_consumer_management_ = false; |
ShowImpl(); |
} |