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

Unified Diff: chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc

Issue 2844383006: Turn ArcSupportHost from Observer model to Delegate (Closed)
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
diff --git a/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc b/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
index ca0fe339fb59128b7a44c4f9c2dadb84d2084f20..b0236fb91a794f5f3f2ffc4b17b5c2c9f7134046 100644
--- a/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
+++ b/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
@@ -20,7 +20,7 @@ ArcTermsOfServiceDefaultNegotiator::ArcTermsOfServiceDefaultNegotiator(
}
ArcTermsOfServiceDefaultNegotiator::~ArcTermsOfServiceDefaultNegotiator() {
- support_host_->RemoveObserver(this);
+ support_host_->SetTermsOfServiceDelegate(nullptr);
}
void ArcTermsOfServiceDefaultNegotiator::StartNegotiationImpl() {
@@ -30,15 +30,15 @@ void ArcTermsOfServiceDefaultNegotiator::StartNegotiationImpl() {
// This automatically updates all preferences.
preference_handler_->Start();
- support_host_->AddObserver(this);
+ support_host_->SetTermsOfServiceDelegate(this);
support_host_->ShowTermsOfService();
}
-void ArcTermsOfServiceDefaultNegotiator::OnWindowClosed() {
+void ArcTermsOfServiceDefaultNegotiator::OnTermsRejected() {
// User cancels terms-of-service agreement UI by clicking "Cancel" button
// or closing the window directly.
DCHECK(preference_handler_);
- support_host_->RemoveObserver(this);
+ support_host_->SetTermsOfServiceDelegate(nullptr);
preference_handler_.reset();
ReportResult(false);
@@ -49,7 +49,7 @@ void ArcTermsOfServiceDefaultNegotiator::OnTermsAgreed(
bool is_backup_and_restore_enabled,
bool is_location_service_enabled) {
DCHECK(preference_handler_);
- support_host_->RemoveObserver(this);
+ support_host_->SetTermsOfServiceDelegate(nullptr);
// Update the preferences with the value passed from UI.
preference_handler_->EnableMetrics(is_metrics_enabled);
@@ -60,19 +60,10 @@ void ArcTermsOfServiceDefaultNegotiator::OnTermsAgreed(
ReportResult(true);
}
-void ArcTermsOfServiceDefaultNegotiator::OnAuthSucceeded(
- const std::string& auth_code) {
- NOTREACHED();
-}
-
-void ArcTermsOfServiceDefaultNegotiator::OnRetryClicked() {
+void ArcTermsOfServiceDefaultNegotiator::OnTermsRetryClicked() {
support_host_->ShowTermsOfService();
}
-void ArcTermsOfServiceDefaultNegotiator::OnSendFeedbackClicked() {
- NOTREACHED();
-}
-
void ArcTermsOfServiceDefaultNegotiator::OnMetricsModeChanged(bool enabled,
bool managed) {
support_host_->SetMetricsPreferenceCheckbox(enabled, managed);
« no previous file with comments | « chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698