Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / screens / error_screen_actor.cc
blob5805f918c78b6aa6b8248201caa544f758eb8b23
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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h"
7 namespace chromeos {
9 namespace {
11 const char kErrorReasonProxyAuthCancelled[] = "proxy auth cancelled";
12 const char kErrorReasonProxyAuthSupplied[] = "proxy auth supplied";
13 const char kErrorReasonProxyConnectionFailed[] = "proxy connection failed";
14 const char kErrorReasonProxyConfigChanged[] = "proxy config changed";
15 const char kErrorReasonLoadingTimeout[] = "loading timeout";
16 const char kErrorReasonPortalDetected[] = "portal detected";
17 const char kErrorReasonNetworkStateChanged[] = "network state changed";
18 const char kErrorReasonUpdate[] = "update";
19 const char kErrorReasonFrameError[] = "frame error";
21 } // namespace
23 ErrorScreenActor::ErrorScreenActor()
24 : ui_state_(ErrorScreen::UI_STATE_UNKNOWN),
25 error_state_(ErrorScreen::ERROR_STATE_UNKNOWN),
26 guest_signin_allowed_(false),
27 offline_login_allowed_(false),
28 parent_screen_(OobeUI::SCREEN_UNKNOWN) {}
30 ErrorScreenActor::~ErrorScreenActor() {}
32 // static
33 const char* ErrorScreenActor::ErrorReasonString(ErrorReason reason) {
34 switch (reason) {
35 case ErrorScreenActor::ERROR_REASON_PROXY_AUTH_CANCELLED:
36 return kErrorReasonProxyAuthCancelled;
37 case ErrorScreenActor::ERROR_REASON_PROXY_AUTH_SUPPLIED:
38 return kErrorReasonProxyAuthSupplied;
39 case ErrorScreenActor::ERROR_REASON_PROXY_CONNECTION_FAILED:
40 return kErrorReasonProxyConnectionFailed;
41 case ErrorScreenActor::ERROR_REASON_PROXY_CONFIG_CHANGED:
42 return kErrorReasonProxyConfigChanged;
43 case ErrorScreenActor::ERROR_REASON_LOADING_TIMEOUT:
44 return kErrorReasonLoadingTimeout;
45 case ErrorScreenActor::ERROR_REASON_PORTAL_DETECTED:
46 return kErrorReasonPortalDetected;
47 case ErrorScreenActor::ERROR_REASON_NETWORK_STATE_CHANGED:
48 return kErrorReasonNetworkStateChanged;
49 case ErrorScreenActor::ERROR_REASON_UPDATE:
50 return kErrorReasonUpdate;
51 case ErrorScreenActor::ERROR_REASON_FRAME_ERROR:
52 return kErrorReasonFrameError;
53 default:
54 NOTREACHED();
55 return NULL;
59 } // namespace chromeos