OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/login/managed/locally_managed_user_creation_sc
reen.h" | 5 #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_sc
reen.h" |
6 | 6 |
7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 const char kUserNeedPassword[] = "needPassword"; | 48 const char kUserNeedPassword[] = "needPassword"; |
49 | 49 |
50 const char kAvatarURLKey[] = "avatarurl"; | 50 const char kAvatarURLKey[] = "avatarurl"; |
51 const char kRandomAvatarKey[] = "randomAvatar"; | 51 const char kRandomAvatarKey[] = "randomAvatar"; |
52 const char kNameOfIntroScreen[] = "intro"; | 52 const char kNameOfIntroScreen[] = "intro"; |
53 const char kNameOfNewUserParametersScreen[] = "username"; | 53 const char kNameOfNewUserParametersScreen[] = "username"; |
54 | 54 |
55 void ConfigureErrorScreen(ErrorScreen* screen, | 55 void ConfigureErrorScreen(ErrorScreen* screen, |
56 const NetworkState* network, | 56 const NetworkState* network, |
57 const NetworkPortalDetector::CaptivePortalStatus status) { | 57 const captive_portal::CaptivePortalStatus status) { |
58 switch (status) { | 58 switch (status) { |
59 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN: | 59 case captive_portal::CAPTIVE_PORTAL_STATUS_UNKNOWN: |
60 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE: | 60 case captive_portal::CAPTIVE_PORTAL_STATUS_ONLINE: |
61 NOTREACHED(); | 61 NOTREACHED(); |
62 break; | 62 break; |
63 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE: | 63 case captive_portal::CAPTIVE_PORTAL_STATUS_OFFLINE: |
64 screen->SetErrorState(ErrorScreen::ERROR_STATE_OFFLINE, | 64 screen->SetErrorState(ErrorScreen::ERROR_STATE_OFFLINE, |
65 std::string()); | 65 std::string()); |
66 break; | 66 break; |
67 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL: | 67 case captive_portal::CAPTIVE_PORTAL_STATUS_PORTAL: |
68 screen->SetErrorState(ErrorScreen::ERROR_STATE_PORTAL, | 68 screen->SetErrorState(ErrorScreen::ERROR_STATE_PORTAL, |
69 network ? network->name() : std::string()); | 69 network ? network->name() : std::string()); |
70 screen->FixCaptivePortal(); | 70 screen->FixCaptivePortal(); |
71 break; | 71 break; |
72 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: | 72 case captive_portal::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: |
73 screen->SetErrorState(ErrorScreen::ERROR_STATE_PROXY, | 73 screen->SetErrorState(ErrorScreen::ERROR_STATE_PROXY, |
74 std::string()); | 74 std::string()); |
75 break; | 75 break; |
76 default: | 76 default: |
77 NOTREACHED(); | 77 NOTREACHED(); |
78 break; | 78 break; |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 } // namespace | 82 } // namespace |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 on_error_screen_ = false; | 128 on_error_screen_ = false; |
129 } | 129 } |
130 | 130 |
131 void LocallyManagedUserCreationScreen::OnPageSelected(const std::string& page) { | 131 void LocallyManagedUserCreationScreen::OnPageSelected(const std::string& page) { |
132 last_page_ = page; | 132 last_page_ = page; |
133 } | 133 } |
134 | 134 |
135 void LocallyManagedUserCreationScreen::OnPortalDetectionCompleted( | 135 void LocallyManagedUserCreationScreen::OnPortalDetectionCompleted( |
136 const NetworkState* network, | 136 const NetworkState* network, |
137 const NetworkPortalDetector::CaptivePortalState& state) { | 137 const NetworkPortalDetector::CaptivePortalState& state) { |
138 if (state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE) { | 138 if (state.status == captive_portal::CAPTIVE_PORTAL_STATUS_ONLINE) { |
139 get_screen_observer()->HideErrorScreen(this); | 139 get_screen_observer()->HideErrorScreen(this); |
140 } else { | 140 } else { |
141 on_error_screen_ = true; | 141 on_error_screen_ = true; |
142 ErrorScreen* screen = get_screen_observer()->GetErrorScreen(); | 142 ErrorScreen* screen = get_screen_observer()->GetErrorScreen(); |
143 ConfigureErrorScreen(screen, network, state.status); | 143 ConfigureErrorScreen(screen, network, state.status); |
144 screen->SetUIState(ErrorScreen::UI_STATE_LOCALLY_MANAGED); | 144 screen->SetUIState(ErrorScreen::UI_STATE_LOCALLY_MANAGED); |
145 get_screen_observer()->ShowErrorScreen(); | 145 get_screen_observer()->ShowErrorScreen(); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 selected_image_ = User::kExternalImageIndex; | 582 selected_image_ = User::kExternalImageIndex; |
583 } else { | 583 } else { |
584 NOTREACHED() << "Unexpected image type: " << image_type; | 584 NOTREACHED() << "Unexpected image type: " << image_type; |
585 } | 585 } |
586 } | 586 } |
587 | 587 |
588 void LocallyManagedUserCreationScreen::OnImageAccepted() { | 588 void LocallyManagedUserCreationScreen::OnImageAccepted() { |
589 } | 589 } |
590 | 590 |
591 } // namespace chromeos | 591 } // namespace chromeos |
OLD | NEW |