| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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/arc/arc_session_manager.h" | 5 #include "chrome/browser/chromeos/arc/arc_session_manager.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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 error = ArcSupportHost::Error::SIGN_IN_UNKNOWN_ERROR; | 410 error = ArcSupportHost::Error::SIGN_IN_UNKNOWN_ERROR; |
| 411 break; | 411 break; |
| 412 } | 412 } |
| 413 | 413 |
| 414 if (result == ProvisioningResult::ARC_STOPPED || | 414 if (result == ProvisioningResult::ARC_STOPPED || |
| 415 result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) { | 415 result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) { |
| 416 if (profile_->GetPrefs()->HasPrefPath(prefs::kArcSignedIn)) | 416 if (profile_->GetPrefs()->HasPrefPath(prefs::kArcSignedIn)) |
| 417 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); | 417 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); |
| 418 ShutdownSession(); | 418 ShutdownSession(); |
| 419 if (support_host_) | 419 if (support_host_) |
| 420 support_host_->ShowError(error, false); | 420 support_host_->ShowError(error, true); |
| 421 return; | 421 return; |
| 422 } | 422 } |
| 423 | 423 |
| 424 if (result == ProvisioningResult::CLOUD_PROVISION_FLOW_FAILED || | 424 if (result == ProvisioningResult::CLOUD_PROVISION_FLOW_FAILED || |
| 425 result == ProvisioningResult::CLOUD_PROVISION_FLOW_TIMEOUT || | 425 result == ProvisioningResult::CLOUD_PROVISION_FLOW_TIMEOUT || |
| 426 result == ProvisioningResult::CLOUD_PROVISION_FLOW_INTERNAL_ERROR || | 426 result == ProvisioningResult::CLOUD_PROVISION_FLOW_INTERNAL_ERROR || |
| 427 // OVERALL_SIGN_IN_TIMEOUT might be an indication that ARC believes it is | 427 // OVERALL_SIGN_IN_TIMEOUT might be an indication that ARC believes it is |
| 428 // fully setup, but Chrome does not. | 428 // fully setup, but Chrome does not. |
| 429 result == ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT || | 429 result == ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT || |
| 430 // Just to be safe, remove data if we don't know the cause. | 430 // Just to be safe, remove data if we don't know the cause. |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 if (support_host_) { | 829 if (support_host_) { |
| 830 support_host_->ShowError( | 830 support_host_->ShowError( |
| 831 ArcSupportHost::Error::ANDROID_MANAGEMENT_REQUIRED_ERROR, false); | 831 ArcSupportHost::Error::ANDROID_MANAGEMENT_REQUIRED_ERROR, false); |
| 832 } | 832 } |
| 833 UpdateOptInCancelUMA(OptInCancelReason::ANDROID_MANAGEMENT_REQUIRED); | 833 UpdateOptInCancelUMA(OptInCancelReason::ANDROID_MANAGEMENT_REQUIRED); |
| 834 break; | 834 break; |
| 835 case policy::AndroidManagementClient::Result::ERROR: | 835 case policy::AndroidManagementClient::Result::ERROR: |
| 836 ShutdownSession(); | 836 ShutdownSession(); |
| 837 if (support_host_) { | 837 if (support_host_) { |
| 838 support_host_->ShowError( | 838 support_host_->ShowError( |
| 839 ArcSupportHost::Error::SERVER_COMMUNICATION_ERROR, false); | 839 ArcSupportHost::Error::SERVER_COMMUNICATION_ERROR, true); |
| 840 } | 840 } |
| 841 UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR); | 841 UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR); |
| 842 break; | 842 break; |
| 843 } | 843 } |
| 844 } | 844 } |
| 845 | 845 |
| 846 void ArcSessionManager::OnBackgroundAndroidManagementChecked( | 846 void ArcSessionManager::OnBackgroundAndroidManagementChecked( |
| 847 policy::AndroidManagementClient::Result result) { | 847 policy::AndroidManagementClient::Result result) { |
| 848 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 848 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 849 switch (result) { | 849 switch (result) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 | 972 |
| 973 #undef MAP_STATE | 973 #undef MAP_STATE |
| 974 | 974 |
| 975 // Some compilers report an error even if all values of an enum-class are | 975 // Some compilers report an error even if all values of an enum-class are |
| 976 // covered exhaustively in a switch statement. | 976 // covered exhaustively in a switch statement. |
| 977 NOTREACHED() << "Invalid value " << static_cast<int>(state); | 977 NOTREACHED() << "Invalid value " << static_cast<int>(state); |
| 978 return os; | 978 return os; |
| 979 } | 979 } |
| 980 | 980 |
| 981 } // namespace arc | 981 } // namespace arc |
| OLD | NEW |