| 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 38e6c601783cbbf697bf438379df6c1fc107d16d..75fb63e77a3b5d49f495a71cf9a010a04ea0ff50 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| @@ -8,7 +8,6 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| -#include "base/command_line.h"
|
| #include "base/debug/trace_event.h"
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| @@ -40,6 +39,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"
|
| @@ -54,7 +54,6 @@
|
| #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| -#include "chromeos/chromeos_switches.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "chromeos/dbus/power_manager_client.h"
|
| #include "chromeos/ime/ime_keyboard.h"
|
| @@ -299,12 +298,13 @@ SigninScreenHandler::SigninScreenHandler(
|
| if (keyboard)
|
| keyboard->AddObserver(this);
|
|
|
| - CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| - PrefService* prefs = g_browser_process->local_state();
|
| + policy::ConsumerManagementService* consumer_management =
|
| + g_browser_process->platform_part()->browser_policy_connector_chromeos()->
|
| + GetConsumerManagementService();
|
| is_enrolling_consumer_management_ =
|
| - command_line->HasSwitch(chromeos::switches::kEnableConsumerManagement) &&
|
| - prefs->GetBoolean(prefs::kConsumerManagementEnrollmentRequested);
|
| -
|
| + consumer_management &&
|
| + consumer_management->GetEnrollmentState() ==
|
| + policy::ConsumerManagementService::ENROLLMENT_ENROLLING;
|
| }
|
|
|
| SigninScreenHandler::~SigninScreenHandler() {
|
| @@ -431,8 +431,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 {
|
| @@ -1367,8 +1367,12 @@ void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id,
|
| }
|
|
|
| void SigninScreenHandler::HandleCancelConsumerManagementEnrollment() {
|
| - PrefService* prefs = g_browser_process->local_state();
|
| - prefs->SetBoolean(prefs::kConsumerManagementEnrollmentRequested, false);
|
| + policy::ConsumerManagementService* consumer_management =
|
| + g_browser_process->platform_part()->browser_policy_connector_chromeos()->
|
| + GetConsumerManagementService();
|
| + CHECK(consumer_management);
|
| + consumer_management->SetEnrollmentState(
|
| + policy::ConsumerManagementService::ENROLLMENT_CANCELED);
|
| is_enrolling_consumer_management_ = false;
|
| ShowImpl();
|
| }
|
|
|