| 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 const std::string& auth_code); | 72 const std::string& auth_code); |
| 72 void HandleRetry(); | 73 void HandleRetry(); |
| 73 void HandleFrameLoadingCompleted(int status); | 74 void HandleFrameLoadingCompleted(int status); |
| 75 void HandleDeviceNaming(const std::string& asset_id, |
| 76 const std::string& location); |
| 74 | 77 |
| 75 void UpdateStateInternal(NetworkError::ErrorReason reason, bool force_update); | 78 void UpdateStateInternal(NetworkError::ErrorReason reason, bool force_update); |
| 76 void SetupAndShowOfflineMessage(NetworkStateInformer::State state, | 79 void SetupAndShowOfflineMessage(NetworkStateInformer::State state, |
| 77 NetworkError::ErrorReason reason); | 80 NetworkError::ErrorReason reason); |
| 78 void HideOfflineMessage(NetworkStateInformer::State state, | 81 void HideOfflineMessage(NetworkStateInformer::State state, |
| 79 NetworkError::ErrorReason reason); | 82 NetworkError::ErrorReason reason); |
| 80 | 83 |
| 81 net::Error frame_error() const { return frame_error_; } | 84 net::Error frame_error() const { return frame_error_; } |
| 82 // Shows a given enrollment step. | 85 // Shows a given enrollment step. |
| 83 void ShowStep(const char* step); | 86 void ShowStep(const char* step); |
| 84 | 87 |
| 85 // Display the given i18n resource as error message. | 88 // Display the given i18n resource as error message. |
| 86 void ShowError(int message_id, bool retry); | 89 void ShowError(int message_id, bool retry); |
| 87 | 90 |
| 88 // Display the given string as error message. | 91 // Display the given string as error message. |
| 89 void ShowErrorMessage(const std::string& message, bool retry); | 92 void ShowErrorMessage(const std::string& message, bool retry); |
| 90 | 93 |
| 91 // Display the given i18n string as a progress message. | 94 // Display the given i18n string as a progress message. |
| 92 void ShowWorking(int message_id); | 95 void ShowWorking(int message_id); |
| 93 | 96 |
| 97 // Pass existing asset id and location values to device naming screen. |
| 98 void OnBeforeShowNaming(const base::DictionaryValue& data); |
| 99 |
| 94 // Shows the screen. | 100 // Shows the screen. |
| 95 void DoShow(); | 101 void DoShow(); |
| 96 | 102 |
| 97 // Returns current visible screen. | 103 // Returns current visible screen. |
| 98 OobeUI::Screen GetCurrentScreen() const; | 104 OobeUI::Screen GetCurrentScreen() const; |
| 99 | 105 |
| 100 // Returns true if current visible screen is the enrollment sign-in page. | 106 // Returns true if current visible screen is the enrollment sign-in page. |
| 101 bool IsOnEnrollmentScreen() const; | 107 bool IsOnEnrollmentScreen() const; |
| 102 | 108 |
| 103 // Returns true if current visible screen is the error screen over | 109 // Returns true if current visible screen is the error screen over |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; | 142 scoped_ptr<ScopedGaiaAuthExtension> auth_extension_; |
| 137 | 143 |
| 138 base::WeakPtrFactory<EnrollmentScreenHandler> weak_ptr_factory_; | 144 base::WeakPtrFactory<EnrollmentScreenHandler> weak_ptr_factory_; |
| 139 | 145 |
| 140 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreenHandler); | 146 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreenHandler); |
| 141 }; | 147 }; |
| 142 | 148 |
| 143 } // namespace chromeos | 149 } // namespace chromeos |
| 144 | 150 |
| 145 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ | 151 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENROLLMENT_SCREEN_HANDLER_H_ |
| OLD | NEW |