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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Implements WebUIMessageHandler: | 40 // Implements WebUIMessageHandler: |
41 void RegisterMessages() override; | 41 void RegisterMessages() override; |
42 | 42 |
43 // Implements EnrollmentScreenActor: | 43 // Implements EnrollmentScreenActor: |
44 void SetParameters(Controller* controller, | 44 void SetParameters(Controller* controller, |
45 const policy::EnrollmentConfig& config) override; | 45 const policy::EnrollmentConfig& config) override; |
46 void PrepareToShow() override; | 46 void PrepareToShow() override; |
47 void Show() override; | 47 void Show() override; |
48 void Hide() override; | 48 void Hide() override; |
49 void ShowSigninScreen() override; | 49 void ShowSigninScreen() override; |
| 50 void ShowDeviceNamingScreen() override; |
50 void ShowEnrollmentSpinnerScreen() override; | 51 void ShowEnrollmentSpinnerScreen() override; |
51 void ShowAuthError(const GoogleServiceAuthError& error) override; | 52 void ShowAuthError(const GoogleServiceAuthError& error) override; |
52 void ShowEnrollmentStatus(policy::EnrollmentStatus status) override; | 53 void ShowEnrollmentStatus(policy::EnrollmentStatus status) override; |
53 void ShowOtherError( | 54 void ShowOtherError( |
54 EnterpriseEnrollmentHelper::OtherError error_code) override; | 55 EnterpriseEnrollmentHelper::OtherError error_code) override; |
55 | 56 |
56 // Implements BaseScreenHandler: | 57 // Implements BaseScreenHandler: |
57 void Initialize() override; | 58 void Initialize() override; |
58 void DeclareLocalizedValues( | 59 void DeclareLocalizedValues( |
59 ::login::LocalizedValuesBuilder* builder) override; | 60 ::login::LocalizedValuesBuilder* builder) override; |
60 | 61 |
61 // Implements NetworkStateInformer::NetworkStateInformerObserver | 62 // Implements NetworkStateInformer::NetworkStateInformerObserver |
62 void UpdateState(NetworkError::ErrorReason reason) override; | 63 void UpdateState(NetworkError::ErrorReason reason) override; |
63 | 64 |
64 // Implements WebUILoginView::FrameObserver | 65 // Implements WebUILoginView::FrameObserver |
65 void OnFrameError(const std::string& frame_unique_name) override; | 66 void OnFrameError(const std::string& frame_unique_name) override; |
66 | 67 |
67 private: | 68 private: |
68 // Handlers for WebUI messages. | 69 // Handlers for WebUI messages. |
69 void HandleClose(const std::string& reason); | 70 void HandleClose(const std::string& reason); |
70 void HandleCompleteLogin(const std::string& user); | 71 void HandleCompleteLogin(const std::string& user); |
71 void HandleRetry(); | 72 void HandleRetry(); |
72 void HandleFrameLoadingCompleted(int status); | 73 void HandleFrameLoadingCompleted(int status); |
| 74 void HandleDeviceNaming(const std::string& asset_id, |
| 75 const std::string& location); |
73 | 76 |
74 void UpdateStateInternal(NetworkError::ErrorReason reason, bool force_update); | 77 void UpdateStateInternal(NetworkError::ErrorReason reason, bool force_update); |
75 void SetupAndShowOfflineMessage(NetworkStateInformer::State state, | 78 void SetupAndShowOfflineMessage(NetworkStateInformer::State state, |
76 NetworkError::ErrorReason reason); | 79 NetworkError::ErrorReason reason); |
77 void HideOfflineMessage(NetworkStateInformer::State state, | 80 void HideOfflineMessage(NetworkStateInformer::State state, |
78 NetworkError::ErrorReason reason); | 81 NetworkError::ErrorReason reason); |
79 | 82 |
80 net::Error frame_error() const { return frame_error_; } | 83 net::Error frame_error() const { return frame_error_; } |
81 // Shows a given enrollment step. | 84 // Shows a given enrollment step. |
82 void ShowStep(const char* step); | 85 void ShowStep(const char* step); |
83 | 86 |
84 // Display the given i18n resource as error message. | 87 // Display the given i18n resource as error message. |
85 void ShowError(int message_id, bool retry); | 88 void ShowError(int message_id, bool retry); |
86 | 89 |
87 // Display the given string as error message. | 90 // Display the given string as error message. |
88 void ShowErrorMessage(const std::string& message, bool retry); | 91 void ShowErrorMessage(const std::string& message, bool retry); |
89 | 92 |
90 // Display the given i18n string as a progress message. | 93 // Display the given i18n string as a progress message. |
91 void ShowWorking(int message_id); | 94 void ShowWorking(int message_id); |
92 | 95 |
| 96 // Pass existing asset id and location values to device naming screen. |
| 97 void OnBeforeShowNaming(const base::DictionaryValue& data); |
| 98 |
93 // Shows the screen. | 99 // Shows the screen. |
94 void DoShow(); | 100 void DoShow(); |
95 | 101 |
96 // Returns current visible screen. | 102 // Returns current visible screen. |
97 OobeUI::Screen GetCurrentScreen() const; | 103 OobeUI::Screen GetCurrentScreen() const; |
98 | 104 |
99 // Returns true if current visible screen is the enrollment sign-in page. | 105 // Returns true if current visible screen is the enrollment sign-in page. |
100 bool IsOnEnrollmentScreen() const; | 106 bool IsOnEnrollmentScreen() const; |
101 | 107 |
102 // Returns true if current visible screen is the error screen over | 108 // Returns true if current visible screen is the error screen over |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; | 141 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; |
136 | 142 |
137 base::WeakPtrFactory<EnrollmentScreenHandler> weak_ptr_factory_; | 143 base::WeakPtrFactory<EnrollmentScreenHandler> weak_ptr_factory_; |
138 | 144 |
139 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreenHandler); | 145 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreenHandler); |
140 }; | 146 }; |
141 | 147 |
142 } // namespace chromeos | 148 } // namespace chromeos |
143 | 149 |
144 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ | 150 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ |
OLD | NEW |