1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h"
9 #include "base/logging.h"
10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/browser_process_platform_part.h"
12 #include "chrome/browser/chromeos/login/wizard_controller.h"
16 DeviceDisabledScreen::DeviceDisabledScreen(
17 BaseScreenDelegate
* base_screen_delegate
,
18 DeviceDisabledScreenActor
* actor
)
19 : BaseScreen(base_screen_delegate
),
21 device_disabling_manager_(g_browser_process
->platform_part()->
22 device_disabling_manager()),
26 actor_
->SetDelegate(this);
27 device_disabling_manager_
->AddObserver(this);
30 DeviceDisabledScreen::~DeviceDisabledScreen() {
32 actor_
->SetDelegate(nullptr);
33 device_disabling_manager_
->RemoveObserver(this);
36 void DeviceDisabledScreen::PrepareToShow() {
39 void DeviceDisabledScreen::Show() {
40 if (!actor_
|| showing_
)
47 void DeviceDisabledScreen::Hide() {
56 std::string
DeviceDisabledScreen::GetName() const {
57 return WizardController::kDeviceDisabledScreenName
;
60 void DeviceDisabledScreen::OnActorDestroyed(DeviceDisabledScreenActor
* actor
) {
65 const std::string
& DeviceDisabledScreen::GetEnrollmentDomain() const {
66 return device_disabling_manager_
->enrollment_domain();
69 const std::string
& DeviceDisabledScreen::GetMessage() const {
70 return device_disabling_manager_
->disabled_message();
73 void DeviceDisabledScreen::OnDisabledMessageChanged(
74 const std::string
& disabled_message
) {
76 actor_
->UpdateMessage(disabled_message
);
79 } // namespace chromeos