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/ui/webui/chromeos/login/device_disabled_screen_handler.h"
7 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
8 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
9 #include "chrome/grit/generated_resources.h"
10 #include "components/login/localized_values_builder.h"
14 const char kJsScreenPath
[] = "login.DeviceDisabledScreen";
20 DeviceDisabledScreenHandler::DeviceDisabledScreenHandler()
21 : BaseScreenHandler(kJsScreenPath
),
23 show_on_init_(false) {
26 DeviceDisabledScreenHandler::~DeviceDisabledScreenHandler() {
28 delegate_
->OnActorDestroyed(this);
31 void DeviceDisabledScreenHandler::Show() {
32 if (!page_is_ready()) {
38 CallJS("setEnrollmentDomain", delegate_
->GetEnrollmentDomain());
39 CallJS("setMessage", delegate_
->GetMessage());
41 ShowScreen(OobeUI::kScreenDeviceDisabled
, NULL
);
44 void DeviceDisabledScreenHandler::Hide() {
45 show_on_init_
= false;
48 void DeviceDisabledScreenHandler::SetDelegate(Delegate
* delegate
) {
54 void DeviceDisabledScreenHandler::UpdateMessage(const std::string
& message
) {
56 CallJS("setMessage", message
);
59 void DeviceDisabledScreenHandler::DeclareLocalizedValues(
60 ::login::LocalizedValuesBuilder
* builder
) {
61 builder
->Add("deviceDisabledHeading", IDS_DEVICE_DISABLED_HEADING
);
62 builder
->Add("deviceDisabledExplanationWithDomain",
63 IDS_DEVICE_DISABLED_EXPLANATION_WITH_DOMAIN
);
64 builder
->Add("deviceDisabledExplanationWithoutDomain",
65 IDS_DEVICE_DISABLED_EXPLANATION_WITHOUT_DOMAIN
);
68 void DeviceDisabledScreenHandler::Initialize() {
69 if (!page_is_ready() || !delegate_
)
74 show_on_init_
= false;
78 void DeviceDisabledScreenHandler::RegisterMessages() {
81 } // namespace chromeos