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 12 matching lines...) Expand all Loading... |
23 #include "base/single_thread_task_runner.h" | 23 #include "base/single_thread_task_runner.h" |
24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
25 #include "base/strings/stringprintf.h" | 25 #include "base/strings/stringprintf.h" |
26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
27 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
28 #include "base/task_runner.h" | 28 #include "base/task_runner.h" |
29 #include "base/threading/thread_task_runner_handle.h" | 29 #include "base/threading/thread_task_runner_handle.h" |
30 #include "base/values.h" | 30 #include "base/values.h" |
31 #include "chrome/browser/browser_process.h" | 31 #include "chrome/browser/browser_process.h" |
32 #include "chrome/browser/chrome_notification_types.h" | 32 #include "chrome/browser/chrome_notification_types.h" |
| 33 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
33 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 34 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
34 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 35 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
35 #include "chrome/browser/chromeos/login/signin/auth_sync_observer.h" | 36 #include "chrome/browser/chromeos/login/signin/auth_sync_observer.h" |
36 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" | 37 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" |
37 #include "chrome/browser/chromeos/login/users/affiliation.h" | 38 #include "chrome/browser/chromeos/login/users/affiliation.h" |
38 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" | 39 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" |
39 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" | 40 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" |
40 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" | 41 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" |
41 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 42 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
42 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" | 43 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 NOTREACHED(); | 853 NOTREACHED(); |
853 } | 854 } |
854 | 855 |
855 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 856 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
856 command_line->AppendSwitch(::switches::kForceAppMode); | 857 command_line->AppendSwitch(::switches::kForceAppMode); |
857 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); | 858 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); |
858 | 859 |
859 // Disable window animation since kiosk app runs in a single full screen | 860 // Disable window animation since kiosk app runs in a single full screen |
860 // window and window animation causes start-up janks. | 861 // window and window animation causes start-up janks. |
861 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); | 862 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); |
| 863 |
| 864 // If restoring auto-launched kiosk session, make sure the app is marked |
| 865 // as auto-launched. |
| 866 if (command_line->HasSwitch(switches::kLoginUser) && |
| 867 command_line->HasSwitch(switches::kAppAutoLaunched)) { |
| 868 KioskAppManager::Get()->SetAppWasAutoLaunchedWithZeroDelay(kiosk_app_id); |
| 869 } |
862 } | 870 } |
863 | 871 |
864 void ChromeUserManagerImpl::ArcKioskAppLoggedIn(user_manager::User* user) { | 872 void ChromeUserManagerImpl::ArcKioskAppLoggedIn(user_manager::User* user) { |
865 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 873 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
866 | 874 |
867 active_user_ = user; | 875 active_user_ = user; |
868 active_user_->SetStubImage( | 876 active_user_->SetStubImage( |
869 base::MakeUnique<user_manager::UserImage>( | 877 base::MakeUnique<user_manager::UserImage>( |
870 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 878 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
871 IDR_PROFILE_PICTURE_LOADING)), | 879 IDR_PROFILE_PICTURE_LOADING)), |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 break; | 1352 break; |
1345 default: | 1353 default: |
1346 NOTREACHED(); | 1354 NOTREACHED(); |
1347 break; | 1355 break; |
1348 } | 1356 } |
1349 | 1357 |
1350 return user; | 1358 return user; |
1351 } | 1359 } |
1352 | 1360 |
1353 } // namespace chromeos | 1361 } // namespace chromeos |
OLD | NEW |