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

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

Issue 2561023002: arc: ARC loading progress should not be shown when started from OOBE. (Closed)
Patch Set: rebased + comments updated Created 3 years, 11 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/optin/arc_terms_of_service_default_negotiator.cc
diff --git a/chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.cc b/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
similarity index 60%
copy from chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.cc
copy to chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
index 8214aa5a26e785c318d8f025bf1b5c23a5790db3..ca0fe339fb59128b7a44c4f9c2dadb84d2084f20 100644
--- a/chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.cc
+++ b/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.cc
@@ -2,18 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.h"
+#include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.h"
#include <string>
-#include "base/callback_helpers.h"
-#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h"
namespace arc {
-ArcTermsOfServiceNegotiator::ArcTermsOfServiceNegotiator(
+ArcTermsOfServiceDefaultNegotiator::ArcTermsOfServiceDefaultNegotiator(
PrefService* pref_service,
ArcSupportHost* support_host)
: pref_service_(pref_service), support_host_(support_host) {
@@ -21,15 +19,12 @@ ArcTermsOfServiceNegotiator::ArcTermsOfServiceNegotiator(
DCHECK(support_host_);
}
-ArcTermsOfServiceNegotiator::~ArcTermsOfServiceNegotiator() {
+ArcTermsOfServiceDefaultNegotiator::~ArcTermsOfServiceDefaultNegotiator() {
support_host_->RemoveObserver(this);
}
-void ArcTermsOfServiceNegotiator::StartNegotiation(
- const NegotiationCallback& callback) {
- DCHECK(pending_callback_.is_null());
+void ArcTermsOfServiceDefaultNegotiator::StartNegotiationImpl() {
DCHECK(!preference_handler_);
- pending_callback_ = callback;
preference_handler_ =
base::MakeUnique<ArcOptInPreferenceHandler>(this, pref_service_);
// This automatically updates all preferences.
@@ -39,22 +34,20 @@ void ArcTermsOfServiceNegotiator::StartNegotiation(
support_host_->ShowTermsOfService();
}
-void ArcTermsOfServiceNegotiator::OnWindowClosed() {
- DCHECK(!pending_callback_.is_null());
+void ArcTermsOfServiceDefaultNegotiator::OnWindowClosed() {
+ // User cancels terms-of-service agreement UI by clicking "Cancel" button
+ // or closing the window directly.
DCHECK(preference_handler_);
support_host_->RemoveObserver(this);
preference_handler_.reset();
- // User cancels terms-of-service agreement UI by clicking "Cancel" button
- // or closing the window directly.
- base::ResetAndReturn(&pending_callback_).Run(false);
+ ReportResult(false);
}
-void ArcTermsOfServiceNegotiator::OnTermsAgreed(
+void ArcTermsOfServiceDefaultNegotiator::OnTermsAgreed(
bool is_metrics_enabled,
bool is_backup_and_restore_enabled,
bool is_location_service_enabled) {
- DCHECK(!pending_callback_.is_null());
DCHECK(preference_handler_);
support_host_->RemoveObserver(this);
@@ -64,34 +57,36 @@ void ArcTermsOfServiceNegotiator::OnTermsAgreed(
preference_handler_->EnableLocationService(is_location_service_enabled);
preference_handler_.reset();
- base::ResetAndReturn(&pending_callback_).Run(true);
+ ReportResult(true);
}
-void ArcTermsOfServiceNegotiator::OnAuthSucceeded(
+void ArcTermsOfServiceDefaultNegotiator::OnAuthSucceeded(
const std::string& auth_code) {
NOTREACHED();
}
-void ArcTermsOfServiceNegotiator::OnRetryClicked() {
+void ArcTermsOfServiceDefaultNegotiator::OnRetryClicked() {
support_host_->ShowTermsOfService();
}
-void ArcTermsOfServiceNegotiator::OnSendFeedbackClicked() {
+void ArcTermsOfServiceDefaultNegotiator::OnSendFeedbackClicked() {
NOTREACHED();
}
-void ArcTermsOfServiceNegotiator::OnMetricsModeChanged(bool enabled,
- bool managed) {
+void ArcTermsOfServiceDefaultNegotiator::OnMetricsModeChanged(bool enabled,
+ bool managed) {
support_host_->SetMetricsPreferenceCheckbox(enabled, managed);
}
-void ArcTermsOfServiceNegotiator::OnBackupAndRestoreModeChanged(bool enabled,
- bool managed) {
+void ArcTermsOfServiceDefaultNegotiator::OnBackupAndRestoreModeChanged(
+ bool enabled,
+ bool managed) {
support_host_->SetBackupAndRestorePreferenceCheckbox(enabled, managed);
}
-void ArcTermsOfServiceNegotiator::OnLocationServicesModeChanged(bool enabled,
- bool managed) {
+void ArcTermsOfServiceDefaultNegotiator::OnLocationServicesModeChanged(
+ bool enabled,
+ bool managed) {
support_host_->SetLocationServicesPreferenceCheckbox(enabled, managed);
}

Powered by Google App Engine
This is Rietveld 408576698