Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2787213002: arc: Enable UI to send feedback on "Server Communication Error" (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 error = ArcSupportHost::Error::SIGN_IN_UNKNOWN_ERROR; 304 error = ArcSupportHost::Error::SIGN_IN_UNKNOWN_ERROR;
305 break; 305 break;
306 } 306 }
307 307
308 if (result == ProvisioningResult::ARC_STOPPED || 308 if (result == ProvisioningResult::ARC_STOPPED ||
309 result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) { 309 result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) {
310 if (profile_->GetPrefs()->HasPrefPath(prefs::kArcSignedIn)) 310 if (profile_->GetPrefs()->HasPrefPath(prefs::kArcSignedIn))
311 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); 311 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false);
312 ShutdownSession(); 312 ShutdownSession();
313 if (support_host_) 313 if (support_host_)
314 support_host_->ShowError(error, false); 314 support_host_->ShowError(error, true);
Luis Héctor Chávez 2017/03/30 23:00:11 Do we have any calls where this is false?
khmel 2017/03/30 23:01:11 Yes, for "android management check required"
Luis Héctor Chávez 2017/03/30 23:03:14 Fair enough.
315 return; 315 return;
316 } 316 }
317 317
318 if (result == ProvisioningResult::CLOUD_PROVISION_FLOW_FAILED || 318 if (result == ProvisioningResult::CLOUD_PROVISION_FLOW_FAILED ||
319 result == ProvisioningResult::CLOUD_PROVISION_FLOW_TIMEOUT || 319 result == ProvisioningResult::CLOUD_PROVISION_FLOW_TIMEOUT ||
320 result == ProvisioningResult::CLOUD_PROVISION_FLOW_INTERNAL_ERROR || 320 result == ProvisioningResult::CLOUD_PROVISION_FLOW_INTERNAL_ERROR ||
321 // OVERALL_SIGN_IN_TIMEOUT might be an indication that ARC believes it is 321 // OVERALL_SIGN_IN_TIMEOUT might be an indication that ARC believes it is
322 // fully setup, but Chrome does not. 322 // fully setup, but Chrome does not.
323 result == ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT || 323 result == ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT ||
324 // Just to be safe, remove data if we don't know the cause. 324 // Just to be safe, remove data if we don't know the cause.
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 case policy::AndroidManagementClient::Result::MANAGED: 727 case policy::AndroidManagementClient::Result::MANAGED:
728 if (support_host_) { 728 if (support_host_) {
729 support_host_->ShowError( 729 support_host_->ShowError(
730 ArcSupportHost::Error::ANDROID_MANAGEMENT_REQUIRED_ERROR, false); 730 ArcSupportHost::Error::ANDROID_MANAGEMENT_REQUIRED_ERROR, false);
731 } 731 }
732 UpdateOptInCancelUMA(OptInCancelReason::ANDROID_MANAGEMENT_REQUIRED); 732 UpdateOptInCancelUMA(OptInCancelReason::ANDROID_MANAGEMENT_REQUIRED);
733 break; 733 break;
734 case policy::AndroidManagementClient::Result::ERROR: 734 case policy::AndroidManagementClient::Result::ERROR:
735 if (support_host_) { 735 if (support_host_) {
736 support_host_->ShowError( 736 support_host_->ShowError(
737 ArcSupportHost::Error::SERVER_COMMUNICATION_ERROR, false); 737 ArcSupportHost::Error::SERVER_COMMUNICATION_ERROR, true);
738 } 738 }
739 UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR); 739 UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR);
740 break; 740 break;
741 } 741 }
742 } 742 }
743 743
744 void ArcSessionManager::StartBackgroundAndroidManagementCheck() { 744 void ArcSessionManager::StartBackgroundAndroidManagementCheck() {
745 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 745 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
746 DCHECK_EQ(state_, State::ACTIVE); 746 DCHECK_EQ(state_, State::ACTIVE);
747 DCHECK(!android_management_checker_); 747 DCHECK(!android_management_checker_);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 973
974 #undef MAP_STATE 974 #undef MAP_STATE
975 975
976 // Some compilers report an error even if all values of an enum-class are 976 // Some compilers report an error even if all values of an enum-class are
977 // covered exhaustively in a switch statement. 977 // covered exhaustively in a switch statement.
978 NOTREACHED() << "Invalid value " << static_cast<int>(state); 978 NOTREACHED() << "Invalid value " << static_cast<int>(state);
979 return os; 979 return os;
980 } 980 }
981 981
982 } // namespace arc 982 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698