| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/stringprintf.h" | 18 #include "base/stringprintf.h" |
| 19 #include "base/time.h" | 19 #include "base/time.h" |
| 20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 21 #include "base/values.h" | 21 #include "base/values.h" |
| 22 #include "crypto/nss_util.h" | 22 #include "crypto/nss_util.h" |
| 23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/browser/chromeos/cros/cert_library.h" |
| 24 #include "chrome/browser/chromeos/cros/cros_library.h" | 25 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 25 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 26 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 26 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 27 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 27 #include "chrome/browser/chromeos/login/default_user_images.h" | 28 #include "chrome/browser/chromeos/login/default_user_images.h" |
| 28 #include "chrome/browser/chromeos/login/login_display.h" | 29 #include "chrome/browser/chromeos/login/login_display.h" |
| 29 #include "chrome/browser/chromeos/login/ownership_service.h" | 30 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 30 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 31 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
| 31 #include "chrome/browser/chromeos/wm_ipc.h" | 32 #include "chrome/browser/chromeos/wm_ipc.h" |
| 32 #include "chrome/browser/defaults.h" | 33 #include "chrome/browser/defaults.h" |
| 33 #include "chrome/browser/prefs/pref_service.h" | 34 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 WmIpc::instance()->SetLoggedInProperty(true); | 767 WmIpc::instance()->SetLoggedInProperty(true); |
| 767 // Ensure we've opened the real user's key/certificate database. | 768 // Ensure we've opened the real user's key/certificate database. |
| 768 crypto::OpenPersistentNSSDB(); | 769 crypto::OpenPersistentNSSDB(); |
| 769 | 770 |
| 770 // Only load the Opencryptoki library into NSS if we have this switch. | 771 // Only load the Opencryptoki library into NSS if we have this switch. |
| 771 // TODO(gspencer): Remove this switch once cryptohomed work is finished: | 772 // TODO(gspencer): Remove this switch once cryptohomed work is finished: |
| 772 // http://crosbug.com/12295 and http://crosbug.com/12304 | 773 // http://crosbug.com/12295 and http://crosbug.com/12304 |
| 773 if (CommandLine::ForCurrentProcess()->HasSwitch( | 774 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 774 switches::kLoadOpencryptoki)) { | 775 switches::kLoadOpencryptoki)) { |
| 775 crypto::EnableTPMTokenForNSS(new RealTPMTokenInfoDelegate()); | 776 crypto::EnableTPMTokenForNSS(new RealTPMTokenInfoDelegate()); |
| 777 CertLibrary* cert_library; |
| 778 cert_library = chromeos::CrosLibrary::Get()->GetCertLibrary(); |
| 779 cert_library->RequestCertificates(); |
| 776 } | 780 } |
| 777 | 781 |
| 778 // Schedules current user ownership check on file thread. | 782 // Schedules current user ownership check on file thread. |
| 779 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 783 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 780 NewRunnableFunction(&CheckOwnership)); | 784 NewRunnableFunction(&CheckOwnership)); |
| 781 } | 785 } |
| 782 | 786 |
| 783 void UserManager::Observe(int type, | 787 void UserManager::Observe(int type, |
| 784 const NotificationSource& source, | 788 const NotificationSource& source, |
| 785 const NotificationDetails& details) { | 789 const NotificationDetails& details) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 813 observer_list_, | 817 observer_list_, |
| 814 LocalStateChanged(this)); | 818 LocalStateChanged(this)); |
| 815 } | 819 } |
| 816 | 820 |
| 817 void UserManager::DownloadProfileImage() { | 821 void UserManager::DownloadProfileImage() { |
| 818 profile_image_downloader_.reset(new ProfileImageDownloader(this)); | 822 profile_image_downloader_.reset(new ProfileImageDownloader(this)); |
| 819 profile_image_downloader_->Start(); | 823 profile_image_downloader_->Start(); |
| 820 } | 824 } |
| 821 | 825 |
| 822 } // namespace chromeos | 826 } // namespace chromeos |
| OLD | NEW |