| 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/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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 UpdateEnabledStateUMA(true); | 644 UpdateEnabledStateUMA(true); |
| 645 } | 645 } |
| 646 | 646 |
| 647 void ArcAuthService::ShutdownBridge() { | 647 void ArcAuthService::ShutdownBridge() { |
| 648 arc_sign_in_timer_.Stop(); | 648 arc_sign_in_timer_.Stop(); |
| 649 playstore_launcher_.reset(); | 649 playstore_launcher_.reset(); |
| 650 auth_callback_.Reset(); | 650 auth_callback_.Reset(); |
| 651 auth_account_callback_.Reset(); | 651 auth_account_callback_.Reset(); |
| 652 android_management_checker_.reset(); | 652 android_management_checker_.reset(); |
| 653 auth_code_fetcher_.reset(); | 653 auth_code_fetcher_.reset(); |
| 654 arc_bridge_service()->Shutdown(); | 654 arc_bridge_service()->RequestStop(); |
| 655 if (state_ != State::NOT_INITIALIZED) | 655 if (state_ != State::NOT_INITIALIZED) |
| 656 SetState(State::STOPPED); | 656 SetState(State::STOPPED); |
| 657 for (auto& observer : observer_list_) | 657 for (auto& observer : observer_list_) |
| 658 observer.OnShutdownBridge(); | 658 observer.OnShutdownBridge(); |
| 659 } | 659 } |
| 660 | 660 |
| 661 void ArcAuthService::ShutdownBridgeAndCloseUI() { | 661 void ArcAuthService::ShutdownBridgeAndCloseUI() { |
| 662 ShutdownBridge(); | 662 ShutdownBridge(); |
| 663 CloseUI(); | 663 CloseUI(); |
| 664 } | 664 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 // TODO(hidehiko): Remove this. | 699 // TODO(hidehiko): Remove this. |
| 700 void ArcAuthService::StopAndEnableArc() { | 700 void ArcAuthService::StopAndEnableArc() { |
| 701 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 701 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 702 DCHECK(!arc_bridge_service()->stopped()); | 702 DCHECK(!arc_bridge_service()->stopped()); |
| 703 reenable_arc_ = true; | 703 reenable_arc_ = true; |
| 704 StopArc(); | 704 StopArc(); |
| 705 } | 705 } |
| 706 | 706 |
| 707 void ArcAuthService::StartArc() { | 707 void ArcAuthService::StartArc() { |
| 708 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 708 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 709 arc_bridge_service()->HandleStartup(); | 709 arc_bridge_service()->RequestStart(); |
| 710 SetState(State::ACTIVE); | 710 SetState(State::ACTIVE); |
| 711 } | 711 } |
| 712 | 712 |
| 713 void ArcAuthService::SetAuthCodeAndStartArc(const std::string& auth_code) { | 713 void ArcAuthService::SetAuthCodeAndStartArc(const std::string& auth_code) { |
| 714 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 714 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 715 DCHECK(!auth_code.empty()); | 715 DCHECK(!auth_code.empty()); |
| 716 | 716 |
| 717 if (IsAuthCodeRequest()) { | 717 if (IsAuthCodeRequest()) { |
| 718 DCHECK_EQ(state_, State::FETCHING_CODE); | 718 DCHECK_EQ(state_, State::FETCHING_CODE); |
| 719 SetState(State::ACTIVE); | 719 SetState(State::ACTIVE); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 return os << kStateFetchingCode; | 969 return os << kStateFetchingCode; |
| 970 case ArcAuthService::State::ACTIVE: | 970 case ArcAuthService::State::ACTIVE: |
| 971 return os << kStateActive; | 971 return os << kStateActive; |
| 972 default: | 972 default: |
| 973 NOTREACHED(); | 973 NOTREACHED(); |
| 974 return os; | 974 return os; |
| 975 } | 975 } |
| 976 } | 976 } |
| 977 | 977 |
| 978 } // namespace arc | 978 } // namespace arc |
| OLD | NEW |