Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.cc

Issue 12213110: Implemented screen notifying users about malformed HWID. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Implemented wizard controller test. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h"
6
7 #include "base/bind.h"
8 #include "base/values.h"
9 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
10 #include "grit/chromium_strings.h"
11 #include "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h"
13
14 namespace chromeos {
15
16 WrongHWIDScreenHandler::WrongHWIDScreenHandler()
17 : delegate_(NULL), show_on_init_(false) {
18 }
19
20 WrongHWIDScreenHandler::~WrongHWIDScreenHandler() {
21 if (delegate_)
22 delegate_->OnActorDestroyed(this);
23 }
24
25 void WrongHWIDScreenHandler::PrepareToShow() {
26 }
27
28 void WrongHWIDScreenHandler::Show() {
29 if (!page_is_ready()) {
30 show_on_init_ = true;
31 return;
32 }
33 ShowScreen(OobeUI::kScreenWrongHWID, NULL);
34 }
35
36 void WrongHWIDScreenHandler::Hide() {
37 }
38
39 void WrongHWIDScreenHandler::SetDelegate(Delegate* delegate) {
40 delegate_ = delegate;
41 if (page_is_ready())
42 Initialize();
43 }
44
45 void WrongHWIDScreenHandler::GetLocalizedStrings(
46 base::DictionaryValue* localized_strings) {
47 localized_strings->SetString(
48 "wrongHWIDScreenHeader",
49 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_HEADER));
50 localized_strings->SetString(
51 "wrongHWIDMessageFirstPart",
52 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_MESSAGE_FIRST_PART));
53 localized_strings->SetString(
54 "wrongHWIDMessageSecondPart",
55 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_MESSAGE_SECOND_PART));
56 localized_strings->SetString(
57 "wrongHWIDScreenSkipLink",
58 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_SKIP_LINK));
59 }
60
61 void WrongHWIDScreenHandler::Initialize() {
62 if (!page_is_ready() || !delegate_)
63 return;
64
65 if (show_on_init_) {
66 Show();
67 show_on_init_ = false;
68 }
69 }
70
71 void WrongHWIDScreenHandler::RegisterMessages() {
72 web_ui()->RegisterMessageCallback("wrongHWIDOnSkip",
73 base::Bind(&WrongHWIDScreenHandler::HandleOnSkip,
74 base::Unretained(this)));
75 }
76
77 void WrongHWIDScreenHandler::HandleOnSkip(const base::ListValue* args) {
78 if (delegate_)
79 delegate_->OnExit();
80 }
81
82 } // namespace chromeos
83
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698