| 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/shelf/shelf_delegate.h" | 9 #include "ash/shelf/shelf_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 | 656 |
| 657 void ArcAuthService::DisableArc() { | 657 void ArcAuthService::DisableArc() { |
| 658 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 658 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 659 DCHECK(profile_); | 659 DCHECK(profile_); |
| 660 profile_->GetPrefs()->SetBoolean(prefs::kArcEnabled, false); | 660 profile_->GetPrefs()->SetBoolean(prefs::kArcEnabled, false); |
| 661 } | 661 } |
| 662 | 662 |
| 663 void ArcAuthService::StartUI() { | 663 void ArcAuthService::StartUI() { |
| 664 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 664 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 665 | 665 |
| 666 if (!arc_bridge_service()->stopped()) { |
| 667 // If the user attempts to re-enable ARC while the bridge is still running |
| 668 // the user should not be able to continue until the bridge has stopped. |
| 669 ShowUI(UIPage::ERROR, l10n_util::GetStringUTF16( |
| 670 IDS_ARC_SIGN_IN_SERVICE_UNAVAILABLE_ERROR)); |
| 671 return; |
| 672 } |
| 673 |
| 666 SetState(State::FETCHING_CODE); | 674 SetState(State::FETCHING_CODE); |
| 667 | 675 |
| 668 if (initial_opt_in_) { | 676 if (initial_opt_in_) { |
| 669 initial_opt_in_ = false; | 677 initial_opt_in_ = false; |
| 670 ShowUI(UIPage::TERMS_PROGRESS, base::string16()); | 678 ShowUI(UIPage::TERMS_PROGRESS, base::string16()); |
| 671 } else { | 679 } else { |
| 672 context_->PrepareContext(); | 680 context_->PrepareContext(); |
| 673 } | 681 } |
| 674 } | 682 } |
| 675 | 683 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 return os << kStateFetchingCode; | 759 return os << kStateFetchingCode; |
| 752 case ArcAuthService::State::ACTIVE: | 760 case ArcAuthService::State::ACTIVE: |
| 753 return os << kStateActive; | 761 return os << kStateActive; |
| 754 default: | 762 default: |
| 755 NOTREACHED(); | 763 NOTREACHED(); |
| 756 return os; | 764 return os; |
| 757 } | 765 } |
| 758 } | 766 } |
| 759 | 767 |
| 760 } // namespace arc | 768 } // namespace arc |
| OLD | NEW |