Chromium Code Reviews| 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/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 std::string()); | 827 std::string()); |
| 828 } | 828 } |
| 829 | 829 |
| 830 void UserSessionManager::OnProfileCreated(const UserContext& user_context, | 830 void UserSessionManager::OnProfileCreated(const UserContext& user_context, |
| 831 bool is_incognito_profile, | 831 bool is_incognito_profile, |
| 832 Profile* profile, | 832 Profile* profile, |
| 833 Profile::CreateStatus status) { | 833 Profile::CreateStatus status) { |
| 834 CHECK(profile); | 834 CHECK(profile); |
| 835 | 835 |
| 836 switch (status) { | 836 switch (status) { |
| 837 case Profile::CREATE_STATUS_CREATED: | 837 case Profile::CREATE_STATUS_CREATED: { |
| 838 // Profile created but before initializing extensions and promo resources. | 838 // Profile created but before initializing extensions and promo resources. |
| 839 const user_manager::User* user = | |
| 840 ProfileHelper::Get()->GetUserByProfile(profile); | |
| 841 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP && | |
| 842 profile->IsNewProfile()) { | |
| 843 ChromeUserManager::Get()->SetIsCurrentUserNew(true); | |
| 844 } | |
|
xiyuan
2015/02/26 15:13:18
Think the code should be moved into InitProfilePre
Alexander Alekseev
2015/02/26 15:35:44
Done.
| |
| 845 | |
| 839 InitProfilePreferences(profile, user_context); | 846 InitProfilePreferences(profile, user_context); |
| 840 break; | 847 } break; |
|
xiyuan
2015/02/26 15:13:18
nit: "break" on a separate line.
Alexander Alekseev
2015/02/26 15:35:44
Done.
| |
| 841 case Profile::CREATE_STATUS_INITIALIZED: | 848 case Profile::CREATE_STATUS_INITIALIZED: |
| 842 // Profile is created, extensions and promo resources are initialized. | 849 // Profile is created, extensions and promo resources are initialized. |
| 843 // At this point all other Chrome OS services will be notified that it is | 850 // At this point all other Chrome OS services will be notified that it is |
| 844 // safe to use this profile. | 851 // safe to use this profile. |
| 845 UserProfileInitialized(profile, | 852 UserProfileInitialized(profile, |
| 846 is_incognito_profile, | 853 is_incognito_profile, |
| 847 user_context.GetUserID()); | 854 user_context.GetUserID()); |
| 848 break; | 855 break; |
| 849 case Profile::CREATE_STATUS_LOCAL_FAIL: | 856 case Profile::CREATE_STATUS_LOCAL_FAIL: |
| 850 case Profile::CREATE_STATUS_REMOTE_FAIL: | 857 case Profile::CREATE_STATUS_REMOTE_FAIL: |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1537 default_ime_states_.erase(profile); | 1544 default_ime_states_.erase(profile); |
| 1538 } | 1545 } |
| 1539 | 1546 |
| 1540 void UserSessionManager::InjectStubUserContext( | 1547 void UserSessionManager::InjectStubUserContext( |
| 1541 const UserContext& user_context) { | 1548 const UserContext& user_context) { |
| 1542 injected_user_context_.reset(new UserContext(user_context)); | 1549 injected_user_context_.reset(new UserContext(user_context)); |
| 1543 authenticator_ = NULL; | 1550 authenticator_ = NULL; |
| 1544 } | 1551 } |
| 1545 | 1552 |
| 1546 } // namespace chromeos | 1553 } // namespace chromeos |
| OLD | NEW |