| OLD | NEW |
| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "components/policy/core/common/cloud/device_management_service.h" | 11 #include "components/policy/core/common/cloud/device_management_service.h" |
| 12 #include "google_apis/gaia/gaia_constants.h" | 12 #include "google_apis/gaia/gaia_constants.h" |
| 13 #include "google_apis/gaia/gaia_urls.h" | 13 #include "google_apis/gaia/gaia_urls.h" |
| 14 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
| 15 | 15 |
| 16 namespace em = enterprise_management; | 16 namespace em = enterprise_management; |
| 17 | 17 |
| 18 namespace policy { | 18 namespace policy { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Translates the DeviceRegisterResponse::DeviceMode |mode| to the enum used | 22 // Translates the DeviceRegisterResponse::DeviceMode |mode| to the enum used |
| 23 // internally to represent different device modes. | 23 // internally to represent different device modes. |
| 24 DeviceMode TranslateProtobufDeviceMode( | 24 DeviceMode TranslateProtobufDeviceMode( |
| 25 em::DeviceRegisterResponse::DeviceMode mode) { | 25 em::DeviceRegisterResponse::DeviceMode mode) { |
| 26 switch (mode) { | 26 switch (mode) { |
| 27 case em::DeviceRegisterResponse::ENTERPRISE: | 27 case em::DeviceRegisterResponse::ENTERPRISE: |
| 28 return DEVICE_MODE_ENTERPRISE; | 28 return DEVICE_MODE_ENTERPRISE; |
| 29 case em::DeviceRegisterResponse::RETAIL: | 29 case em::DeviceRegisterResponse::RETAIL: |
| 30 return DEVICE_MODE_RETAIL_KIOSK; | 30 return DEVICE_MODE_LEGACY_RETAIL_MODE; |
| 31 } | 31 } |
| 32 LOG(ERROR) << "Unknown enrollment mode in registration response: " << mode; | 32 LOG(ERROR) << "Unknown enrollment mode in registration response: " << mode; |
| 33 return DEVICE_MODE_NOT_SET; | 33 return DEVICE_MODE_NOT_SET; |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool IsChromePolicy(const std::string& type) { | 36 bool IsChromePolicy(const std::string& type) { |
| 37 return type == dm_protocol::kChromeDevicePolicyType || | 37 return type == dm_protocol::kChromeDevicePolicyType || |
| 38 type == GetChromeUserPolicyType(); | 38 type == GetChromeUserPolicyType(); |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 478 |
| 479 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { | 479 void CloudPolicyClient::NotifyRobotAuthCodesFetched() { |
| 480 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); | 480 FOR_EACH_OBSERVER(Observer, observers_, OnRobotAuthCodesFetched(this)); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void CloudPolicyClient::NotifyClientError() { | 483 void CloudPolicyClient::NotifyClientError() { |
| 484 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); | 484 FOR_EACH_OBSERVER(Observer, observers_, OnClientError(this)); |
| 485 } | 485 } |
| 486 | 486 |
| 487 } // namespace policy | 487 } // namespace policy |
| OLD | NEW |