Chromium Code Reviews| 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 "chrome/browser/chromeos/settings/device_settings_provider.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 kDeviceAttestationEnabled, | 63 kDeviceAttestationEnabled, |
| 64 kDeviceDisabled, | 64 kDeviceDisabled, |
| 65 kDeviceDisabledMessage, | 65 kDeviceDisabledMessage, |
| 66 kDeviceOwner, | 66 kDeviceOwner, |
| 67 kDeviceQuirksDownloadEnabled, | 67 kDeviceQuirksDownloadEnabled, |
| 68 kDisplayRotationDefault, | 68 kDisplayRotationDefault, |
| 69 kExtensionCacheSize, | 69 kExtensionCacheSize, |
| 70 kHeartbeatEnabled, | 70 kHeartbeatEnabled, |
| 71 kHeartbeatFrequency, | 71 kHeartbeatFrequency, |
| 72 kLoginAuthenticationBehavior, | 72 kLoginAuthenticationBehavior, |
| 73 kLoginVideoCaptureAllowedUrls, | |
| 73 kPolicyMissingMitigationMode, | 74 kPolicyMissingMitigationMode, |
| 74 kRebootOnShutdown, | 75 kRebootOnShutdown, |
| 75 kReleaseChannel, | 76 kReleaseChannel, |
| 76 kReleaseChannelDelegated, | 77 kReleaseChannelDelegated, |
| 77 kReportDeviceActivityTimes, | 78 kReportDeviceActivityTimes, |
| 78 kReportDeviceBootMode, | 79 kReportDeviceBootMode, |
| 79 kReportDeviceHardwareStatus, | 80 kReportDeviceHardwareStatus, |
| 80 kReportDeviceLocation, | 81 kReportDeviceLocation, |
| 81 kReportDeviceNetworkInterfaces, | 82 kReportDeviceNetworkInterfaces, |
| 82 kReportDeviceSessionStatus, | 83 kReportDeviceSessionStatus, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 .login_screen_domain_auto_complete()); | 264 .login_screen_domain_auto_complete()); |
| 264 } | 265 } |
| 265 | 266 |
| 266 if (policy.has_login_authentication_behavior() && | 267 if (policy.has_login_authentication_behavior() && |
| 267 policy.login_authentication_behavior() | 268 policy.login_authentication_behavior() |
| 268 .has_login_authentication_behavior()) { | 269 .has_login_authentication_behavior()) { |
| 269 new_values_cache->SetInteger( | 270 new_values_cache->SetInteger( |
| 270 kLoginAuthenticationBehavior, | 271 kLoginAuthenticationBehavior, |
| 271 policy.login_authentication_behavior().login_authentication_behavior()); | 272 policy.login_authentication_behavior().login_authentication_behavior()); |
| 272 } | 273 } |
| 274 | |
| 275 if (policy.has_login_video_capture_allowed_urls()) { | |
| 276 std::unique_ptr<base::ListValue> list(new base::ListValue()); | |
|
bartfab (slow)
2016/05/02 10:30:29
Nit: #include <memory>
Kevin Cernekee
2016/05/02 20:02:29
Done.
| |
| 277 const em::LoginVideoCaptureAllowedUrlsProto& | |
| 278 login_video_capture_allowed_urls_proto = | |
| 279 policy.login_video_capture_allowed_urls(); | |
| 280 const RepeatedPtrField<std::string>& urls = | |
| 281 login_video_capture_allowed_urls_proto.urls(); | |
| 282 for (RepeatedPtrField<std::string>::const_iterator it = urls.begin(); | |
|
emaxx
2016/05/02 18:42:08
Nit: Can the range-based for loop be used here?
Kevin Cernekee
2016/05/02 20:02:29
Done.
| |
| 283 it != urls.end(); ++it) { | |
| 284 list->Append(new base::StringValue(*it)); | |
| 285 } | |
| 286 new_values_cache->SetValue(kLoginVideoCaptureAllowedUrls, std::move(list)); | |
|
bartfab (slow)
2016/05/02 10:30:29
Nit: #include <utility>
Kevin Cernekee
2016/05/02 20:02:29
Done.
| |
| 287 } | |
| 273 } | 288 } |
| 274 | 289 |
| 275 void DecodeNetworkPolicies( | 290 void DecodeNetworkPolicies( |
| 276 const em::ChromeDeviceSettingsProto& policy, | 291 const em::ChromeDeviceSettingsProto& policy, |
| 277 PrefValueMap* new_values_cache) { | 292 PrefValueMap* new_values_cache) { |
| 278 // kSignedDataRoamingEnabled has a default value of false. | 293 // kSignedDataRoamingEnabled has a default value of false. |
| 279 new_values_cache->SetBoolean( | 294 new_values_cache->SetBoolean( |
| 280 kSignedDataRoamingEnabled, | 295 kSignedDataRoamingEnabled, |
| 281 policy.has_data_roaming_enabled() && | 296 policy.has_data_roaming_enabled() && |
| 282 policy.data_roaming_enabled().has_data_roaming_enabled() && | 297 policy.data_roaming_enabled().has_data_roaming_enabled() && |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 | 584 |
| 570 // Set the cache to the updated value. | 585 // Set the cache to the updated value. |
| 571 UpdateValuesCache(data, device_settings_, TEMPORARILY_UNTRUSTED); | 586 UpdateValuesCache(data, device_settings_, TEMPORARILY_UNTRUSTED); |
| 572 | 587 |
| 573 if (!device_settings_cache::Store(data, g_browser_process->local_state())) { | 588 if (!device_settings_cache::Store(data, g_browser_process->local_state())) { |
| 574 LOG(ERROR) << "Couldn't store to the temp storage."; | 589 LOG(ERROR) << "Couldn't store to the temp storage."; |
| 575 NotifyObservers(path); | 590 NotifyObservers(path); |
| 576 return; | 591 return; |
| 577 } | 592 } |
| 578 } | 593 } |
| 579 | |
| 580 } | 594 } |
| 581 | 595 |
| 582 void DeviceSettingsProvider::OwnershipStatusChanged() { | 596 void DeviceSettingsProvider::OwnershipStatusChanged() { |
| 583 DeviceSettingsService::OwnershipStatus new_ownership_status = | 597 DeviceSettingsService::OwnershipStatus new_ownership_status = |
| 584 device_settings_service_->GetOwnershipStatus(); | 598 device_settings_service_->GetOwnershipStatus(); |
| 585 | 599 |
| 586 if (device_settings_service_->GetOwnerSettingsService()) | 600 if (device_settings_service_->GetOwnerSettingsService()) |
| 587 device_settings_service_->GetOwnerSettingsService()->AddObserver(this); | 601 device_settings_service_->GetOwnerSettingsService()->AddObserver(this); |
| 588 | 602 |
| 589 // If the device just became owned, write the settings accumulated in the | 603 // If the device just became owned, write the settings accumulated in the |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 816 // Notify the observers we are done. | 830 // Notify the observers we are done. |
| 817 std::vector<base::Closure> callbacks; | 831 std::vector<base::Closure> callbacks; |
| 818 callbacks.swap(callbacks_); | 832 callbacks.swap(callbacks_); |
| 819 for (size_t i = 0; i < callbacks.size(); ++i) | 833 for (size_t i = 0; i < callbacks.size(); ++i) |
| 820 callbacks[i].Run(); | 834 callbacks[i].Run(); |
| 821 | 835 |
| 822 return settings_loaded; | 836 return settings_loaded; |
| 823 } | 837 } |
| 824 | 838 |
| 825 } // namespace chromeos | 839 } // namespace chromeos |
| OLD | NEW |