| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_ERROR_MODEL_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_ERROR_MODEL_H_ | |
| 7 | |
| 8 #include "base/callback_list.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "chrome/browser/chromeos/login/oobe_screen.h" | |
| 11 #include "chrome/browser/chromeos/login/screens/base_screen.h" | |
| 12 #include "chrome/browser/chromeos/login/screens/network_error.h" | |
| 13 | |
| 14 namespace chromeos { | |
| 15 | |
| 16 class BaseScreenDelegate; | |
| 17 class NetworkErrorView; | |
| 18 | |
| 19 class NetworkErrorModel : public BaseScreen { | |
| 20 public: | |
| 21 static const char kContextKeyErrorStateCode[]; | |
| 22 static const char kContextKeyErrorStateNetwork[]; | |
| 23 static const char kContextKeyGuestSigninAllowed[]; | |
| 24 static const char kContextKeyOfflineSigninAllowed[]; | |
| 25 static const char kContextKeyShowConnectingIndicator[]; | |
| 26 static const char kContextKeyUIState[]; | |
| 27 static const char kUserActionConfigureCertsButtonClicked[]; | |
| 28 static const char kUserActionDiagnoseButtonClicked[]; | |
| 29 static const char kUserActionLaunchOobeGuestSessionClicked[]; | |
| 30 static const char kUserActionLocalStateErrorPowerwashButtonClicked[]; | |
| 31 static const char kUserActionRebootButtonClicked[]; | |
| 32 static const char kUserActionShowCaptivePortalClicked[]; | |
| 33 static const char kUserActionConnectRequested[]; | |
| 34 | |
| 35 explicit NetworkErrorModel(BaseScreenDelegate* base_screen_delegate); | |
| 36 ~NetworkErrorModel() override; | |
| 37 | |
| 38 // Toggles the guest sign-in prompt. | |
| 39 virtual void AllowGuestSignin(bool allowed) = 0; | |
| 40 | |
| 41 // Toggles the offline sign-in. | |
| 42 virtual void AllowOfflineLogin(bool allowed) = 0; | |
| 43 | |
| 44 // Initializes captive portal dialog and shows that if needed. | |
| 45 virtual void FixCaptivePortal() = 0; | |
| 46 | |
| 47 virtual NetworkError::UIState GetUIState() const = 0; | |
| 48 virtual NetworkError::ErrorState GetErrorState() const = 0; | |
| 49 | |
| 50 // Returns id of the screen behind error screen ("caller" screen). | |
| 51 // Returns OobeScreen::SCREEN_UNKNOWN if error screen isn't the current | |
| 52 // screen. | |
| 53 virtual OobeScreen GetParentScreen() const = 0; | |
| 54 | |
| 55 // Called when we're asked to hide captive portal dialog. | |
| 56 virtual void HideCaptivePortal() = 0; | |
| 57 | |
| 58 // This method is called, when view is being destroyed. Note, if model | |
| 59 // is destroyed earlier then it has to call Unbind(). | |
| 60 virtual void OnViewDestroyed(NetworkErrorView* view) = 0; | |
| 61 | |
| 62 // Sets current UI state. | |
| 63 virtual void SetUIState(NetworkError::UIState ui_state) = 0; | |
| 64 | |
| 65 // Sets current error screen content according to current UI state, | |
| 66 // |error_state|, and |network|. | |
| 67 virtual void SetErrorState(NetworkError::ErrorState error_state, | |
| 68 const std::string& network) = 0; | |
| 69 | |
| 70 // Sets "parent screen" i.e. one that has initiated this network error screen | |
| 71 // instance. | |
| 72 virtual void SetParentScreen(OobeScreen parent_screen) = 0; | |
| 73 | |
| 74 // Sets callback that is called on hide. | |
| 75 virtual void SetHideCallback(const base::Closure& on_hide) = 0; | |
| 76 | |
| 77 // Shows captive portal dialog. | |
| 78 virtual void ShowCaptivePortal() = 0; | |
| 79 | |
| 80 // Toggles the connection pending indicator. | |
| 81 virtual void ShowConnectingIndicator(bool show) = 0; | |
| 82 }; | |
| 83 | |
| 84 } // namespace chromeos | |
| 85 | |
| 86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_ERROR_MODEL_H_ | |
| OLD | NEW |