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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_
8 #include "base/macros.h"
10 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor.h"
11 #include "chrome/browser/chromeos/login/screens/screen_context.h"
12 #include "chrome/browser/chromeos/login/screens/wizard_screen.h"
13 #include "components/pairing/controller_pairing_controller.h"
17 class ControllerPairingScreen :
19 public pairing_chromeos::ControllerPairingController::Observer,
20 public ControllerPairingScreenActor::Delegate {
22 ControllerPairingScreen(
23 ScreenObserver* observer,
24 ControllerPairingScreenActor* actor,
25 pairing_chromeos::ControllerPairingController* controller);
26 virtual ~ControllerPairingScreen();
29 typedef pairing_chromeos::ControllerPairingController::Stage Stage;
31 void CommitContextChanges();
32 bool ExpectStageIs(Stage stage) const;
34 // Overridden from WizardScreen:
35 virtual void PrepareToShow() OVERRIDE;
36 virtual void Show() OVERRIDE;
37 virtual void Hide() OVERRIDE;
38 virtual std::string GetName() const OVERRIDE;
40 // Overridden from pairing_chromeos::ControllerPairingController::Observer:
41 virtual void PairingStageChanged(Stage new_stage) OVERRIDE;
42 virtual void DiscoveredDevicesListChanged() OVERRIDE;
44 // Overridden from ControllerPairingView::Delegate:
45 virtual void OnActorDestroyed(ControllerPairingScreenActor* actor) OVERRIDE;
46 virtual void OnScreenContextChanged(
47 const base::DictionaryValue& diff) OVERRIDE;
48 virtual void OnUserActed(const std::string& action) OVERRIDE;
50 // Context for sharing data between C++ and JS.
51 // TODO(dzhioev): move to BaseScreen when possible.
52 ScreenContext context_;
54 ControllerPairingScreenActor* actor_;
56 // Controller performing pairing. Owned by the wizard controller.
57 pairing_chromeos::ControllerPairingController* controller_;
59 // Current stage of pairing process.
62 // If this one is |false| first device in device list will be preselected on
63 // next device list update.
64 bool device_preselected_;
66 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen);
69 } // namespace chromeos
71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_