1 // Copyright (c) 2013 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/wrong_hwid_screen_handler.h"
7 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
8 #include "chrome/grit/generated_resources.h"
9 #include "components/login/localized_values_builder.h"
13 const char kJsScreenPath
[] = "login.WrongHWIDScreen";
19 WrongHWIDScreenHandler::WrongHWIDScreenHandler()
20 : BaseScreenHandler(kJsScreenPath
),
22 show_on_init_(false) {
25 WrongHWIDScreenHandler::~WrongHWIDScreenHandler() {
27 delegate_
->OnActorDestroyed(this);
30 void WrongHWIDScreenHandler::PrepareToShow() {
33 void WrongHWIDScreenHandler::Show() {
34 if (!page_is_ready()) {
38 ShowScreen(OobeUI::kScreenWrongHWID
, NULL
);
41 void WrongHWIDScreenHandler::Hide() {
44 void WrongHWIDScreenHandler::SetDelegate(Delegate
* delegate
) {
50 void WrongHWIDScreenHandler::DeclareLocalizedValues(
51 ::login::LocalizedValuesBuilder
* builder
) {
52 builder
->Add("wrongHWIDScreenHeader", IDS_WRONG_HWID_SCREEN_HEADER
);
53 builder
->Add("wrongHWIDMessageFirstPart",
54 IDS_WRONG_HWID_SCREEN_MESSAGE_FIRST_PART
);
55 builder
->Add("wrongHWIDMessageSecondPart",
56 IDS_WRONG_HWID_SCREEN_MESSAGE_SECOND_PART
);
57 builder
->Add("wrongHWIDScreenSkipLink",
58 IDS_WRONG_HWID_SCREEN_SKIP_LINK
);
61 void WrongHWIDScreenHandler::Initialize() {
62 if (!page_is_ready() || !delegate_
)
67 show_on_init_
= false;
71 void WrongHWIDScreenHandler::RegisterMessages() {
72 AddCallback("wrongHWIDOnSkip", &WrongHWIDScreenHandler::HandleOnSkip
);
75 void WrongHWIDScreenHandler::HandleOnSkip() {
80 } // namespace chromeos