host_pairing_screen.h revision 5f1c94371a64b3196d4be9466099bb892df9b88e
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#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HOST_PAIRING_SCREEN_H_
6#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HOST_PAIRING_SCREEN_H_
7
8#include "base/macros.h"
9#include "chrome/browser/chromeos/login/screens/host_pairing_screen_actor.h"
10#include "chrome/browser/chromeos/login/screens/screen_context.h"
11#include "chrome/browser/chromeos/login/screens/wizard_screen.h"
12#include "components/pairing/host_pairing_controller.h"
13
14namespace chromeos {
15
16class HostPairingScreen :
17  public WizardScreen,
18  public pairing_chromeos::HostPairingController::Observer,
19  public HostPairingScreenActor::Delegate {
20 public:
21  HostPairingScreen(ScreenObserver* observer, HostPairingScreenActor* actor);
22  virtual ~HostPairingScreen();
23
24 private:
25  typedef pairing_chromeos::HostPairingController::Stage Stage;
26  typedef pairing_chromeos::HostPairingController::UpdateProgress
27      UpdateProgress;
28
29  void CommitContextChanges();
30
31  // Overridden from WizardScreen:
32  virtual void PrepareToShow() OVERRIDE;
33  virtual void Show() OVERRIDE;
34  virtual void Hide() OVERRIDE;
35  virtual std::string GetName() const OVERRIDE;
36
37  // Overridden from pairing_chromeos::HostPairingController::Observer:
38  virtual void PairingStageChanged(Stage new_stage) OVERRIDE;
39  virtual void UpdateAdvanced(const UpdateProgress& progress) OVERRIDE;
40
41  // Overridden from ControllerPairingView::Delegate:
42  virtual void OnActorDestroyed(HostPairingScreenActor* actor) OVERRIDE;
43
44  // Context for sharing data between C++ and JS.
45  // TODO(dzhioev): move to BaseScreen when possible.
46  ScreenContext context_;
47
48  HostPairingScreenActor* actor_;
49
50  // Controller performing pairing. Owned by the screen for now.
51  // TODO(dzhioev): move to proper place later.
52  scoped_ptr<pairing_chromeos::HostPairingController> controller_;
53
54  // Current stage of pairing process.
55  Stage current_stage_;
56
57  DISALLOW_COPY_AND_ASSIGN(HostPairingScreen);
58};
59
60}  // namespace chromeos
61
62#endif  // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HOST_PAIRING_SCREEN_H_
63