| 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 "ash/common/shelf/shelf_delegate.h" | 9 #include "ash/common/shelf/shelf_delegate.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 } | 498 } |
| 499 | 499 |
| 500 void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) { | 500 void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) { |
| 501 OnProvisioningFinished( | 501 OnProvisioningFinished( |
| 502 ConvertArcSignInFailureReasonToProvisioningResult(reason)); | 502 ConvertArcSignInFailureReasonToProvisioningResult(reason)); |
| 503 } | 503 } |
| 504 | 504 |
| 505 void ArcAuthService::OnProvisioningFinished(ProvisioningResult result) { | 505 void ArcAuthService::OnProvisioningFinished(ProvisioningResult result) { |
| 506 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 506 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 507 | 507 |
| 508 // If the Mojo message to notify finishing the provisioning is already sent |
| 509 // from the container, it will be processed even after requesting to stop the |
| 510 // container. Ignore all |result|s arriving while ARC is disabled, in order to |
| 511 // avoid popping up an error message triggered below. This code intentionally |
| 512 // does not support the case of reenabling. |
| 513 if (!IsArcEnabled()) { |
| 514 LOG(WARNING) << "Provisioning result received after Arc was disabled. " |
| 515 << "Ignoring result " << static_cast<int>(result) << "."; |
| 516 return; |
| 517 } |
| 518 |
| 508 // Due asynchronous nature of stopping Arc bridge, OnProvisioningFinished may | 519 // Due asynchronous nature of stopping Arc bridge, OnProvisioningFinished may |
| 509 // arrive after setting the |State::STOPPED| state and |State::Active| is not | 520 // arrive after setting the |State::STOPPED| state and |State::Active| is not |
| 510 // guaranty set here. prefs::kArcDataRemoveRequested is also can be active | 521 // guaranty set here. prefs::kArcDataRemoveRequested is also can be active |
| 511 // for now. | 522 // for now. |
| 512 | 523 |
| 513 if (provisioning_reported_) { | 524 if (provisioning_reported_) { |
| 514 // We don't expect ProvisioningResult::SUCCESS is reported twice or reported | 525 // We don't expect ProvisioningResult::SUCCESS is reported twice or reported |
| 515 // after an error. | 526 // after an error. |
| 516 DCHECK_NE(result, ProvisioningResult::SUCCESS); | 527 DCHECK_NE(result, ProvisioningResult::SUCCESS); |
| 517 // TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that | 528 // TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 return os << "ACTIVE"; | 1183 return os << "ACTIVE"; |
| 1173 } | 1184 } |
| 1174 | 1185 |
| 1175 // Some compiler reports an error even if all values of an enum-class are | 1186 // Some compiler reports an error even if all values of an enum-class are |
| 1176 // covered indivisually in a switch statement. | 1187 // covered indivisually in a switch statement. |
| 1177 NOTREACHED(); | 1188 NOTREACHED(); |
| 1178 return os; | 1189 return os; |
| 1179 } | 1190 } |
| 1180 | 1191 |
| 1181 } // namespace arc | 1192 } // namespace arc |
| OLD | NEW |