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

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

Issue 14927015: Translate device-local account IDs to user IDs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Kiosk apps fixed. Created 7 years, 7 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 | Annotate | Revision Log
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/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/threading/thread_restrictions.h" 15 #include "base/threading/thread_restrictions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chromeos/cros/cros_library.h" 18 #include "chrome/browser/chromeos/cros/cros_library.h"
19 #include "chrome/browser/chromeos/cros/network_library.h" 19 #include "chrome/browser/chromeos/cros/network_library.h"
20 #include "chrome/browser/chromeos/policy/device_local_account.h"
20 #include "chrome/browser/chromeos/settings/cros_settings.h" 21 #include "chrome/browser/chromeos/settings/cros_settings.h"
21 #include "chrome/browser/chromeos/settings/cros_settings_names.h" 22 #include "chrome/browser/chromeos/settings/cros_settings_names.h"
22 #include "chrome/browser/chromeos/settings/device_settings_cache.h" 23 #include "chrome/browser/chromeos/settings/device_settings_cache.h"
23 #include "chrome/browser/policy/browser_policy_connector.h" 24 #include "chrome/browser/policy/browser_policy_connector.h"
24 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" 25 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
25 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 26 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
26 #include "chrome/browser/ui/options/options_util.h" 27 #include "chrome/browser/ui/options/options_util.h"
27 #include "chrome/installer/util/google_update_settings.h" 28 #include "chrome/installer/util/google_update_settings.h"
28 #include "chromeos/chromeos_switches.h" 29 #include "chromeos/chromeos_switches.h"
29 30
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, 494 kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL,
494 entry->kiosk_app().update_url()); 495 entry->kiosk_app().update_url());
495 } 496 }
496 } else if (entry->has_deprecated_public_session_id()) { 497 } else if (entry->has_deprecated_public_session_id()) {
497 // Deprecated public session specification. 498 // Deprecated public session specification.
498 entry_dict->SetStringWithoutPathExpansion( 499 entry_dict->SetStringWithoutPathExpansion(
499 kAccountsPrefDeviceLocalAccountsKeyId, 500 kAccountsPrefDeviceLocalAccountsKeyId,
500 entry->deprecated_public_session_id()); 501 entry->deprecated_public_session_id());
501 entry_dict->SetIntegerWithoutPathExpansion( 502 entry_dict->SetIntegerWithoutPathExpansion(
502 kAccountsPrefDeviceLocalAccountsKeyType, 503 kAccountsPrefDeviceLocalAccountsKeyType,
503 DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION); 504 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION);
504 } 505 }
505 account_list->Append(entry_dict.release()); 506 account_list->Append(entry_dict.release());
506 } 507 }
507 } 508 }
508 new_values_cache->SetValue(kAccountsPrefDeviceLocalAccounts, 509 new_values_cache->SetValue(kAccountsPrefDeviceLocalAccounts,
509 account_list.release()); 510 account_list.release());
510 511
511 if (policy.has_device_local_accounts()) { 512 if (policy.has_device_local_accounts()) {
512 if (policy.device_local_accounts().has_auto_login_id()) { 513 if (policy.device_local_accounts().has_auto_login_id()) {
513 new_values_cache->SetString( 514 new_values_cache->SetString(
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 void DeviceSettingsProvider::AttemptMigration() { 939 void DeviceSettingsProvider::AttemptMigration() {
939 if (device_settings_service_->HasPrivateOwnerKey()) { 940 if (device_settings_service_->HasPrivateOwnerKey()) {
940 PrefValueMap::const_iterator i; 941 PrefValueMap::const_iterator i;
941 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) 942 for (i = migration_values_.begin(); i != migration_values_.end(); ++i)
942 DoSet(i->first, *i->second); 943 DoSet(i->first, *i->second);
943 migration_values_.Clear(); 944 migration_values_.Clear();
944 } 945 }
945 } 946 }
946 947
947 } // namespace chromeos 948 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698