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

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: Merge conflicts resolved. 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 <string>
8
9 #include "base/bind.h"
10 #include "base/command_line.h"
11 #include "base/values.h"
12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/prefs/pref_service.h"
14 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
15 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/pref_names.h"
17 #include "grit/browser_resources.h"
18 #include "grit/chromium_strings.h"
19 #include "grit/generated_resources.h"
20 #include "ui/base/l10n/l10n_util.h"
21
22 namespace chromeos {
23
24 WrongHWIDScreenHandler::WrongHWIDScreenHandler()
25 : delegate_(NULL), show_on_init_(false) {
26 }
27
28 WrongHWIDScreenHandler::~WrongHWIDScreenHandler() {
29 if (delegate_)
30 delegate_->OnActorDestroyed(this);
31 }
32
33 void WrongHWIDScreenHandler::PrepareToShow() {
34 }
35
36 void WrongHWIDScreenHandler::Show() {
37 if (!page_is_ready()) {
38 show_on_init_ = true;
39 return;
40 }
41 ShowScreen(OobeUI::kScreenWrongHWID, NULL);
42 }
43
44 void WrongHWIDScreenHandler::Hide() {
45 }
46
47 void WrongHWIDScreenHandler::SetDelegate(Delegate* delegate) {
48 delegate_ = delegate;
49 if (page_is_ready())
50 Initialize();
51 }
52
53 void WrongHWIDScreenHandler::GetLocalizedStrings(
54 base::DictionaryValue* localized_strings) {
55 localized_strings->SetString(
56 "wrongHWIDScreenHeader",
57 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_HEADER));
58 localized_strings->SetString(
59 "wrongHWIDMessageFirstPart",
60 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_MESSAGE_FIRST_PART));
61 localized_strings->SetString(
62 "wrongHWIDMessageSecondPart",
63 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_MESSAGE_SECOND_PART));
64 localized_strings->SetString(
65 "wrongHWIDScreenSkipLink",
66 l10n_util::GetStringUTF16(IDS_WRONG_HWID_SCREEN_SKIP_LINK));
67 }
68
69 void WrongHWIDScreenHandler::Initialize() {
70 if (!page_is_ready() || !delegate_)
71 return;
72
73 if (show_on_init_) {
74 Show();
75 show_on_init_ = false;
76 }
77 }
78
79 void WrongHWIDScreenHandler::RegisterMessages() {
80 web_ui()->RegisterMessageCallback("wrongHWIDOnSkip",
81 base::Bind(&WrongHWIDScreenHandler::HandleOnSkip,
82 base::Unretained(this)));
83 }
84
85 void WrongHWIDScreenHandler::HandleOnSkip(const base::ListValue* args) {
86 if (delegate_)
87 delegate_->OnExit();
88 }
89
90 } // namespace chromeos
91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698