LocalizedValuesBuilder moved to components/login.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / auto_enrollment_check_screen_handler.cc
blob185ac00e23895d994daf113d9e1acdfde19a09f3
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/auto_enrollment_check_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"
11 namespace {
13 const char kJsScreenPath[] = "login.AutoEnrollmentCheckScreen";
15 } // namespace
17 namespace chromeos {
19 AutoEnrollmentCheckScreenHandler::AutoEnrollmentCheckScreenHandler()
20 : BaseScreenHandler(kJsScreenPath),
21 delegate_(NULL),
22 show_on_init_(false) {
25 AutoEnrollmentCheckScreenHandler::~AutoEnrollmentCheckScreenHandler() {
26 if (delegate_)
27 delegate_->OnActorDestroyed(this);
30 void AutoEnrollmentCheckScreenHandler::Show() {
31 if (!page_is_ready()) {
32 show_on_init_ = true;
33 return;
35 ShowScreen(OobeUI::kScreenAutoEnrollmentCheck, NULL);
38 void AutoEnrollmentCheckScreenHandler::SetDelegate(Delegate* delegate) {
39 delegate_ = delegate;
40 if (page_is_ready())
41 Initialize();
44 void AutoEnrollmentCheckScreenHandler::DeclareLocalizedValues(
45 ::login::LocalizedValuesBuilder* builder) {
46 builder->Add("autoEnrollmentCheckScreenHeader",
47 IDS_AUTO_ENROLLMENT_CHECK_SCREEN_HEADER);
48 builder->Add("autoEnrollmentCheckMessage",
49 IDS_AUTO_ENROLLMENT_CHECK_SCREEN_MESSAGE);
52 void AutoEnrollmentCheckScreenHandler::Initialize() {
53 if (!page_is_ready() || !delegate_)
54 return;
56 if (show_on_init_) {
57 Show();
58 show_on_init_ = false;
62 void AutoEnrollmentCheckScreenHandler::RegisterMessages() {}
64 } // namespace chromeos