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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_policy_store.cc

Issue 2890433002: Revert "Abandon user sign in when policy is retrieved before session started." (Closed)
Patch Set: Created 3 years, 7 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/policy/device_local_account_policy_store.cc
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_store.cc b/chrome/browser/chromeos/policy/device_local_account_policy_store.cc
index aaf5315ee1b06bcb0e29760675464c74a7ce0310..31f42df64268d730dab40792c82127a1b18fd5f1 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_store.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_store.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/memory/ptr_util.h"
+#include "chromeos/dbus/session_manager_client.h"
#include "components/ownership/owner_key_util.h"
#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/external_data_fetcher.h"
@@ -17,9 +18,6 @@
#include "components/policy/proto/cloud_policy.pb.h"
#include "components/policy/proto/device_management_backend.pb.h"
-using RetrievePolicyResponseType =
- chromeos::SessionManagerClient::RetrievePolicyResponseType;
-
namespace em = enterprise_management;
namespace policy {
@@ -58,12 +56,10 @@ void DeviceLocalAccountPolicyStore::LoadImmediately() {
// Cancel all running async loads.
weak_factory_.InvalidateWeakPtrs();
- std::string policy_blob;
- RetrievePolicyResponseType response =
+ const std::string policy_blob =
session_manager_client_->BlockingRetrieveDeviceLocalAccountPolicy(
- account_id_, &policy_blob);
- ValidateLoadedPolicyBlob(false /*validate_in_background*/, policy_blob,
- response);
+ account_id_);
+ ValidateLoadedPolicyBlob(false /*validate_in_background*/, policy_blob);
}
void DeviceLocalAccountPolicyStore::Store(
@@ -78,10 +74,8 @@ void DeviceLocalAccountPolicyStore::Store(
void DeviceLocalAccountPolicyStore::ValidateLoadedPolicyBlob(
bool validate_in_background,
- const std::string& policy_blob,
- RetrievePolicyResponseType response_type) {
- if (response_type != RetrievePolicyResponseType::SUCCESS ||
- policy_blob.empty()) {
+ const std::string& policy_blob) {
+ if (policy_blob.empty()) {
status_ = CloudPolicyStore::STATUS_LOAD_ERROR;
NotifyStoreError();
} else {

Powered by Google App Engine
This is Rietveld 408576698