OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/users/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/user_manager_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" | 36 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" |
37 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" | 37 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" |
38 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 38 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
39 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" | 39 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" |
40 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" | 40 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
42 #include "chrome/browser/chromeos/policy/device_local_account.h" | 42 #include "chrome/browser/chromeos/policy/device_local_account.h" |
43 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog. h" | 43 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog. h" |
44 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 44 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
45 #include "chrome/browser/chromeos/session_length_limiter.h" | 45 #include "chrome/browser/chromeos/session_length_limiter.h" |
46 #include "chrome/browser/net/crl_set_fetcher.h" | |
46 #include "chrome/browser/profiles/profile.h" | 47 #include "chrome/browser/profiles/profile.h" |
47 #include "chrome/browser/supervised_user/chromeos/manager_password_service_facto ry.h" | 48 #include "chrome/browser/supervised_user/chromeos/manager_password_service_facto ry.h" |
48 #include "chrome/browser/supervised_user/chromeos/supervised_user_password_servi ce_factory.h" | 49 #include "chrome/browser/supervised_user/chromeos/supervised_user_password_servi ce_factory.h" |
49 #include "chrome/common/chrome_constants.h" | 50 #include "chrome/common/chrome_constants.h" |
50 #include "chrome/common/chrome_paths.h" | 51 #include "chrome/common/chrome_paths.h" |
51 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
52 #include "chrome/common/crash_keys.h" | 53 #include "chrome/common/crash_keys.h" |
53 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
54 #include "chromeos/chromeos_switches.h" | 55 #include "chromeos/chromeos_switches.h" |
55 #include "chromeos/cryptohome/async_method_caller.h" | 56 #include "chromeos/cryptohome/async_method_caller.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 DCHECK(active_user_); | 433 DCHECK(active_user_); |
433 active_user_->set_is_logged_in(true); | 434 active_user_->set_is_logged_in(true); |
434 active_user_->set_is_active(true); | 435 active_user_->set_is_active(true); |
435 active_user_->set_username_hash(username_hash); | 436 active_user_->set_username_hash(username_hash); |
436 | 437 |
437 // Place user who just signed in to the top of the logged in users. | 438 // Place user who just signed in to the top of the logged in users. |
438 logged_in_users_.insert(logged_in_users_.begin(), active_user_); | 439 logged_in_users_.insert(logged_in_users_.begin(), active_user_); |
439 SetLRUUser(active_user_); | 440 SetLRUUser(active_user_); |
440 | 441 |
441 if (!primary_user_) { | 442 if (!primary_user_) { |
443 // Register CRLSet now that the home dir is mounted. | |
444 base::FilePath path; | |
445 if (!username_hash.empty() && | |
446 PathService::Get(chrome::DIR_USER_DATA, &path)) { | |
447 path = path.Append( | |
448 chromeos::ProfileHelper::GetUserProfileDir(username_hash)); | |
xiyuan
2014/07/18 19:38:27
You can use ProfileHelper::GetProfilePathByUserIdH
leecam
2014/07/19 06:36:39
I tried this call first but it uses the profile ma
xiyuan
2014/07/21 16:37:59
GetProfilePathByUserIdHash only needs the user_dat
| |
449 component_updater::ComponentUpdateService* cus = | |
450 g_browser_process->component_updater(); | |
451 CRLSetFetcher* crl_set = g_browser_process->crl_set_fetcher(); | |
452 if (crl_set && cus) | |
453 crl_set->StartInitialLoad(cus, path); | |
454 } | |
442 primary_user_ = active_user_; | 455 primary_user_ = active_user_; |
443 if (primary_user_->GetType() == user_manager::USER_TYPE_REGULAR) | 456 if (primary_user_->GetType() == user_manager::USER_TYPE_REGULAR) |
444 SendRegularUserLoginMetrics(user_id); | 457 SendRegularUserLoginMetrics(user_id); |
445 } | 458 } |
446 | 459 |
447 UMA_HISTOGRAM_ENUMERATION("UserManager.LoginUserType", | 460 UMA_HISTOGRAM_ENUMERATION("UserManager.LoginUserType", |
448 active_user_->GetType(), | 461 active_user_->GetType(), |
449 user_manager::NUM_USER_TYPES); | 462 user_manager::NUM_USER_TYPES); |
450 | 463 |
451 g_browser_process->local_state()->SetString( | 464 g_browser_process->local_state()->SetString( |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1773 } | 1786 } |
1774 | 1787 |
1775 void UserManagerImpl::DeleteUser(User* user) { | 1788 void UserManagerImpl::DeleteUser(User* user) { |
1776 const bool is_active_user = (user == active_user_); | 1789 const bool is_active_user = (user == active_user_); |
1777 delete user; | 1790 delete user; |
1778 if (is_active_user) | 1791 if (is_active_user) |
1779 active_user_ = NULL; | 1792 active_user_ = NULL; |
1780 } | 1793 } |
1781 | 1794 |
1782 } // namespace chromeos | 1795 } // namespace chromeos |
OLD | NEW |