Chromium Code Reviews| 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 g_enable_check_android_management_for_testing) { | 622 g_enable_check_android_management_for_testing) { |
| 623 CheckAndroidManagement(true); | 623 CheckAndroidManagement(true); |
| 624 } else { | 624 } else { |
| 625 StartArc(); | 625 StartArc(); |
| 626 } | 626 } |
| 627 } | 627 } |
| 628 | 628 |
| 629 UpdateEnabledStateUMA(true); | 629 UpdateEnabledStateUMA(true); |
| 630 } | 630 } |
| 631 | 631 |
| 632 void ArcAuthService::ShutdownBridge() { | 632 void ArcAuthService::ShutdownBridge() { |
|
hidehiko
2016/10/20 10:09:08
Note: this may be better to be renamed along with
| |
| 633 arc_sign_in_timer_.Stop(); | 633 arc_sign_in_timer_.Stop(); |
| 634 playstore_launcher_.reset(); | 634 playstore_launcher_.reset(); |
| 635 auth_callback_.Reset(); | 635 auth_callback_.Reset(); |
| 636 auth_account_callback_.Reset(); | 636 auth_account_callback_.Reset(); |
| 637 android_management_checker_.reset(); | 637 android_management_checker_.reset(); |
| 638 auth_code_fetcher_.reset(); | 638 auth_code_fetcher_.reset(); |
| 639 arc_bridge_service()->Shutdown(); | 639 arc_bridge_service()->RequestStop(); |
| 640 if (state_ != State::NOT_INITIALIZED) | 640 if (state_ != State::NOT_INITIALIZED) |
| 641 SetState(State::STOPPED); | 641 SetState(State::STOPPED); |
| 642 for (auto& observer : observer_list_) | 642 for (auto& observer : observer_list_) |
| 643 observer.OnShutdownBridge(); | 643 observer.OnShutdownBridge(); |
| 644 } | 644 } |
| 645 | 645 |
| 646 void ArcAuthService::ShutdownBridgeAndCloseUI() { | 646 void ArcAuthService::ShutdownBridgeAndCloseUI() { |
| 647 ShutdownBridge(); | 647 ShutdownBridge(); |
| 648 CloseUI(); | 648 CloseUI(); |
| 649 } | 649 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 684 // TODO(hidehiko): Remove this. | 684 // TODO(hidehiko): Remove this. |
| 685 void ArcAuthService::StopAndEnableArc() { | 685 void ArcAuthService::StopAndEnableArc() { |
| 686 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 686 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 687 DCHECK(!arc_bridge_service()->stopped()); | 687 DCHECK(!arc_bridge_service()->stopped()); |
| 688 reenable_arc_ = true; | 688 reenable_arc_ = true; |
| 689 StopArc(); | 689 StopArc(); |
| 690 } | 690 } |
| 691 | 691 |
| 692 void ArcAuthService::StartArc() { | 692 void ArcAuthService::StartArc() { |
| 693 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 693 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 694 arc_bridge_service()->HandleStartup(); | 694 arc_bridge_service()->RequestStart(); |
| 695 SetState(State::ACTIVE); | 695 SetState(State::ACTIVE); |
| 696 } | 696 } |
| 697 | 697 |
| 698 void ArcAuthService::SetAuthCodeAndStartArc(const std::string& auth_code) { | 698 void ArcAuthService::SetAuthCodeAndStartArc(const std::string& auth_code) { |
| 699 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 699 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 700 DCHECK(!auth_code.empty()); | 700 DCHECK(!auth_code.empty()); |
| 701 | 701 |
| 702 if (!auth_callback_.is_null() || !auth_account_callback_.is_null()) { | 702 if (!auth_callback_.is_null() || !auth_account_callback_.is_null()) { |
| 703 DCHECK_EQ(state_, State::FETCHING_CODE); | 703 DCHECK_EQ(state_, State::FETCHING_CODE); |
| 704 SetState(State::ACTIVE); | 704 SetState(State::ACTIVE); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 943 return os << kStateFetchingCode; | 943 return os << kStateFetchingCode; |
| 944 case ArcAuthService::State::ACTIVE: | 944 case ArcAuthService::State::ACTIVE: |
| 945 return os << kStateActive; | 945 return os << kStateActive; |
| 946 default: | 946 default: |
| 947 NOTREACHED(); | 947 NOTREACHED(); |
| 948 return os; | 948 return os; |
| 949 } | 949 } |
| 950 } | 950 } |
| 951 | 951 |
| 952 } // namespace arc | 952 } // namespace arc |
| OLD | NEW |