OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h" | 14 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h" |
15 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 15 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" |
16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
17 #include "components/policy/core/common/cloud/enterprise_metrics.h" | 17 #include "components/policy/core/common/cloud/enterprise_metrics.h" |
18 | 18 |
19 namespace pairing_chromeos { | |
20 class ControllerPairingController; | |
21 } | |
22 | |
19 namespace chromeos { | 23 namespace chromeos { |
20 | 24 |
21 class ScreenObserver; | 25 class ScreenObserver; |
22 | 26 |
23 // The screen implementation that links the enterprise enrollment UI into the | 27 // The screen implementation that links the enterprise enrollment UI into the |
24 // OOBE wizard. | 28 // OOBE wizard. |
25 class EnrollmentScreen | 29 class EnrollmentScreen |
26 : public WizardScreen, | 30 : public WizardScreen, |
27 public EnrollmentScreenActor::Controller { | 31 public EnrollmentScreenActor::Controller { |
28 public: | 32 public: |
29 EnrollmentScreen(ScreenObserver* observer, | 33 EnrollmentScreen(ScreenObserver* observer, |
30 EnrollmentScreenActor* actor); | 34 EnrollmentScreenActor* actor); |
31 virtual ~EnrollmentScreen(); | 35 virtual ~EnrollmentScreen(); |
32 | 36 |
33 void SetParameters(EnrollmentScreenActor::EnrollmentMode enrollment_mode, | 37 void SetParameters( |
34 const std::string& management_domain, | 38 EnrollmentScreenActor::EnrollmentMode enrollment_mode, |
35 const std::string& enrollment_user, | 39 const std::string& management_domain, |
36 const std::string& auth_token); | 40 const std::string& enrollment_user, |
41 const std::string& auth_token, | |
achuithb
2014/09/05 00:26:23
Maybe we should just pass in a callback instead:
b
Zachary Kuznia
2014/09/09 00:51:53
auth_token_ and the controller are actually mutual
| |
42 pairing_chromeos::ControllerPairingController* remora_controller); | |
37 | 43 |
38 // WizardScreen implementation: | 44 // WizardScreen implementation: |
39 virtual void PrepareToShow() OVERRIDE; | 45 virtual void PrepareToShow() OVERRIDE; |
40 virtual void Show() OVERRIDE; | 46 virtual void Show() OVERRIDE; |
41 virtual void Hide() OVERRIDE; | 47 virtual void Hide() OVERRIDE; |
42 virtual std::string GetName() const OVERRIDE; | 48 virtual std::string GetName() const OVERRIDE; |
43 | 49 |
44 // EnrollmentScreenActor::Controller implementation: | 50 // EnrollmentScreenActor::Controller implementation: |
45 virtual void OnLoginDone(const std::string& user) OVERRIDE; | 51 virtual void OnLoginDone(const std::string& user) OVERRIDE; |
46 virtual void OnAuthError(const GoogleServiceAuthError& error) OVERRIDE; | 52 virtual void OnAuthError(const GoogleServiceAuthError& error) OVERRIDE; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 void ShowSigninScreen(); | 94 void ShowSigninScreen(); |
89 | 95 |
90 // Convenience helper to check for auto enrollment mode. | 96 // Convenience helper to check for auto enrollment mode. |
91 bool is_auto_enrollment() const { | 97 bool is_auto_enrollment() const { |
92 return enrollment_mode_ == EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; | 98 return enrollment_mode_ == EnrollmentScreenActor::ENROLLMENT_MODE_AUTO; |
93 } | 99 } |
94 | 100 |
95 EnrollmentScreenActor* actor_; | 101 EnrollmentScreenActor* actor_; |
96 EnrollmentScreenActor::EnrollmentMode enrollment_mode_; | 102 EnrollmentScreenActor::EnrollmentMode enrollment_mode_; |
97 bool enrollment_failed_once_; | 103 bool enrollment_failed_once_; |
104 pairing_chromeos::ControllerPairingController* remora_controller_; | |
achuithb
2014/09/05 00:26:23
Maybe move this up next to actor_?
Zachary Kuznia
2014/09/09 00:51:53
Done.
| |
98 bool remora_token_sent_; | 105 bool remora_token_sent_; |
99 std::string user_; | 106 std::string user_; |
100 std::string auth_token_; | 107 std::string auth_token_; |
101 int lockbox_init_duration_; | 108 int lockbox_init_duration_; |
102 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; | 109 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; |
103 | 110 |
104 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); | 111 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); |
105 }; | 112 }; |
106 | 113 |
107 } // namespace chromeos | 114 } // namespace chromeos |
108 | 115 |
109 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 116 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
OLD | NEW |