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" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/chromeos/arc/arc_auth_context.h" | 17 #include "chrome/browser/chromeos/arc/arc_auth_context.h" |
| 18 #include "chrome/browser/chromeos/arc/arc_optin_uma.h" | 18 #include "chrome/browser/chromeos/arc/arc_optin_uma.h" |
| 19 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 19 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 20 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.h" | 20 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotia tor.h" |
| 21 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_oobe_negotiator .h" | |
| 21 #include "chrome/browser/chromeos/arc/policy/arc_android_management_checker.h" | 22 #include "chrome/browser/chromeos/arc/policy/arc_android_management_checker.h" |
| 22 #include "chrome/browser/chromeos/arc/policy/arc_policy_util.h" | 23 #include "chrome/browser/chromeos/arc/policy/arc_policy_util.h" |
| 23 #include "chrome/browser/chromeos/login/user_flow.h" | 24 #include "chrome/browser/chromeos/login/user_flow.h" |
| 24 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 25 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 25 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 26 #include "chrome/browser/lifetime/application_lifetime.h" | 27 #include "chrome/browser/lifetime/application_lifetime.h" |
| 27 #include "chrome/browser/policy/profile_policy_connector.h" | 28 #include "chrome/browser/policy/profile_policy_connector.h" |
| 28 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 29 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 29 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 30 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 ash::ShelfDelegate* GetShelfDelegate() { | 72 ash::ShelfDelegate* GetShelfDelegate() { |
| 72 if (g_shelf_delegate_for_testing) | 73 if (g_shelf_delegate_for_testing) |
| 73 return g_shelf_delegate_for_testing; | 74 return g_shelf_delegate_for_testing; |
| 74 if (ash::WmShell::HasInstance()) { | 75 if (ash::WmShell::HasInstance()) { |
| 75 DCHECK(ash::WmShell::Get()->shelf_delegate()); | 76 DCHECK(ash::WmShell::Get()->shelf_delegate()); |
| 76 return ash::WmShell::Get()->shelf_delegate(); | 77 return ash::WmShell::Get()->shelf_delegate(); |
| 77 } | 78 } |
| 78 return nullptr; | 79 return nullptr; |
| 79 } | 80 } |
| 80 | 81 |
| 82 bool IsFirstRunForOobeEnabledUser() { | |
|
hidehiko
2016/12/16 05:31:50
Could you comment "FirstRun" is the Chrome term me
khmel
2016/12/16 18:37:55
Done.
| |
| 83 // ARC OOBE OptIn is optional for now. Test if it exists and current user is | |
| 84 // first time user. | |
| 85 return user_manager::UserManager::Get()->IsCurrentUserNew() && | |
| 86 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 87 chromeos::switches::kEnableArcOOBEOptIn); | |
| 88 } | |
| 89 | |
| 81 } // namespace | 90 } // namespace |
| 82 | 91 |
| 83 ArcSessionManager::ArcSessionManager(ArcBridgeService* bridge_service) | 92 ArcSessionManager::ArcSessionManager(ArcBridgeService* bridge_service) |
| 84 : ArcService(bridge_service), | 93 : ArcService(bridge_service), |
| 85 attempt_user_exit_callback_(base::Bind(chrome::AttemptUserExit)), | 94 attempt_user_exit_callback_(base::Bind(chrome::AttemptUserExit)), |
| 86 weak_ptr_factory_(this) { | 95 weak_ptr_factory_(this) { |
| 87 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 96 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 88 DCHECK(!g_arc_session_manager); | 97 DCHECK(!g_arc_session_manager); |
| 89 g_arc_session_manager = this; | 98 g_arc_session_manager = this; |
| 90 | 99 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 // Restart ARC anyway. Let the enterprise reporting instance decide whether | 273 // Restart ARC anyway. Let the enterprise reporting instance decide whether |
| 265 // the ARC user data wipe is still required or not. | 274 // the ARC user data wipe is still required or not. |
| 266 reenable_arc_ = false; | 275 reenable_arc_ = false; |
| 267 VLOG(1) << "Reenable ARC"; | 276 VLOG(1) << "Reenable ARC"; |
| 268 EnableArc(); | 277 EnableArc(); |
| 269 } | 278 } |
| 270 | 279 |
| 271 void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) { | 280 void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) { |
| 272 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 281 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 273 | 282 |
| 274 // Due asynchronous nature of stopping Arc bridge, OnProvisioningFinished may | 283 // Due asynchronous nature of stopping ARC bridge, OnProvisioningFinished may |
| 275 // arrive after setting the |State::STOPPED| state and |State::Active| is not | 284 // arrive after setting the |State::STOPPED| state and |State::Active| is not |
| 276 // guaranty set here. prefs::kArcDataRemoveRequested is also can be active | 285 // guaranty set here. prefs::kArcDataRemoveRequested is also can be active |
| 277 // for now. | 286 // for now. |
| 278 | 287 |
| 279 if (provisioning_reported_) { | 288 if (provisioning_reported_) { |
| 280 // We don't expect ProvisioningResult::SUCCESS is reported twice or reported | 289 // We don't expect ProvisioningResult::SUCCESS is reported twice or reported |
| 281 // after an error. | 290 // after an error. |
| 282 DCHECK_NE(result, ProvisioningResult::SUCCESS); | 291 DCHECK_NE(result, ProvisioningResult::SUCCESS); |
| 283 // TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that | 292 // TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that |
| 284 // no double message can happen in production. | 293 // no double message can happen in production. |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 | 448 |
| 440 PrefServiceSyncableFromProfile(profile_)->AddSyncedPrefObserver( | 449 PrefServiceSyncableFromProfile(profile_)->AddSyncedPrefObserver( |
| 441 prefs::kArcEnabled, this); | 450 prefs::kArcEnabled, this); |
| 442 | 451 |
| 443 context_.reset(new ArcAuthContext(profile_)); | 452 context_.reset(new ArcAuthContext(profile_)); |
| 444 | 453 |
| 445 if (!g_disable_ui_for_testing || | 454 if (!g_disable_ui_for_testing || |
| 446 g_enable_check_android_management_for_testing) { | 455 g_enable_check_android_management_for_testing) { |
| 447 ArcAndroidManagementChecker::StartClient(); | 456 ArcAndroidManagementChecker::StartClient(); |
| 448 } | 457 } |
| 458 | |
| 449 pref_change_registrar_.Init(profile_->GetPrefs()); | 459 pref_change_registrar_.Init(profile_->GetPrefs()); |
| 450 pref_change_registrar_.Add( | 460 pref_change_registrar_.Add( |
| 451 prefs::kArcEnabled, | 461 prefs::kArcEnabled, |
| 452 base::Bind(&ArcSessionManager::OnOptInPreferenceChanged, | 462 base::Bind(&ArcSessionManager::OnOptInPreferenceChanged, |
| 453 weak_ptr_factory_.GetWeakPtr())); | 463 weak_ptr_factory_.GetWeakPtr())); |
| 454 if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { | 464 if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { |
| 465 if (IsFirstRunForOobeEnabledUser() && IsArcManaged()) | |
| 466 StartTermsOfServiceNegotiation(NegotiatorType::OOBE); | |
|
hidehiko
2016/12/16 05:31:50
I still do not want to have this function here.
So
khmel
2016/12/16 18:37:55
Done.
| |
| 467 | |
| 455 // Don't start ARC if there is a pending request to remove the data. Restart | 468 // Don't start ARC if there is a pending request to remove the data. Restart |
| 456 // ARC once data removal finishes. | 469 // ARC once data removal finishes. |
| 457 if (profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)) { | 470 if (profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)) { |
| 458 reenable_arc_ = true; | 471 reenable_arc_ = true; |
| 459 RemoveArcData(); | 472 RemoveArcData(); |
| 460 } else { | 473 } else { |
| 461 OnOptInPreferenceChanged(); | 474 OnOptInPreferenceChanged(); |
| 462 } | 475 } |
| 463 } else { | 476 } else { |
| 464 RemoveArcData(); | 477 RemoveArcData(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 543 reenable_arc_ = false; | 556 reenable_arc_ = false; |
| 544 StopArc(); | 557 StopArc(); |
| 545 RemoveArcData(); | 558 RemoveArcData(); |
| 546 return; | 559 return; |
| 547 } | 560 } |
| 548 | 561 |
| 549 if (state_ == State::ACTIVE) | 562 if (state_ == State::ACTIVE) |
| 550 return; | 563 return; |
| 551 | 564 |
| 552 if (state_ == State::REMOVING_DATA_DIR) { | 565 if (state_ == State::REMOVING_DATA_DIR) { |
| 553 // Data removal request is in progress. Set flag to re-enable Arc once it is | 566 // Data removal request is in progress. Set flag to re-enable ARC once it is |
| 554 // finished. | 567 // finished. |
| 555 reenable_arc_ = true; | 568 reenable_arc_ = true; |
| 556 return; | 569 return; |
| 557 } | 570 } |
| 558 | 571 |
| 559 if (support_host_) | 572 if (support_host_) |
| 560 support_host_->SetArcManaged(IsArcManaged()); | 573 support_host_->SetArcManaged(IsArcManaged()); |
| 561 | 574 |
| 562 // For ARC Kiosk we skip ToS because it is very likely that near the device | 575 // For ARC Kiosk we skip ToS because it is very likely that near the device |
| 563 // there will be no one who is eligible to accept them. | 576 // there will be no one who is eligible to accept them. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 598 } | 611 } |
| 599 | 612 |
| 600 // If it is marked that the Terms of service is accepted already, | 613 // If it is marked that the Terms of service is accepted already, |
| 601 // just skip the negotiation with user, and start Android management | 614 // just skip the negotiation with user, and start Android management |
| 602 // check directly. | 615 // check directly. |
| 603 // This happens, e.g., when; | 616 // This happens, e.g., when; |
| 604 // 1) User accepted the Terms of service on OOBE flow. | 617 // 1) User accepted the Terms of service on OOBE flow. |
| 605 // 2) User accepted the Terms of service on Opt-in flow, but logged out | 618 // 2) User accepted the Terms of service on Opt-in flow, but logged out |
| 606 // before ARC sign in procedure was done. Then, logs in again. | 619 // before ARC sign in procedure was done. Then, logs in again. |
| 607 if (profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) { | 620 if (profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) { |
| 608 support_host_->ShowArcLoading(); | |
| 609 StartArcAndroidManagementCheck(); | 621 StartArcAndroidManagementCheck(); |
| 610 return; | 622 return; |
| 611 } | 623 } |
| 612 | 624 |
| 613 // Need user's explicit Terms Of Service agreement. | 625 // Need user's explicit Terms Of Service agreement. There is the case when Arc |
| 614 StartTermsOfServiceNegotiation(); | 626 // is managed on and we have OOBE negotiator already set. |
| 627 if (!terms_of_service_negotiator_) | |
| 628 StartTermsOfServiceNegotiation(NegotiatorType::DEFAULT); | |
| 615 } | 629 } |
| 616 | 630 |
| 617 void ArcSessionManager::ShutdownBridge() { | 631 void ArcSessionManager::ShutdownBridge() { |
| 618 arc_sign_in_timer_.Stop(); | 632 arc_sign_in_timer_.Stop(); |
| 619 playstore_launcher_.reset(); | 633 playstore_launcher_.reset(); |
| 620 terms_of_service_negotiator_.reset(); | 634 terms_of_service_negotiator_.reset(); |
| 621 android_management_checker_.reset(); | 635 android_management_checker_.reset(); |
| 622 arc_bridge_service()->RequestStop(); | 636 arc_bridge_service()->RequestStop(); |
| 623 if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR) | 637 if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR) |
| 624 SetState(State::STOPPED); | 638 SetState(State::STOPPED); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 641 void ArcSessionManager::StopAndEnableArc() { | 655 void ArcSessionManager::StopAndEnableArc() { |
| 642 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 656 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 643 DCHECK(!arc_bridge_service()->stopped()); | 657 DCHECK(!arc_bridge_service()->stopped()); |
| 644 reenable_arc_ = true; | 658 reenable_arc_ = true; |
| 645 StopArc(); | 659 StopArc(); |
| 646 } | 660 } |
| 647 | 661 |
| 648 void ArcSessionManager::StartArc() { | 662 void ArcSessionManager::StartArc() { |
| 649 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 663 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 650 | 664 |
| 651 // Arc must be started only if no pending data removal request exists. | 665 // ARC must be started only if no pending data removal request exists. |
| 652 DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); | 666 DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); |
| 653 | 667 |
| 654 provisioning_reported_ = false; | 668 provisioning_reported_ = false; |
| 655 | 669 |
| 656 arc_bridge_service()->RequestStart(); | 670 arc_bridge_service()->RequestStart(); |
| 657 SetState(State::ACTIVE); | 671 SetState(State::ACTIVE); |
| 658 } | 672 } |
| 659 | 673 |
| 660 void ArcSessionManager::OnArcSignInTimeout() { | 674 void ArcSessionManager::OnArcSignInTimeout() { |
| 661 LOG(ERROR) << "Timed out waiting for first sign in."; | 675 LOG(ERROR) << "Timed out waiting for first sign in."; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 729 profile_->GetPrefs()->SetBoolean(prefs::kArcEnabled, false); | 743 profile_->GetPrefs()->SetBoolean(prefs::kArcEnabled, false); |
| 730 } | 744 } |
| 731 | 745 |
| 732 void ArcSessionManager::RecordArcState() { | 746 void ArcSessionManager::RecordArcState() { |
| 733 // Only record Enabled state if ARC is allowed in the first place, so we do | 747 // Only record Enabled state if ARC is allowed in the first place, so we do |
| 734 // not split the ARC population by devices that cannot run ARC. | 748 // not split the ARC population by devices that cannot run ARC. |
| 735 if (IsAllowed()) | 749 if (IsAllowed()) |
| 736 UpdateEnabledStateUMA(IsArcEnabled()); | 750 UpdateEnabledStateUMA(IsArcEnabled()); |
| 737 } | 751 } |
| 738 | 752 |
| 739 void ArcSessionManager::StartTermsOfServiceNegotiation() { | 753 void ArcSessionManager::StartTermsOfServiceNegotiation(NegotiatorType type) { |
| 740 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 754 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 741 DCHECK(!terms_of_service_negotiator_); | 755 DCHECK(!terms_of_service_negotiator_); |
| 742 | 756 |
| 743 if (!arc_bridge_service()->stopped()) { | 757 if (!arc_bridge_service()->stopped()) { |
| 744 // If the user attempts to re-enable ARC while the bridge is still running | 758 // If the user attempts to re-enable ARC while the bridge is still running |
| 745 // the user should not be able to continue until the bridge has stopped. | 759 // the user should not be able to continue until the bridge has stopped. |
| 746 if (support_host_) { | 760 if (support_host_) { |
| 747 support_host_->ShowError( | 761 support_host_->ShowError( |
| 748 ArcSupportHost::Error::SIGN_IN_SERVICE_UNAVAILABLE_ERROR, false); | 762 ArcSupportHost::Error::SIGN_IN_SERVICE_UNAVAILABLE_ERROR, false); |
| 749 } | 763 } |
| 750 return; | 764 return; |
| 751 } | 765 } |
| 752 | 766 |
| 753 SetState(State::SHOWING_TERMS_OF_SERVICE); | 767 SetState(State::SHOWING_TERMS_OF_SERVICE); |
| 754 if (support_host_) { | 768 if (support_host_) { |
| 755 terms_of_service_negotiator_ = | 769 switch (type) { |
| 756 base::MakeUnique<ArcTermsOfServiceNegotiator>(profile_->GetPrefs(), | 770 case NegotiatorType::DEFAULT: |
| 757 support_host_.get()); | 771 terms_of_service_negotiator_ = |
| 772 base::MakeUnique<ArcTermsOfServiceDefaultNegotiator>( | |
| 773 profile_->GetPrefs(), support_host_.get()); | |
| 774 break; | |
| 775 case NegotiatorType::OOBE: | |
| 776 terms_of_service_negotiator_ = | |
| 777 base::MakeUnique<ArcTermsOfServiceOOBENegotiator>(); | |
| 778 break; | |
| 779 default: | |
| 780 NOTREACHED(); | |
| 781 return; | |
| 782 } | |
| 758 terms_of_service_negotiator_->StartNegotiation( | 783 terms_of_service_negotiator_->StartNegotiation( |
| 759 base::Bind(&ArcSessionManager::OnTermsOfServiceNegotiated, | 784 base::Bind(&ArcSessionManager::OnTermsOfServiceNegotiated, |
| 760 weak_ptr_factory_.GetWeakPtr())); | 785 weak_ptr_factory_.GetWeakPtr())); |
| 761 } | 786 } |
| 762 } | 787 } |
| 763 | 788 |
| 764 void ArcSessionManager::OnTermsOfServiceNegotiated(bool accepted) { | 789 void ArcSessionManager::OnTermsOfServiceNegotiated(bool accepted) { |
| 765 DCHECK(terms_of_service_negotiator_); | 790 DCHECK(terms_of_service_negotiator_); |
| 766 terms_of_service_negotiator_.reset(); | 791 terms_of_service_negotiator_.reset(); |
| 767 | 792 |
| 768 if (!accepted) { | 793 if (!accepted) { |
| 769 // To cancel, user needs to close the window. Note that clicking "Cancel" | 794 // To cancel, user needs to close the window. Note that clicking "Cancel" |
| 770 // button effectively just closes the window. | 795 // button effectively just closes the window. |
| 771 CancelAuthCode(); | 796 CancelAuthCode(); |
| 772 return; | 797 return; |
| 773 } | 798 } |
| 774 | 799 |
| 775 // Terms were accepted. | 800 // Terms were accepted. |
| 776 profile_->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, true); | 801 profile_->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, true); |
| 777 | 802 |
| 778 support_host_->ShowArcLoading(); | 803 // Don't show UI for this progress if it was not shown. |
| 804 if (support_host_->has_message_host()) | |
| 805 support_host_->ShowArcLoading(); | |
| 779 StartArcAndroidManagementCheck(); | 806 StartArcAndroidManagementCheck(); |
| 780 } | 807 } |
| 781 | 808 |
| 782 void ArcSessionManager::StartArcAndroidManagementCheck() { | 809 void ArcSessionManager::StartArcAndroidManagementCheck() { |
| 783 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 810 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 784 DCHECK(arc_bridge_service()->stopped()); | 811 DCHECK(arc_bridge_service()->stopped()); |
| 785 DCHECK(state_ == State::SHOWING_TERMS_OF_SERVICE || | 812 DCHECK(state_ == State::SHOWING_TERMS_OF_SERVICE || |
| 786 state_ == State::CHECKING_ANDROID_MANAGEMENT); | 813 state_ == State::CHECKING_ANDROID_MANAGEMENT || |
| 814 (state_ == State::STOPPED && | |
| 815 profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted))); | |
| 787 SetState(State::CHECKING_ANDROID_MANAGEMENT); | 816 SetState(State::CHECKING_ANDROID_MANAGEMENT); |
| 788 | 817 |
| 789 android_management_checker_.reset(new ArcAndroidManagementChecker( | 818 android_management_checker_.reset(new ArcAndroidManagementChecker( |
| 790 profile_, context_->token_service(), context_->account_id(), | 819 profile_, context_->token_service(), context_->account_id(), |
| 791 false /* retry_on_error */)); | 820 false /* retry_on_error */)); |
| 792 android_management_checker_->StartCheck( | 821 android_management_checker_->StartCheck( |
| 793 base::Bind(&ArcSessionManager::OnAndroidManagementChecked, | 822 base::Bind(&ArcSessionManager::OnAndroidManagementChecked, |
| 794 weak_ptr_factory_.GetWeakPtr())); | 823 weak_ptr_factory_.GetWeakPtr())); |
| 795 } | 824 } |
| 796 | 825 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 866 void ArcSessionManager::OnRetryClicked() { | 895 void ArcSessionManager::OnRetryClicked() { |
| 867 DCHECK(support_host_); | 896 DCHECK(support_host_); |
| 868 | 897 |
| 869 UpdateOptInActionUMA(OptInActionType::RETRY); | 898 UpdateOptInActionUMA(OptInActionType::RETRY); |
| 870 | 899 |
| 871 // TODO(hidehiko): Simplify the retry logic. | 900 // TODO(hidehiko): Simplify the retry logic. |
| 872 if (terms_of_service_negotiator_) { | 901 if (terms_of_service_negotiator_) { |
| 873 // Currently Terms of service is shown. ArcTermsOfServiceNegotiator should | 902 // Currently Terms of service is shown. ArcTermsOfServiceNegotiator should |
| 874 // handle this. | 903 // handle this. |
| 875 } else if (!profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) { | 904 } else if (!profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) { |
| 876 StartTermsOfServiceNegotiation(); | 905 StartTermsOfServiceNegotiation(NegotiatorType::DEFAULT); |
| 877 } else if (support_host_->ui_page() == ArcSupportHost::UIPage::ERROR && | 906 } else if (support_host_->ui_page() == ArcSupportHost::UIPage::ERROR && |
| 878 !arc_bridge_service()->stopped()) { | 907 !arc_bridge_service()->stopped()) { |
| 879 // ERROR_WITH_FEEDBACK is set in OnSignInFailed(). In the case, stopping | 908 // ERROR_WITH_FEEDBACK is set in OnSignInFailed(). In the case, stopping |
| 880 // ARC was postponed to contain its internal state into the report. | 909 // ARC was postponed to contain its internal state into the report. |
| 881 // Here, on retry, stop it, then restart. | 910 // Here, on retry, stop it, then restart. |
| 882 DCHECK_EQ(State::ACTIVE, state_); | 911 DCHECK_EQ(State::ACTIVE, state_); |
| 883 support_host_->ShowArcLoading(); | 912 support_host_->ShowArcLoading(); |
| 884 ShutdownBridge(); | 913 ShutdownBridge(); |
| 885 reenable_arc_ = true; | 914 reenable_arc_ = true; |
| 886 } else if (state_ == State::ACTIVE) { | 915 } else if (state_ == State::ACTIVE) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 923 return os << "ACTIVE"; | 952 return os << "ACTIVE"; |
| 924 } | 953 } |
| 925 | 954 |
| 926 // Some compiler reports an error even if all values of an enum-class are | 955 // Some compiler reports an error even if all values of an enum-class are |
| 927 // covered indivisually in a switch statement. | 956 // covered indivisually in a switch statement. |
| 928 NOTREACHED(); | 957 NOTREACHED(); |
| 929 return os; | 958 return os; |
| 930 } | 959 } |
| 931 | 960 |
| 932 } // namespace arc | 961 } // namespace arc |
| OLD | NEW |