| 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/chrome_user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 } | 757 } |
| 758 } | 758 } |
| 759 std::string kiosk_app_id; | 759 std::string kiosk_app_id; |
| 760 if (account) { | 760 if (account) { |
| 761 kiosk_app_id = account->kiosk_app_id; | 761 kiosk_app_id = account->kiosk_app_id; |
| 762 } else { | 762 } else { |
| 763 LOG(ERROR) << "Logged into nonexistent kiosk-app account: " << app_id; | 763 LOG(ERROR) << "Logged into nonexistent kiosk-app account: " << app_id; |
| 764 NOTREACHED(); | 764 NOTREACHED(); |
| 765 } | 765 } |
| 766 | 766 |
| 767 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 767 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 768 command_line->AppendSwitch(::switches::kForceAppMode); | 768 command_line->AppendSwitch(::switches::kForceAppMode); |
| 769 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); | 769 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); |
| 770 | 770 |
| 771 // Disable window animation since kiosk app runs in a single full screen | 771 // Disable window animation since kiosk app runs in a single full screen |
| 772 // window and window animation causes start-up janks. | 772 // window and window animation causes start-up janks. |
| 773 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); | 773 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); |
| 774 } | 774 } |
| 775 | 775 |
| 776 void ChromeUserManagerImpl::DemoAccountLoggedIn() { | 776 void ChromeUserManagerImpl::DemoAccountLoggedIn() { |
| 777 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 777 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 778 active_user_ = | 778 active_user_ = |
| 779 user_manager::User::CreateKioskAppUser(DemoAppLauncher::kDemoUserName); | 779 user_manager::User::CreateKioskAppUser(DemoAppLauncher::kDemoUserName); |
| 780 active_user_->SetStubImage( | 780 active_user_->SetStubImage( |
| 781 user_manager::UserImage( | 781 user_manager::UserImage( |
| 782 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 782 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 783 IDR_PROFILE_PICTURE_LOADING)), | 783 IDR_PROFILE_PICTURE_LOADING)), |
| 784 user_manager::User::USER_IMAGE_INVALID, | 784 user_manager::User::USER_IMAGE_INVALID, |
| 785 false); | 785 false); |
| 786 #if !defined(USE_ATHENA) | 786 #if !defined(USE_ATHENA) |
| 787 WallpaperManager::Get()->SetUserWallpaperNow(DemoAppLauncher::kDemoUserName); | 787 WallpaperManager::Get()->SetUserWallpaperNow(DemoAppLauncher::kDemoUserName); |
| 788 #endif | 788 #endif |
| 789 | 789 |
| 790 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 790 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 791 command_line->AppendSwitch(::switches::kForceAppMode); | 791 command_line->AppendSwitch(::switches::kForceAppMode); |
| 792 command_line->AppendSwitchASCII(::switches::kAppId, | 792 command_line->AppendSwitchASCII(::switches::kAppId, |
| 793 DemoAppLauncher::kDemoAppId); | 793 DemoAppLauncher::kDemoAppId); |
| 794 | 794 |
| 795 // Disable window animation since the demo app runs in a single full screen | 795 // Disable window animation since the demo app runs in a single full screen |
| 796 // window and window animation causes start-up janks. | 796 // window and window animation causes start-up janks. |
| 797 CommandLine::ForCurrentProcess()->AppendSwitch( | 797 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 798 wm::switches::kWindowAnimationsDisabled); | 798 wm::switches::kWindowAnimationsDisabled); |
| 799 } | 799 } |
| 800 | 800 |
| 801 void ChromeUserManagerImpl::NotifyOnLogin() { | 801 void ChromeUserManagerImpl::NotifyOnLogin() { |
| 802 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 802 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 803 | 803 |
| 804 UserSessionManager::OverrideHomedir(); | 804 UserSessionManager::OverrideHomedir(); |
| 805 UpdateNumberOfUsers(); | 805 UpdateNumberOfUsers(); |
| 806 | 806 |
| 807 ChromeUserManager::NotifyOnLogin(); | 807 ChromeUserManager::NotifyOnLogin(); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 ash::MultiProfileUMA::RecordUserCount(users); | 1071 ash::MultiProfileUMA::RecordUserCount(users); |
| 1072 } | 1072 } |
| 1073 #endif | 1073 #endif |
| 1074 | 1074 |
| 1075 base::debug::SetCrashKeyValue( | 1075 base::debug::SetCrashKeyValue( |
| 1076 crash_keys::kNumberOfUsers, | 1076 crash_keys::kNumberOfUsers, |
| 1077 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 1077 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 } // namespace chromeos | 1080 } // namespace chromeos |
| OLD | NEW |