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_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h" | 12 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_view.h" |
13 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.
h" | 13 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.
h" |
14 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 14 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
15 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 15 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
16 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 16 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
17 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 17 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
19 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
20 | 20 |
21 namespace chromeos { | 21 namespace chromeos { |
22 | 22 |
23 class ErrorScreensHistogramHelper; | 23 class ErrorScreensHistogramHelper; |
24 class HelpAppLauncher; | 24 class HelpAppLauncher; |
25 | 25 |
26 // WebUIMessageHandler implementation which handles events occurring on the | 26 // WebUIMessageHandler implementation which handles events occurring on the |
27 // page, such as the user pressing the signin button. | 27 // page, such as the user pressing the signin button. |
28 class EnrollmentScreenHandler | 28 class EnrollmentScreenHandler |
29 : public BaseScreenHandler, | 29 : public BaseScreenHandler, |
30 public EnrollmentScreenActor, | 30 public EnrollmentScreenView, |
31 public NetworkStateInformer::NetworkStateInformerObserver { | 31 public NetworkStateInformer::NetworkStateInformerObserver { |
32 public: | 32 public: |
33 EnrollmentScreenHandler( | 33 EnrollmentScreenHandler( |
34 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 34 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
35 ErrorScreen* error_screen); | 35 ErrorScreen* error_screen); |
36 ~EnrollmentScreenHandler() override; | 36 ~EnrollmentScreenHandler() override; |
37 | 37 |
38 // Implements WebUIMessageHandler: | 38 // Implements WebUIMessageHandler: |
39 void RegisterMessages() override; | 39 void RegisterMessages() override; |
40 | 40 |
41 // Implements EnrollmentScreenActor: | 41 // Implements EnrollmentScreenView: |
42 void SetParameters(Controller* controller, | 42 void SetParameters(Controller* controller, |
43 const policy::EnrollmentConfig& config) override; | 43 const policy::EnrollmentConfig& config) override; |
44 void Show() override; | 44 void Show() override; |
45 void Hide() override; | 45 void Hide() override; |
46 void ShowSigninScreen() override; | 46 void ShowSigninScreen() override; |
47 void ShowAdJoin() override; | 47 void ShowAdJoin() override; |
48 void ShowAttributePromptScreen(const std::string& asset_id, | 48 void ShowAttributePromptScreen(const std::string& asset_id, |
49 const std::string& location) override; | 49 const std::string& location) override; |
50 void ShowAttestationBasedEnrollmentSuccessScreen( | 50 void ShowAttestationBasedEnrollmentSuccessScreen( |
51 const std::string& enterprise_domain) override; | 51 const std::string& enterprise_domain) override; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // Helper function to wait for AD password written to a pipe. | 113 // Helper function to wait for AD password written to a pipe. |
114 void OnPasswordPipeReady(const std::string& machine_name, | 114 void OnPasswordPipeReady(const std::string& machine_name, |
115 const std::string& user_name, | 115 const std::string& user_name, |
116 base::ScopedFD password_fd); | 116 base::ScopedFD password_fd); |
117 // Handler callback from AuthPolicyClient. | 117 // Handler callback from AuthPolicyClient. |
118 void HandleAdDomainJoin(const std::string& machine_name, | 118 void HandleAdDomainJoin(const std::string& machine_name, |
119 const std::string& user_name, | 119 const std::string& user_name, |
120 authpolicy::ErrorType code); | 120 authpolicy::ErrorType code); |
121 | 121 |
122 // Keeps the controller for this actor. | 122 // Keeps the controller for this view. |
123 Controller* controller_ = nullptr; | 123 Controller* controller_ = nullptr; |
124 | 124 |
125 bool show_on_init_ = false; | 125 bool show_on_init_ = false; |
126 | 126 |
127 // The enrollment configuration. | 127 // The enrollment configuration. |
128 policy::EnrollmentConfig config_; | 128 policy::EnrollmentConfig config_; |
129 | 129 |
130 // True if screen was not shown yet. | 130 // True if screen was not shown yet. |
131 bool first_show_ = true; | 131 bool first_show_ = true; |
132 | 132 |
(...skipping 12 matching lines...) Expand all Loading... |
145 scoped_refptr<HelpAppLauncher> help_app_; | 145 scoped_refptr<HelpAppLauncher> help_app_; |
146 | 146 |
147 base::WeakPtrFactory<EnrollmentScreenHandler> weak_ptr_factory_; | 147 base::WeakPtrFactory<EnrollmentScreenHandler> weak_ptr_factory_; |
148 | 148 |
149 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreenHandler); | 149 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreenHandler); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace chromeos | 152 } // namespace chromeos |
153 | 153 |
154 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ | 154 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ |
OLD | NEW |