OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
10 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor. h" | 10 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor. h" |
11 #include "chrome/browser/chromeos/login/screens/screen_context.h" | 11 #include "chrome/browser/chromeos/login/screens/screen_context.h" |
12 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 12 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" |
13 #include "components/pairing/controller_pairing_controller.h" | 13 #include "components/pairing/controller_pairing_controller.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 class ControllerPairingScreen : | 17 class ControllerPairingScreen : |
18 public WizardScreen, | 18 public WizardScreen, |
19 public pairing_chromeos::ControllerPairingController::Observer, | 19 public pairing_chromeos::ControllerPairingController::Observer, |
20 public ControllerPairingScreenActor::Delegate { | 20 public ControllerPairingScreenActor::Delegate { |
21 public: | 21 public: |
22 ControllerPairingScreen(ScreenObserver* observer, | 22 ControllerPairingScreen( |
23 ControllerPairingScreenActor* actor); | 23 ScreenObserver* observer, |
24 ControllerPairingScreenActor* actor, | |
25 pairing_chromeos::ControllerPairingController* controller); | |
24 virtual ~ControllerPairingScreen(); | 26 virtual ~ControllerPairingScreen(); |
25 | 27 |
26 private: | 28 private: |
27 typedef pairing_chromeos::ControllerPairingController::Stage Stage; | 29 typedef pairing_chromeos::ControllerPairingController::Stage Stage; |
28 | 30 |
29 void CommitContextChanges(); | 31 void CommitContextChanges(); |
30 bool ExpectStageIs(Stage stage) const; | 32 bool ExpectStageIs(Stage stage) const; |
31 | 33 |
32 // Overridden from WizardScreen: | 34 // Overridden from WizardScreen: |
33 virtual void PrepareToShow() OVERRIDE; | 35 virtual void PrepareToShow() OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... | |
44 virtual void OnScreenContextChanged( | 46 virtual void OnScreenContextChanged( |
45 const base::DictionaryValue& diff) OVERRIDE; | 47 const base::DictionaryValue& diff) OVERRIDE; |
46 virtual void OnUserActed(const std::string& action) OVERRIDE; | 48 virtual void OnUserActed(const std::string& action) OVERRIDE; |
47 | 49 |
48 // Context for sharing data between C++ and JS. | 50 // Context for sharing data between C++ and JS. |
49 // TODO(dzhioev): move to BaseScreen when possible. | 51 // TODO(dzhioev): move to BaseScreen when possible. |
50 ScreenContext context_; | 52 ScreenContext context_; |
51 | 53 |
52 ControllerPairingScreenActor* actor_; | 54 ControllerPairingScreenActor* actor_; |
53 | 55 |
54 // Controller performing pairing. Owned by the screen for now. | 56 // Controller performing pairing. Owned by the wizard controller. |
55 // TODO(dzhioev): move to proper place later. | 57 pairing_chromeos::ControllerPairingController* controller_; |
achuithb
2014/09/03 22:26:07
Should this be a weak reference?
Zachary Kuznia
2014/09/04 04:21:48
No, for same reason that |actor_| is not a weak po
| |
56 scoped_ptr<pairing_chromeos::ControllerPairingController> controller_; | |
57 | 58 |
58 // Current stage of pairing process. | 59 // Current stage of pairing process. |
59 Stage current_stage_; | 60 Stage current_stage_; |
60 | 61 |
61 // If this one is |false| first device in device list will be preselected on | 62 // If this one is |false| first device in device list will be preselected on |
62 // next device list update. | 63 // next device list update. |
63 bool device_preselected_; | 64 bool device_preselected_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); | 66 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace chromeos | 69 } // namespace chromeos |
69 | 70 |
70 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
OLD | NEW |