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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 | 716 |
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 // If ARC failed to boot normally, stop ARC. Similarly, if the current page is |
726 // ARC booting) or ERROR (in case ARC can not be started). If ARC is booting | 726 // LSO, closing the window should stop ARC since the user activity chooses to |
727 // normally don't stop it on progress close. | 727 // not sign in. In any other case, ARC is booting normally and the instance |
| 728 // should not be stopped. |
728 if ((state_ != State::SHOWING_TERMS_OF_SERVICE && | 729 if ((state_ != State::SHOWING_TERMS_OF_SERVICE && |
729 state_ != State::CHECKING_ANDROID_MANAGEMENT) && | 730 state_ != State::CHECKING_ANDROID_MANAGEMENT) && |
730 (!support_host_ || | 731 (!support_host_ || |
731 support_host_->ui_page() != ArcSupportHost::UIPage::ERROR)) { | 732 (support_host_->ui_page() != ArcSupportHost::UIPage::ERROR && |
| 733 support_host_->ui_page() != ArcSupportHost::UIPage::LSO))) { |
732 return; | 734 return; |
733 } | 735 } |
734 | 736 |
735 // Update UMA with user cancel only if error is not currently shown. | 737 // Update UMA with user cancel only if error is not currently shown. |
736 if (support_host_ && | 738 if (support_host_ && |
737 support_host_->ui_page() != ArcSupportHost::UIPage::NO_PAGE && | 739 support_host_->ui_page() != ArcSupportHost::UIPage::NO_PAGE && |
738 support_host_->ui_page() != ArcSupportHost::UIPage::ERROR) { | 740 support_host_->ui_page() != ArcSupportHost::UIPage::ERROR) { |
739 UpdateOptInCancelUMA(OptInCancelReason::USER_CANCEL); | 741 UpdateOptInCancelUMA(OptInCancelReason::USER_CANCEL); |
740 } | 742 } |
741 | 743 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 return os << "ACTIVE"; | 988 return os << "ACTIVE"; |
987 } | 989 } |
988 | 990 |
989 // Some compiler reports an error even if all values of an enum-class are | 991 // Some compiler reports an error even if all values of an enum-class are |
990 // covered indivisually in a switch statement. | 992 // covered indivisually in a switch statement. |
991 NOTREACHED(); | 993 NOTREACHED(); |
992 return os; | 994 return os; |
993 } | 995 } |
994 | 996 |
995 } // namespace arc | 997 } // namespace arc |
OLD | NEW |