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.
4
5#include "chrome/browser/chromeos/login/screens/hid_detection_screen.h"
6
7#include "chrome/browser/chromeos/login/screens/screen_observer.h"
8#include "chrome/browser/chromeos/login/wizard_controller.h"
9
10namespace chromeos {
11
12HIDDetectionScreen::HIDDetectionScreen(
13    ScreenObserver* observer, HIDDetectionScreenActor* actor)
14    : WizardScreen(observer), actor_(actor) {
15  DCHECK(actor_);
16  if (actor_)
17    actor_->SetDelegate(this);
18}
19
20HIDDetectionScreen::~HIDDetectionScreen() {
21  if (actor_)
22    actor_->SetDelegate(NULL);
23}
24
25void HIDDetectionScreen::PrepareToShow() {
26}
27
28void HIDDetectionScreen::Show() {
29  if (actor_)
30    actor_->Show();
31}
32
33void HIDDetectionScreen::Hide() {
34  if (actor_)
35    actor_->Hide();
36}
37
38std::string HIDDetectionScreen::GetName() const {
39  return WizardController::kHIDDetectionScreenName;
40}
41
42void HIDDetectionScreen::OnExit() {
43  get_screen_observer()->OnExit(ScreenObserver::HID_DETECTION_COMPLETED);
44}
45
46void HIDDetectionScreen::OnActorDestroyed(HIDDetectionScreenActor* actor) {
47  if (actor_ == actor)
48    actor_ = NULL;
49}
50
51}  // namespace chromeos
52