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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <set> | 10 #include <set> |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 device_local_account_policy_service_ = | 441 device_local_account_policy_service_ = |
442 connector->GetDeviceLocalAccountPolicyService(); | 442 connector->GetDeviceLocalAccountPolicyService(); |
443 if (device_local_account_policy_service_) | 443 if (device_local_account_policy_service_) |
444 device_local_account_policy_service_->AddObserver(this); | 444 device_local_account_policy_service_->AddObserver(this); |
445 } | 445 } |
446 RetrieveTrustedDevicePolicies(); | 446 RetrieveTrustedDevicePolicies(); |
447 UpdateOwnership(); | 447 UpdateOwnership(); |
448 break; | 448 break; |
449 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: { | 449 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: { |
450 Profile* profile = content::Details<Profile>(details).ptr(); | 450 Profile* profile = content::Details<Profile>(details).ptr(); |
451 if (IsUserLoggedIn() && !IsLoggedInAsGuest() && !IsLoggedInAsKioskApp()) { | 451 if (IsUserLoggedIn() && !IsLoggedInAsGuest() && !IsLoggedInAsKioskApp() && |
| 452 !IsLoggedInAsArcKioskApp()) { |
452 if (IsLoggedInAsSupervisedUser()) | 453 if (IsLoggedInAsSupervisedUser()) |
453 SupervisedUserPasswordServiceFactory::GetForProfile(profile); | 454 SupervisedUserPasswordServiceFactory::GetForProfile(profile); |
454 if (IsLoggedInAsUserWithGaiaAccount()) | 455 if (IsLoggedInAsUserWithGaiaAccount()) |
455 ManagerPasswordServiceFactory::GetForProfile(profile); | 456 ManagerPasswordServiceFactory::GetForProfile(profile); |
456 | 457 |
457 if (!profile->IsOffTheRecord()) { | 458 if (!profile->IsOffTheRecord()) { |
458 AuthSyncObserver* sync_observer = | 459 AuthSyncObserver* sync_observer = |
459 AuthSyncObserverFactory::GetInstance()->GetForProfile(profile); | 460 AuthSyncObserverFactory::GetInstance()->GetForProfile(profile); |
460 sync_observer->StartObserving(); | 461 sync_observer->StartObserving(); |
461 multi_profile_user_controller_->StartObserving(profile); | 462 multi_profile_user_controller_->StartObserving(profile); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 | 860 |
860 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 861 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
861 command_line->AppendSwitch(::switches::kForceAppMode); | 862 command_line->AppendSwitch(::switches::kForceAppMode); |
862 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); | 863 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); |
863 | 864 |
864 // Disable window animation since kiosk app runs in a single full screen | 865 // Disable window animation since kiosk app runs in a single full screen |
865 // window and window animation causes start-up janks. | 866 // window and window animation causes start-up janks. |
866 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); | 867 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); |
867 } | 868 } |
868 | 869 |
| 870 void ChromeUserManagerImpl::ArcKioskAppLoggedIn(user_manager::User* user) { |
| 871 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 872 |
| 873 active_user_ = user; |
| 874 active_user_->SetStubImage( |
| 875 base::MakeUnique<user_manager::UserImage>( |
| 876 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 877 IDR_PROFILE_PICTURE_LOADING)), |
| 878 user_manager::User::USER_IMAGE_INVALID, false); |
| 879 |
| 880 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 881 command_line->AppendSwitch(chromeos::switches::kEnableArc); |
| 882 command_line->AppendSwitch(::switches::kForceAndroidAppMode); |
| 883 |
| 884 // Disable window animation since kiosk app runs in a single full screen |
| 885 // window and window animation causes start-up janks. |
| 886 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); |
| 887 } |
| 888 |
869 void ChromeUserManagerImpl::DemoAccountLoggedIn() { | 889 void ChromeUserManagerImpl::DemoAccountLoggedIn() { |
870 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 890 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
871 active_user_ = | 891 active_user_ = |
872 user_manager::User::CreateKioskAppUser(user_manager::DemoAccountId()); | 892 user_manager::User::CreateKioskAppUser(user_manager::DemoAccountId()); |
873 active_user_->SetStubImage( | 893 active_user_->SetStubImage( |
874 base::MakeUnique<user_manager::UserImage>( | 894 base::MakeUnique<user_manager::UserImage>( |
875 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 895 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
876 IDR_PROFILE_PICTURE_LOADING)), | 896 IDR_PROFILE_PICTURE_LOADING)), |
877 user_manager::User::USER_IMAGE_INVALID, false); | 897 user_manager::User::USER_IMAGE_INVALID, false); |
878 WallpaperManager::Get()->SetUserWallpaperNow(user_manager::DemoAccountId()); | 898 WallpaperManager::Get()->SetUserWallpaperNow(user_manager::DemoAccountId()); |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 break; | 1354 break; |
1335 default: | 1355 default: |
1336 NOTREACHED(); | 1356 NOTREACHED(); |
1337 break; | 1357 break; |
1338 } | 1358 } |
1339 | 1359 |
1340 return user; | 1360 return user; |
1341 } | 1361 } |
1342 | 1362 |
1343 } // namespace chromeos | 1363 } // namespace chromeos |
OLD | NEW |