OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/user_manager.h" | 5 #include "chrome/browser/chromeos/login/user_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/rand_util.h" | 18 #include "base/rand_util.h" |
19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
20 #include "base/stringprintf.h" | 20 #include "base/stringprintf.h" |
21 #include "base/task.h" | 21 #include "base/task.h" |
22 #include "base/time.h" | 22 #include "base/time.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "base/values.h" | 24 #include "base/values.h" |
25 #include "crypto/nss_util.h" | 25 #include "crypto/nss_util.h" |
26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/chromeos/cros/cert_library.h" | |
28 #include "chrome/browser/chromeos/cros/cros_library.h" | 27 #include "chrome/browser/chromeos/cros/cros_library.h" |
29 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 28 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
30 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
31 #include "chrome/browser/chromeos/login/default_user_images.h" | 30 #include "chrome/browser/chromeos/login/default_user_images.h" |
32 #include "chrome/browser/chromeos/login/login_display.h" | 31 #include "chrome/browser/chromeos/login/login_display.h" |
33 #include "chrome/browser/chromeos/login/ownership_service.h" | 32 #include "chrome/browser/chromeos/login/ownership_service.h" |
34 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 33 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
35 #include "chrome/browser/defaults.h" | 34 #include "chrome/browser/defaults.h" |
36 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
37 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 36 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 775 |
777 // Ensure we've opened the real user's key/certificate database. | 776 // Ensure we've opened the real user's key/certificate database. |
778 crypto::OpenPersistentNSSDB(); | 777 crypto::OpenPersistentNSSDB(); |
779 | 778 |
780 // Only load the Opencryptoki library into NSS if we have this switch. | 779 // Only load the Opencryptoki library into NSS if we have this switch. |
781 // TODO(gspencer): Remove this switch once cryptohomed work is finished: | 780 // TODO(gspencer): Remove this switch once cryptohomed work is finished: |
782 // http://crosbug.com/12295 and http://crosbug.com/12304 | 781 // http://crosbug.com/12295 and http://crosbug.com/12304 |
783 if (CommandLine::ForCurrentProcess()->HasSwitch( | 782 if (CommandLine::ForCurrentProcess()->HasSwitch( |
784 switches::kLoadOpencryptoki)) { | 783 switches::kLoadOpencryptoki)) { |
785 crypto::EnableTPMTokenForNSS(new RealTPMTokenInfoDelegate()); | 784 crypto::EnableTPMTokenForNSS(new RealTPMTokenInfoDelegate()); |
786 CertLibrary* cert_library; | |
787 cert_library = chromeos::CrosLibrary::Get()->GetCertLibrary(); | |
788 cert_library->RequestCertificates(); | |
789 } | 785 } |
790 | 786 |
791 // Schedules current user ownership check on file thread. | 787 // Schedules current user ownership check on file thread. |
792 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 788 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
793 base::Bind(&UserManager::CheckOwnership, | 789 base::Bind(&UserManager::CheckOwnership, |
794 base::Unretained(this))); | 790 base::Unretained(this))); |
795 } | 791 } |
796 | 792 |
797 void UserManager::Observe(int type, | 793 void UserManager::Observe(int type, |
798 const NotificationSource& source, | 794 const NotificationSource& source, |
(...skipping 29 matching lines...) Expand all Loading... |
828 observer_list_, | 824 observer_list_, |
829 LocalStateChanged(this)); | 825 LocalStateChanged(this)); |
830 } | 826 } |
831 | 827 |
832 void UserManager::DownloadProfileImage() { | 828 void UserManager::DownloadProfileImage() { |
833 profile_image_downloader_.reset(new ProfileImageDownloader(this)); | 829 profile_image_downloader_.reset(new ProfileImageDownloader(this)); |
834 profile_image_downloader_->Start(); | 830 profile_image_downloader_->Start(); |
835 } | 831 } |
836 | 832 |
837 } // namespace chromeos | 833 } // namespace chromeos |
OLD | NEW |