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

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_provider.cc

Issue 1052673002: Expose kDeviceLoginScreenDomainAutoComplete through CrosSettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 "chrome/browser/chromeos/settings/device_settings_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 kStartUpFlags, 75 kStartUpFlags,
76 kStatsReportingPref, 76 kStatsReportingPref,
77 kSystemTimezonePolicy, 77 kSystemTimezonePolicy,
78 kSystemUse24HourClock, 78 kSystemUse24HourClock,
79 kUpdateDisabled, 79 kUpdateDisabled,
80 kVariationsRestrictParameter, 80 kVariationsRestrictParameter,
81 kDeviceDisabled, 81 kDeviceDisabled,
82 kDeviceDisabledMessage, 82 kDeviceDisabledMessage,
83 kRebootOnShutdown, 83 kRebootOnShutdown,
84 kExtensionCacheSize, 84 kExtensionCacheSize,
85 kDeviceLoginScreenDomainAutoComplete,
85 }; 86 };
86 87
87 bool HasOldMetricsFile() { 88 bool HasOldMetricsFile() {
88 // TODO(pastarmovj): Remove this once migration is not needed anymore. 89 // TODO(pastarmovj): Remove this once migration is not needed anymore.
89 // If the value is not set we should try to migrate legacy consent file. 90 // If the value is not set we should try to migrate legacy consent file.
90 // Loading consent file state causes us to do blocking IO on UI thread. 91 // Loading consent file state causes us to do blocking IO on UI thread.
91 // Temporarily allow it until we fix http://crbug.com/62626 92 // Temporarily allow it until we fix http://crbug.com/62626
92 base::ThreadRestrictions::ScopedAllowIO allow_io; 93 base::ThreadRestrictions::ScopedAllowIO allow_io;
93 return GoogleUpdateSettings::GetCollectStatsConsent(); 94 return GoogleUpdateSettings::GetCollectStatsConsent();
94 } 95 }
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } else { 418 } else {
418 new_values_cache->SetBoolean(kAttestationForContentProtectionEnabled, true); 419 new_values_cache->SetBoolean(kAttestationForContentProtectionEnabled, true);
419 } 420 }
420 421
421 if (policy.has_extension_cache_size() && 422 if (policy.has_extension_cache_size() &&
422 policy.extension_cache_size().has_extension_cache_size()) { 423 policy.extension_cache_size().has_extension_cache_size()) {
423 new_values_cache->SetInteger( 424 new_values_cache->SetInteger(
424 kExtensionCacheSize, 425 kExtensionCacheSize,
425 policy.extension_cache_size().extension_cache_size()); 426 policy.extension_cache_size().extension_cache_size());
426 } 427 }
428
429 // The behavior when policy is not set and when it is set to an empty string
430 // is the same. Thus lets add policy only if it is set and its value is not
431 // an empty string.
432 if (policy.has_login_screen_domain_auto_complete() &&
433 policy.login_screen_domain_auto_complete()
434 .has_login_screen_domain_auto_complete() &&
435 !policy.login_screen_domain_auto_complete()
436 .login_screen_domain_auto_complete()
437 .empty()) {
438 new_values_cache->SetString(kDeviceLoginScreenDomainAutoComplete,
439 policy.login_screen_domain_auto_complete()
440 .login_screen_domain_auto_complete());
441 }
427 } 442 }
428 443
429 void DecodeDeviceState(const em::PolicyData& policy_data, 444 void DecodeDeviceState(const em::PolicyData& policy_data,
430 PrefValueMap* new_values_cache) { 445 PrefValueMap* new_values_cache) {
431 if (!policy_data.has_device_state()) 446 if (!policy_data.has_device_state())
432 return; 447 return;
433 448
434 const em::DeviceState& device_state = policy_data.device_state(); 449 const em::DeviceState& device_state = policy_data.device_state();
435 450
436 if (device_state.device_mode() == em::DeviceState::DEVICE_MODE_DISABLED) 451 if (device_state.device_mode() == em::DeviceState::DEVICE_MODE_DISABLED)
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 void DeviceSettingsProvider::AttemptMigration() { 819 void DeviceSettingsProvider::AttemptMigration() {
805 if (device_settings_service_->HasPrivateOwnerKey()) { 820 if (device_settings_service_->HasPrivateOwnerKey()) {
806 PrefValueMap::const_iterator i; 821 PrefValueMap::const_iterator i;
807 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) 822 for (i = migration_values_.begin(); i != migration_values_.end(); ++i)
808 DoSet(i->first, *i->second); 823 DoSet(i->first, *i->second);
809 migration_values_.Clear(); 824 migration_values_.Clear();
810 } 825 }
811 } 826 }
812 827
813 } // namespace chromeos 828 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698