Chromium Code Reviews| 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 717 void ArcSessionManager::CancelAuthCode() { | 717 void ArcSessionManager::CancelAuthCode() { |
| 718 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 718 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 719 | 719 |
| 720 if (state_ == State::NOT_INITIALIZED) { | 720 if (state_ == State::NOT_INITIALIZED) { |
| 721 NOTREACHED(); | 721 NOTREACHED(); |
| 722 return; | 722 return; |
| 723 } | 723 } |
| 724 | 724 |
| 725 // In case |state_| is ACTIVE, UI page can be ARC_LOADING (which means normal | 725 // In case |state_| is ACTIVE, UI page can be ARC_LOADING (which means normal |
| 726 // ARC booting) or ERROR (in case ARC can not be started). If ARC is booting | 726 // ARC booting) or ERROR (in case ARC can not be started). If ARC is booting |
| 727 // normally don't stop it on progress close. | 727 // normally don't stop it on progress close. If current page is LSO then |
| 728 // closing UI means no auth code and sign-in failure. Stop ARC in that case | |
|
Luis Héctor Chávez
2017/01/11 00:23:52
nit: I'd probably reword it as
"If ARC failed to
khmel
2017/01/11 05:36:43
That is nice, thanks!
| |
| 729 // too. | |
| 728 if ((state_ != State::SHOWING_TERMS_OF_SERVICE && | 730 if ((state_ != State::SHOWING_TERMS_OF_SERVICE && |
| 729 state_ != State::CHECKING_ANDROID_MANAGEMENT) && | 731 state_ != State::CHECKING_ANDROID_MANAGEMENT) && |
| 730 (!support_host_ || | 732 (!support_host_ || |
| 731 support_host_->ui_page() != ArcSupportHost::UIPage::ERROR)) { | 733 (support_host_->ui_page() != ArcSupportHost::UIPage::ERROR && |
| 734 support_host_->ui_page() != ArcSupportHost::UIPage::LSO))) { | |
| 732 return; | 735 return; |
| 733 } | 736 } |
| 734 | 737 |
| 735 // Update UMA with user cancel only if error is not currently shown. | 738 // Update UMA with user cancel only if error is not currently shown. |
| 736 if (support_host_ && | 739 if (support_host_ && |
| 737 support_host_->ui_page() != ArcSupportHost::UIPage::NO_PAGE && | 740 support_host_->ui_page() != ArcSupportHost::UIPage::NO_PAGE && |
| 738 support_host_->ui_page() != ArcSupportHost::UIPage::ERROR) { | 741 support_host_->ui_page() != ArcSupportHost::UIPage::ERROR) { |
| 739 UpdateOptInCancelUMA(OptInCancelReason::USER_CANCEL); | 742 UpdateOptInCancelUMA(OptInCancelReason::USER_CANCEL); |
| 740 } | 743 } |
| 741 | 744 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 986 return os << "ACTIVE"; | 989 return os << "ACTIVE"; |
| 987 } | 990 } |
| 988 | 991 |
| 989 // Some compiler reports an error even if all values of an enum-class are | 992 // Some compiler reports an error even if all values of an enum-class are |
| 990 // covered indivisually in a switch statement. | 993 // covered indivisually in a switch statement. |
| 991 NOTREACHED(); | 994 NOTREACHED(); |
| 992 return os; | 995 return os; |
| 993 } | 996 } |
| 994 | 997 |
| 995 } // namespace arc | 998 } // namespace arc |
| OLD | NEW |