OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "remoting/host/host_exit_codes.h" | 5 #include "remoting/host/host_exit_codes.h" |
6 | 6 |
7 #include "remoting/protocol/name_value_map.h" | 7 #include "remoting/base/name_value_map.h" |
8 | |
9 using remoting::protocol::NameMapElement; | |
10 | 8 |
11 namespace remoting { | 9 namespace remoting { |
12 | 10 |
13 const NameMapElement<HostExitCodes> kHostExitCodeStrings[] = { | 11 const NameMapElement<HostExitCodes> kHostExitCodeStrings[] = { |
14 { kSuccessExitCode, "SUCCESS_EXIT" }, | 12 { kSuccessExitCode, "SUCCESS_EXIT" }, |
15 { kInitializationFailed, "INITIALIZATION_FAILED" }, | 13 { kInitializationFailed, "INITIALIZATION_FAILED" }, |
16 { kInvalidCommandLineExitCode, "INVALID_COMMAND_LINE" }, | 14 { kInvalidCommandLineExitCode, "INVALID_COMMAND_LINE" }, |
17 { kInvalidHostConfigurationExitCode, "INVALID_HOST_CONFIGURATION" }, | 15 { kInvalidHostConfigurationExitCode, "INVALID_HOST_CONFIGURATION" }, |
18 { kInvalidHostIdExitCode, "INVALID_HOST_ID" }, | 16 { kInvalidHostIdExitCode, "INVALID_HOST_ID" }, |
19 { kInvalidOauthCredentialsExitCode, "INVALID_OAUTH_CREDENTIALS" }, | 17 { kInvalidOauthCredentialsExitCode, "INVALID_OAUTH_CREDENTIALS" }, |
20 { kInvalidHostDomainExitCode, "INVALID_HOST_DOMAIN" }, | 18 { kInvalidHostDomainExitCode, "INVALID_HOST_DOMAIN" }, |
21 { kLoginScreenNotSupportedExitCode, "LOGIN_SCREEN_NOT_SUPPORTED" }, | 19 { kLoginScreenNotSupportedExitCode, "LOGIN_SCREEN_NOT_SUPPORTED" }, |
22 { kUsernameMismatchExitCode, "USERNAME_MISMATCH" }, | 20 { kUsernameMismatchExitCode, "USERNAME_MISMATCH" }, |
23 }; | 21 }; |
24 | 22 |
25 const char* ExitCodeToString(HostExitCodes exit_code) { | 23 const char* ExitCodeToString(HostExitCodes exit_code) { |
26 return ValueToName(kHostExitCodeStrings, exit_code); | 24 return ValueToName(kHostExitCodeStrings, exit_code); |
27 } | 25 } |
28 | 26 |
29 } // namespace remoting | 27 } // namespace remoting |
OLD | NEW |