Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h

Issue 2642823011: cros: Fold NetworkErrorModel into NetworkErrorView. (Closed)
Patch Set: Address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_actor.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/network_error_model.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 EnrollmentScreenActor,
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 NetworkErrorModel* network_error_model); 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 EnrollmentScreenActor:
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;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 actor.
123 Controller* controller_; 123 Controller* controller_ = nullptr;
124 124
125 bool show_on_init_; 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_; 131 bool first_show_ = true;
132 132
133 // Whether we should handle network errors on enrollment screen. 133 // Whether we should handle network errors on enrollment screen.
134 // True when signin screen step is shown. 134 // True when signin screen step is shown.
135 bool observe_network_failure_; 135 bool observe_network_failure_ = false;
136 136
137 // Network state informer used to keep signin screen up. 137 // Network state informer used to keep signin screen up.
138 scoped_refptr<NetworkStateInformer> network_state_informer_; 138 scoped_refptr<NetworkStateInformer> network_state_informer_;
139 139
140 NetworkErrorModel* network_error_model_; 140 ErrorScreen* error_screen_ = nullptr;
141 141
142 std::unique_ptr<ErrorScreensHistogramHelper> histogram_helper_; 142 std::unique_ptr<ErrorScreensHistogramHelper> histogram_helper_;
143 143
144 // Help application used for help dialogs. 144 // Help application used for help dialogs.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698