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

Side by Side Diff: components/policy/core/common/cloud/cloud_policy_client.cc

Issue 2407163005: Partial sync of device_management_backened.proto with server version. (Closed)
Patch Set: Update DeviceMode. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/policy/core/common/cloud/cloud_policy_client.h" 5 #include "components/policy/core/common/cloud/cloud_policy_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // Translates the DeviceRegisterResponse::DeviceMode |mode| to the enum used 26 // Translates the DeviceRegisterResponse::DeviceMode |mode| to the enum used
27 // internally to represent different device modes. 27 // internally to represent different device modes.
28 DeviceMode TranslateProtobufDeviceMode( 28 DeviceMode TranslateProtobufDeviceMode(
29 em::DeviceRegisterResponse::DeviceMode mode) { 29 em::DeviceRegisterResponse::DeviceMode mode) {
30 switch (mode) { 30 switch (mode) {
31 case em::DeviceRegisterResponse::ENTERPRISE: 31 case em::DeviceRegisterResponse::ENTERPRISE:
32 return DEVICE_MODE_ENTERPRISE; 32 return DEVICE_MODE_ENTERPRISE;
33 case em::DeviceRegisterResponse::RETAIL: 33 case em::DeviceRegisterResponse::RETAIL:
34 return DEVICE_MODE_LEGACY_RETAIL_MODE; 34 return DEVICE_MODE_LEGACY_RETAIL_MODE;
35 case em::DeviceRegisterResponse::CHROME_AD:
36 return DEVICE_MODE_ENTERPRISE_AD;
35 } 37 }
36 LOG(ERROR) << "Unknown enrollment mode in registration response: " << mode; 38 LOG(ERROR) << "Unknown enrollment mode in registration response: " << mode;
37 return DEVICE_MODE_NOT_SET; 39 return DEVICE_MODE_NOT_SET;
38 } 40 }
39 41
40 bool IsChromePolicy(const std::string& type) { 42 bool IsChromePolicy(const std::string& type) {
41 return type == dm_protocol::kChromeDevicePolicyType || 43 return type == dm_protocol::kChromeDevicePolicyType ||
42 type == dm_protocol::kChromeUserPolicyType; 44 type == dm_protocol::kChromeUserPolicyType;
43 } 45 }
44 46
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 778
777 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { 779 void CloudPolicyClient::NotifyRobotAuthCodesFetched() {
778 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); 780 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this));
779 } 781 }
780 782
781 void CloudPolicyClient::NotifyClientError() { 783 void CloudPolicyClient::NotifyClientError() {
782 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); 784 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this));
783 } 785 }
784 786
785 } // namespace policy 787 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698