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

Unified Diff: chrome/browser/chromeos/settings/session_manager_operation.cc

Issue 2801993002: Abandon user sign in when policy is retrieved before session started (Closed)
Patch Set: Nit 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/settings/session_manager_operation.cc
diff --git a/chrome/browser/chromeos/settings/session_manager_operation.cc b/chrome/browser/chromeos/settings/session_manager_operation.cc
index ed847589209fa0736305c5404076c0db125bdf0a..819b03829c0d153066ff63132bd9cd644b716803 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation.cc
+++ b/chrome/browser/chromeos/settings/session_manager_operation.cc
@@ -139,20 +139,23 @@ void SessionManagerOperation::RetrieveDeviceSettings() {
void SessionManagerOperation::BlockingRetrieveDeviceSettings() {
ValidateDeviceSettings(
- session_manager_client()->BlockingRetrieveDevicePolicy());
+ session_manager_client()->BlockingRetrieveDevicePolicy(),
+ SessionManagerClient::SUCCESS);
emaxx 2017/04/18 15:03:17 Same comment as was above for DeviceLocalAccountPo
igorcov 2017/04/20 14:52:29 Done.
}
void SessionManagerOperation::ValidateDeviceSettings(
- const std::string& policy_blob) {
+ const std::string& policy_blob,
+ const chromeos::SessionManagerClient::RetrievePolicyResponseType&
+ response_type) {
std::unique_ptr<em::PolicyFetchResponse> policy(
new em::PolicyFetchResponse());
- if (policy_blob.empty()) {
+ if (policy_blob.empty() && response_type == SessionManagerClient::SUCCESS) {
ReportResult(DeviceSettingsService::STORE_NO_POLICY);
return;
}
- if (!policy->ParseFromString(policy_blob) ||
- !policy->IsInitialized()) {
+ if (!policy->ParseFromString(policy_blob) || !policy->IsInitialized() ||
+ response_type != SessionManagerClient::SUCCESS) {
emaxx 2017/04/18 15:03:17 nit: Maybe move the response_type comparison into
igorcov 2017/04/20 14:52:29 Didn't notice that, thanks.
ReportResult(DeviceSettingsService::STORE_INVALID_POLICY);
return;
}

Powered by Google App Engine
This is Rietveld 408576698