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_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_ACTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_ACTOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_ACTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_ACTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chrome/browser/chromeos/login/screens/error_screen.h" | |
12 #include "chrome/browser/chromeos/login/screens/error_screen_actor_delegate.h" | 11 #include "chrome/browser/chromeos/login/screens/error_screen_actor_delegate.h" |
| 12 #include "chrome/browser/chromeos/login/screens/network_error.h" |
13 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 13 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 } | 17 } |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 class ErrorScreenActor { | 21 class ErrorScreenActor { |
22 public: | 22 public: |
23 // Possible network error reasons. | |
24 enum ErrorReason { | |
25 ERROR_REASON_PROXY_AUTH_CANCELLED = 0, | |
26 ERROR_REASON_PROXY_AUTH_SUPPLIED, | |
27 ERROR_REASON_PROXY_CONNECTION_FAILED, | |
28 ERROR_REASON_PROXY_CONFIG_CHANGED, | |
29 ERROR_REASON_LOADING_TIMEOUT, | |
30 ERROR_REASON_PORTAL_DETECTED, | |
31 // Reason for a case when default network has changed. | |
32 ERROR_REASON_NETWORK_STATE_CHANGED, | |
33 // Reason for a case when JS side requires error screen update. | |
34 ERROR_REASON_UPDATE, | |
35 ERROR_REASON_FRAME_ERROR | |
36 }; | |
37 | |
38 ErrorScreenActor(); | 23 ErrorScreenActor(); |
39 virtual ~ErrorScreenActor(); | 24 virtual ~ErrorScreenActor(); |
40 | 25 |
41 ErrorScreen::UIState ui_state() const { return ui_state_; } | 26 NetworkError::UIState ui_state() const { return ui_state_; } |
42 ErrorScreen::ErrorState error_state() const { return error_state_; } | 27 NetworkError::ErrorState error_state() const { return error_state_; } |
43 | 28 |
44 // Returns id of the screen behind error screen ("caller" screen). | 29 // Returns id of the screen behind error screen ("caller" screen). |
45 // Returns OobeUI::SCREEN_UNKNOWN if error screen isn't the current | 30 // Returns OobeUI::SCREEN_UNKNOWN if error screen isn't the current |
46 // screen. | 31 // screen. |
47 OobeUI::Screen parent_screen() const { return parent_screen_; } | 32 OobeUI::Screen parent_screen() const { return parent_screen_; } |
48 | 33 |
49 // Sets screen this actor belongs to. | 34 // Sets screen this actor belongs to. |
50 virtual void SetDelegate(ErrorScreenActorDelegate* delegate) = 0; | 35 virtual void SetDelegate(ErrorScreenActorDelegate* delegate) = 0; |
51 | 36 |
52 // Shows the screen. | 37 // Shows the screen. |
(...skipping 10 matching lines...) Expand all Loading... |
63 | 48 |
64 // Initializes captive portal dialog and shows that if needed. | 49 // Initializes captive portal dialog and shows that if needed. |
65 virtual void FixCaptivePortal() = 0; | 50 virtual void FixCaptivePortal() = 0; |
66 | 51 |
67 // Shows captive portal dialog. | 52 // Shows captive portal dialog. |
68 virtual void ShowCaptivePortal() = 0; | 53 virtual void ShowCaptivePortal() = 0; |
69 | 54 |
70 // Hides captive portal dialog. | 55 // Hides captive portal dialog. |
71 virtual void HideCaptivePortal() = 0; | 56 virtual void HideCaptivePortal() = 0; |
72 | 57 |
73 virtual void SetUIState(ErrorScreen::UIState ui_state) = 0; | 58 virtual void SetUIState(NetworkError::UIState ui_state) = 0; |
74 virtual void SetErrorState(ErrorScreen::ErrorState error_state, | 59 virtual void SetErrorState(NetworkError::ErrorState error_state, |
75 const std::string& network) = 0; | 60 const std::string& network) = 0; |
76 | 61 |
77 virtual void AllowGuestSignin(bool allowed) = 0; | 62 virtual void AllowGuestSignin(bool allowed) = 0; |
78 virtual void AllowOfflineLogin(bool allowed) = 0; | 63 virtual void AllowOfflineLogin(bool allowed) = 0; |
79 | 64 |
80 virtual void ShowConnectingIndicator(bool show) = 0; | 65 virtual void ShowConnectingIndicator(bool show) = 0; |
81 | 66 |
82 static const char* ErrorReasonString(ErrorReason reason); | |
83 | |
84 protected: | 67 protected: |
85 ErrorScreen::UIState ui_state_; | 68 NetworkError::UIState ui_state_; |
86 ErrorScreen::ErrorState error_state_; | 69 NetworkError::ErrorState error_state_; |
87 std::string network_; | 70 std::string network_; |
88 | 71 |
89 bool guest_signin_allowed_; | 72 bool guest_signin_allowed_; |
90 bool offline_login_allowed_; | 73 bool offline_login_allowed_; |
91 bool show_connecting_indicator_; | 74 bool show_connecting_indicator_; |
92 | 75 |
93 OobeUI::Screen parent_screen_; | 76 OobeUI::Screen parent_screen_; |
94 | 77 |
95 DISALLOW_COPY_AND_ASSIGN(ErrorScreenActor); | 78 DISALLOW_COPY_AND_ASSIGN(ErrorScreenActor); |
96 }; | 79 }; |
97 | 80 |
98 } // namespace chromeos | 81 } // namespace chromeos |
99 | 82 |
100 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_ACTOR_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_ERROR_SCREEN_ACTOR_H_ |
OLD | NEW |