Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2861)

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2844383006: Turn ArcSupportHost from Observer model to Delegate (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 6a46751a502f52637d744aaf9d131aebcae3a377..7b08d72222e365de69c99de86b37318889af8f82 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -426,7 +426,7 @@ void ArcSessionManager::SetProfile(Profile* profile) {
!IsArcKioskMode()) {
DCHECK(!support_host_);
support_host_ = base::MakeUnique<ArcSupportHost>(profile_);
- support_host_->AddObserver(this);
+ support_host_->SetErrorHandler(this);
}
DCHECK_EQ(State::NOT_INITIALIZED, state_);
@@ -449,7 +449,6 @@ void ArcSessionManager::Shutdown() {
ShutdownSession();
if (support_host_) {
support_host_->Close();
- support_host_->RemoveObserver(this);
support_host_.reset();
}
context_.reset();
@@ -954,33 +953,16 @@ void ArcSessionManager::MaybeReenableArc() {
}
void ArcSessionManager::OnWindowClosed() {
- DCHECK(support_host_);
- if (terms_of_service_negotiator_) {
- // In this case, ArcTermsOfServiceNegotiator should handle the case.
- // Do nothing.
- return;
- }
CancelAuthCode();
}
-void ArcSessionManager::OnTermsAgreed(bool is_metrics_enabled,
- bool is_backup_and_restore_enabled,
- bool is_location_service_enabled) {
- DCHECK(support_host_);
- DCHECK(terms_of_service_negotiator_);
- // This should be handled in ArcTermsOfServiceNegotiator. Do nothing here.
-}
-
void ArcSessionManager::OnRetryClicked() {
DCHECK(support_host_);
UpdateOptInActionUMA(OptInActionType::RETRY);
// TODO(hidehiko): Simplify the retry logic.
- if (terms_of_service_negotiator_) {
- // Currently Terms of service is shown. ArcTermsOfServiceNegotiator should
- // handle this.
- } else if (!profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) {
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) {
MaybeStartTermsOfServiceNegotiation();
} else if (support_host_->ui_page() == ArcSupportHost::UIPage::ERROR &&
!arc_session_runner_->IsStopped()) {

Powered by Google App Engine
This is Rietveld 408576698