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

Unified Diff: components/policy/core/common/cloud/cloud_policy_service.cc

Issue 814123006: Revert of Implemented consumer management unenrollment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dcpm
Patch Set: Created 5 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: components/policy/core/common/cloud/cloud_policy_service.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_service.cc b/components/policy/core/common/cloud/cloud_policy_service.cc
index e79a52534d968b01e613c27a4b1c81686571e44b..b09e69d0cc34ec813bffba89d7b12cf3b8da9cde 100644
--- a/components/policy/core/common/cloud/cloud_policy_service.cc
+++ b/components/policy/core/common/cloud/cloud_policy_service.cc
@@ -5,7 +5,6 @@
#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "base/callback.h"
-#include "base/logging.h"
#include "policy/proto/device_management_backend.pb.h"
namespace em = enterprise_management;
@@ -21,7 +20,6 @@
client_(client),
store_(store),
refresh_state_(REFRESH_NONE),
- unregister_state_(UNREGISTER_NONE),
initialization_complete_(false) {
client_->AddPolicyTypeToFetch(policy_type_, settings_entity_id_);
client_->AddObserver(this);
@@ -50,8 +48,8 @@
}
void CloudPolicyService::RefreshPolicy(const RefreshPolicyCallback& callback) {
- // If the client is not registered or is unregistering, bail out.
- if (!client_->is_registered() || unregister_state_ != UNREGISTER_NONE) {
+ // If the client is not registered, bail out.
+ if (!client_->is_registered()) {
callback.Run(false);
return;
}
@@ -60,20 +58,6 @@
refresh_callbacks_.push_back(callback);
refresh_state_ = REFRESH_POLICY_FETCH;
client_->FetchPolicy();
-}
-
-void CloudPolicyService::Unregister(const UnregisterCallback& callback) {
- // Abort all pending refresh requests.
- if (refresh_state_ != REFRESH_NONE)
- RefreshCompleted(false);
-
- // Abort previous unregister request if any.
- if (unregister_state_ != UNREGISTER_NONE)
- UnregisterCompleted(false);
-
- unregister_callback_ = callback;
- unregister_state_ = UNREGISTER_PENDING;
- client_->Unregister();
}
void CloudPolicyService::OnPolicyFetched(CloudPolicyClient* client) {
@@ -94,15 +78,11 @@
}
void CloudPolicyService::OnRegistrationStateChanged(CloudPolicyClient* client) {
- if (unregister_state_ == UNREGISTER_PENDING)
- UnregisterCompleted(true);
}
void CloudPolicyService::OnClientError(CloudPolicyClient* client) {
if (refresh_state_ == REFRESH_POLICY_FETCH)
RefreshCompleted(false);
- if (unregister_state_ == UNREGISTER_PENDING)
- UnregisterCompleted(false);
}
void CloudPolicyService::OnStoreLoaded(CloudPolicyStore* store) {
@@ -172,15 +152,6 @@
}
}
-void CloudPolicyService::UnregisterCompleted(bool success) {
- if (!success)
- LOG(ERROR) << "Unregister request failed.";
-
- unregister_state_ = UNREGISTER_NONE;
- unregister_callback_.Run(success);
- unregister_callback_ = UnregisterCallback(); // Reset.
-}
-
void CloudPolicyService::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}

Powered by Google App Engine
This is Rietveld 408576698