| 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_ERROR_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public ErrorScreenActor { | 27 public ErrorScreenActor { |
| 28 public: | 28 public: |
| 29 ErrorScreenHandler( | 29 ErrorScreenHandler( |
| 30 const scoped_refptr<NetworkStateInformer>& network_state_informer); | 30 const scoped_refptr<NetworkStateInformer>& network_state_informer); |
| 31 virtual ~ErrorScreenHandler(); | 31 virtual ~ErrorScreenHandler(); |
| 32 | 32 |
| 33 // ErrorScreenActor implementation: | 33 // ErrorScreenActor implementation: |
| 34 virtual void SetDelegate(ErrorScreenActorDelegate* delegate) OVERRIDE; | 34 virtual void SetDelegate(ErrorScreenActorDelegate* delegate) OVERRIDE; |
| 35 virtual void Show(OobeDisplay::Screen parent_screen, | 35 virtual void Show(OobeDisplay::Screen parent_screen, |
| 36 base::DictionaryValue* params) OVERRIDE; | 36 base::DictionaryValue* params) OVERRIDE; |
| 37 virtual void Show(OobeDisplay::Screen parent_screen, |
| 38 base::DictionaryValue* params, |
| 39 const base::Closure& hide_closure) OVERRIDE; |
| 37 virtual void Hide() OVERRIDE; | 40 virtual void Hide() OVERRIDE; |
| 38 virtual void FixCaptivePortal() OVERRIDE; | 41 virtual void FixCaptivePortal() OVERRIDE; |
| 39 virtual void ShowCaptivePortal() OVERRIDE; | 42 virtual void ShowCaptivePortal() OVERRIDE; |
| 40 virtual void HideCaptivePortal() OVERRIDE; | 43 virtual void HideCaptivePortal() OVERRIDE; |
| 41 virtual void SetUIState(ErrorScreen::UIState ui_state) OVERRIDE; | 44 virtual void SetUIState(ErrorScreen::UIState ui_state) OVERRIDE; |
| 42 virtual void SetErrorState(ErrorScreen::ErrorState error_state, | 45 virtual void SetErrorState(ErrorScreen::ErrorState error_state, |
| 43 const std::string& network) OVERRIDE; | 46 const std::string& network) OVERRIDE; |
| 44 virtual void AllowGuestSignin(bool allowed) OVERRIDE; | 47 virtual void AllowGuestSignin(bool allowed) OVERRIDE; |
| 45 virtual void AllowOfflineLogin(bool allowed) OVERRIDE; | 48 virtual void AllowOfflineLogin(bool allowed) OVERRIDE; |
| 46 virtual void ShowConnectingIndicator(bool show) OVERRIDE; | 49 virtual void ShowConnectingIndicator(bool show) OVERRIDE; |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 // Sends notification that error message is shown. | 52 // Sends notification that error message is shown. |
| 50 void NetworkErrorShown(); | 53 void NetworkErrorShown(); |
| 51 | 54 |
| 52 bool GetScreenName(OobeUI::Screen screen, std::string* name) const; | 55 bool GetScreenName(OobeUI::Screen screen, std::string* name) const; |
| 53 | 56 |
| 57 // Default hide_closure for Show/Hide. |
| 58 void CheckAndShowScreen(); |
| 59 |
| 54 // WebUI message handlers. | 60 // WebUI message handlers. |
| 55 void HandleShowCaptivePortal(); | 61 void HandleShowCaptivePortal(); |
| 56 void HandleHideCaptivePortal(); | 62 void HandleHideCaptivePortal(); |
| 57 void HandleLocalStateErrorPowerwashButtonClicked(); | 63 void HandleLocalStateErrorPowerwashButtonClicked(); |
| 58 void HandleRebootButtonClicked(); | 64 void HandleRebootButtonClicked(); |
| 59 void HandleDiagnoseButtonClicked(); | 65 void HandleDiagnoseButtonClicked(); |
| 60 void HandleConfigureCerts(); | 66 void HandleConfigureCerts(); |
| 61 void HandleLaunchOobeGuestSession(); | 67 void HandleLaunchOobeGuestSession(); |
| 62 | 68 |
| 63 // WebUIMessageHandler implementation: | 69 // WebUIMessageHandler implementation: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 75 | 81 |
| 76 // Network state informer used to keep error screen up. | 82 // Network state informer used to keep error screen up. |
| 77 scoped_refptr<NetworkStateInformer> network_state_informer_; | 83 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 78 | 84 |
| 79 // NativeWindowDelegate used to get reference to NativeWindow. | 85 // NativeWindowDelegate used to get reference to NativeWindow. |
| 80 NativeWindowDelegate* native_window_delegate_; | 86 NativeWindowDelegate* native_window_delegate_; |
| 81 | 87 |
| 82 // Keeps whether screen should be shown right after initialization. | 88 // Keeps whether screen should be shown right after initialization. |
| 83 bool show_on_init_; | 89 bool show_on_init_; |
| 84 | 90 |
| 91 scoped_ptr<base::Closure> hide_closure_; |
| 92 |
| 85 DISALLOW_COPY_AND_ASSIGN(ErrorScreenHandler); | 93 DISALLOW_COPY_AND_ASSIGN(ErrorScreenHandler); |
| 86 }; | 94 }; |
| 87 | 95 |
| 88 } // namespace chromeos | 96 } // namespace chromeos |
| 89 | 97 |
| 90 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_ | 98 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_ |
| OLD | NEW |