OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "chrome/browser/chromeos/login/oobe_screen.h" | 5 #include "chrome/browser/chromeos/login/oobe_screen.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
(...skipping 26 matching lines...) Expand all Loading... |
37 "arc-kiosk-splash", // SCREEN_ARC_KIOSK_SPLASH | 37 "arc-kiosk-splash", // SCREEN_ARC_KIOSK_SPLASH |
38 "confirm-password", // SCREEN_CONFIRM_PASSWORD | 38 "confirm-password", // SCREEN_CONFIRM_PASSWORD |
39 "fatal-error", // SCREEN_FATAL_ERROR | 39 "fatal-error", // SCREEN_FATAL_ERROR |
40 "controller-pairing", // SCREEN_OOBE_CONTROLLER_PAIRING | 40 "controller-pairing", // SCREEN_OOBE_CONTROLLER_PAIRING |
41 "host-pairing", // SCREEN_OOBE_HOST_PAIRING | 41 "host-pairing", // SCREEN_OOBE_HOST_PAIRING |
42 "device-disabled", // SCREEN_DEVICE_DISABLED | 42 "device-disabled", // SCREEN_DEVICE_DISABLED |
43 "unrecoverable-cryptohome-error", // SCREEN_UNRECOVERABLE_CRYPTOHOME_ERROR | 43 "unrecoverable-cryptohome-error", // SCREEN_UNRECOVERABLE_CRYPTOHOME_ERROR |
44 "userBoard", // SCREEN_USER_SELECTION | 44 "userBoard", // SCREEN_USER_SELECTION |
45 // SCREEN_ACTIVE_DIRECTORY_PASSWORD_CHANGE | 45 // SCREEN_ACTIVE_DIRECTORY_PASSWORD_CHANGE |
46 "ad-password-change", | 46 "ad-password-change", |
47 "encryption-migration", // SCREEN_ENCRYPTION_MIGRATION | 47 "encryption-migration", // SCREEN_ENCRYPTION_MIGRATION |
48 "login", // SCREEN_SPECIAL_LOGIN | 48 "voice-interaction-value-prop", // SCREEN_VOICE_INTERACTION_VALUE_PROP |
49 "oobe", // SCREEN_SPECIAL_OOBE | 49 "login", // SCREEN_SPECIAL_LOGIN |
50 "test:nowindow", // SCREEN_TEST_NO_WINDOW | 50 "oobe", // SCREEN_SPECIAL_OOBE |
51 "unknown", // SCREEN_UNKNOWN | 51 "test:nowindow", // SCREEN_TEST_NO_WINDOW |
| 52 "unknown", // SCREEN_UNKNOWN |
52 }; | 53 }; |
53 | 54 |
54 static_assert(static_cast<size_t>(OobeScreen::SCREEN_UNKNOWN) == | 55 static_assert(static_cast<size_t>(OobeScreen::SCREEN_UNKNOWN) == |
55 arraysize(kScreenNames) - 1, | 56 arraysize(kScreenNames) - 1, |
56 "Missing element in OobeScreen or kScreenNames"); | 57 "Missing element in OobeScreen or kScreenNames"); |
57 | 58 |
58 } // namespace | 59 } // namespace |
59 | 60 |
60 std::string GetOobeScreenName(OobeScreen screen) { | 61 std::string GetOobeScreenName(OobeScreen screen) { |
61 DCHECK(screen <= OobeScreen::SCREEN_UNKNOWN); | 62 DCHECK(screen <= OobeScreen::SCREEN_UNKNOWN); |
62 return kScreenNames[static_cast<size_t>(screen)]; | 63 return kScreenNames[static_cast<size_t>(screen)]; |
63 } | 64 } |
64 | 65 |
65 OobeScreen GetOobeScreenFromName(const std::string& name) { | 66 OobeScreen GetOobeScreenFromName(const std::string& name) { |
66 for (size_t i = 0; i < arraysize(kScreenNames); ++i) { | 67 for (size_t i = 0; i < arraysize(kScreenNames); ++i) { |
67 if (name == kScreenNames[i]) | 68 if (name == kScreenNames[i]) |
68 return static_cast<OobeScreen>(i); | 69 return static_cast<OobeScreen>(i); |
69 } | 70 } |
70 | 71 |
71 return OobeScreen::SCREEN_UNKNOWN; | 72 return OobeScreen::SCREEN_UNKNOWN; |
72 } | 73 } |
73 | 74 |
74 } // namespace chromeos | 75 } // namespace chromeos |
OLD | NEW |