OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/arc/arc_auth_service.h" | 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 void ArcAuthService::OnSignInComplete() { | 146 void ArcAuthService::OnSignInComplete() { |
147 DCHECK(thread_checker.Get().CalledOnValidThread()); | 147 DCHECK(thread_checker.Get().CalledOnValidThread()); |
148 DCHECK_EQ(state_, State::ACTIVE); | 148 DCHECK_EQ(state_, State::ACTIVE); |
149 | 149 |
150 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); | 150 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); |
151 CloseUI(); | 151 CloseUI(); |
152 } | 152 } |
153 | 153 |
154 void ArcAuthService::OnSignInFailed(arc::ArcSignInFailureReason reason) { | 154 void ArcAuthService::OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) { |
155 DCHECK(thread_checker.Get().CalledOnValidThread()); | 155 DCHECK(thread_checker.Get().CalledOnValidThread()); |
156 DCHECK_EQ(state_, State::ACTIVE); | 156 DCHECK_EQ(state_, State::ACTIVE); |
157 | 157 |
158 int error_message_id; | 158 int error_message_id; |
159 switch (reason) { | 159 switch (reason) { |
160 case arc::ArcSignInFailureReason::NETWORK_ERROR: | 160 case arc::mojom::ArcSignInFailureReason::NETWORK_ERROR: |
161 error_message_id = IDS_ARC_SIGN_IN_NETWORK_ERROR; | 161 error_message_id = IDS_ARC_SIGN_IN_NETWORK_ERROR; |
162 UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR); | 162 UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR); |
163 break; | 163 break; |
164 case arc::ArcSignInFailureReason::SERVICE_UNAVAILABLE: | 164 case arc::mojom::ArcSignInFailureReason::SERVICE_UNAVAILABLE: |
165 error_message_id = IDS_ARC_SIGN_IN_SERVICE_UNAVAILABLE_ERROR; | 165 error_message_id = IDS_ARC_SIGN_IN_SERVICE_UNAVAILABLE_ERROR; |
166 UpdateOptInCancelUMA(OptInCancelReason::SERVICE_UNAVAILABLE); | 166 UpdateOptInCancelUMA(OptInCancelReason::SERVICE_UNAVAILABLE); |
167 break; | 167 break; |
168 case arc::ArcSignInFailureReason::BAD_AUTHENTICATION: | 168 case arc::mojom::ArcSignInFailureReason::BAD_AUTHENTICATION: |
169 error_message_id = IDS_ARC_SIGN_IN_BAD_AUTHENTICATION_ERROR; | 169 error_message_id = IDS_ARC_SIGN_IN_BAD_AUTHENTICATION_ERROR; |
170 UpdateOptInCancelUMA(OptInCancelReason::BAD_AUTHENTICATION); | 170 UpdateOptInCancelUMA(OptInCancelReason::BAD_AUTHENTICATION); |
171 break; | 171 break; |
172 case arc::ArcSignInFailureReason::GMS_CORE_NOT_AVAILABLE: | 172 case arc::mojom::ArcSignInFailureReason::GMS_CORE_NOT_AVAILABLE: |
173 error_message_id = IDS_ARC_SIGN_IN_GMS_NOT_AVAILABLE_ERROR; | 173 error_message_id = IDS_ARC_SIGN_IN_GMS_NOT_AVAILABLE_ERROR; |
174 UpdateOptInCancelUMA(OptInCancelReason::GMS_CORE_NOT_AVAILABLE); | 174 UpdateOptInCancelUMA(OptInCancelReason::GMS_CORE_NOT_AVAILABLE); |
175 break; | 175 break; |
176 case arc::ArcSignInFailureReason::CLOUD_PROVISION_FLOW_FAIL: | 176 case arc::mojom::ArcSignInFailureReason::CLOUD_PROVISION_FLOW_FAIL: |
177 error_message_id = IDS_ARC_SIGN_IN_CLOUD_PROVISION_FLOW_FAIL_ERROR; | 177 error_message_id = IDS_ARC_SIGN_IN_CLOUD_PROVISION_FLOW_FAIL_ERROR; |
178 UpdateOptInCancelUMA(OptInCancelReason::CLOUD_PROVISION_FLOW_FAIL); | 178 UpdateOptInCancelUMA(OptInCancelReason::CLOUD_PROVISION_FLOW_FAIL); |
179 break; | 179 break; |
180 default: | 180 default: |
181 error_message_id = IDS_ARC_SIGN_IN_UNKNOWN_ERROR; | 181 error_message_id = IDS_ARC_SIGN_IN_UNKNOWN_ERROR; |
182 UpdateOptInCancelUMA(OptInCancelReason::UNKNOWN_ERROR); | 182 UpdateOptInCancelUMA(OptInCancelReason::UNKNOWN_ERROR); |
183 } | 183 } |
184 | 184 |
185 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); | 185 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); |
186 ShutdownBridgeAndShowUI(UIPage::ERROR, | 186 ShutdownBridgeAndShowUI(UIPage::ERROR, |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 return os << kStateFetchingCode; | 523 return os << kStateFetchingCode; |
524 case ArcAuthService::State::ACTIVE: | 524 case ArcAuthService::State::ACTIVE: |
525 return os << kStateActive; | 525 return os << kStateActive; |
526 default: | 526 default: |
527 NOTREACHED(); | 527 NOTREACHED(); |
528 return os; | 528 return os; |
529 } | 529 } |
530 } | 530 } |
531 | 531 |
532 } // namespace arc | 532 } // namespace arc |
OLD | NEW |