| 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 14 matching lines...) Expand all Loading... |
| 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/task_scheduler/post_task.h" | 29 #include "base/task_scheduler/post_task.h" |
| 30 #include "base/threading/thread_task_runner_handle.h" | 30 #include "base/threading/thread_task_runner_handle.h" |
| 31 #include "base/values.h" | 31 #include "base/values.h" |
| 32 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
| 33 #include "chrome/browser/chrome_notification_types.h" | 33 #include "chrome/browser/chrome_notification_types.h" |
| 34 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 34 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 35 #include "chrome/browser/chromeos/extensions/permissions_updater_delegate_chrome
os.h" |
| 35 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 36 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 36 #include "chrome/browser/chromeos/login/enterprise_user_session_metrics.h" | 37 #include "chrome/browser/chromeos/login/enterprise_user_session_metrics.h" |
| 37 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 38 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 38 #include "chrome/browser/chromeos/login/signin/auth_sync_observer.h" | 39 #include "chrome/browser/chromeos/login/signin/auth_sync_observer.h" |
| 39 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" | 40 #include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h" |
| 40 #include "chrome/browser/chromeos/login/users/affiliation.h" | 41 #include "chrome/browser/chromeos/login/users/affiliation.h" |
| 41 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" | 42 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h" |
| 42 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" | 43 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" |
| 43 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" | 44 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" |
| 44 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 45 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 45 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" | 46 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
| 46 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 47 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 47 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 48 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 48 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" | 49 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" |
| 49 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 50 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 50 #include "chrome/browser/chromeos/session_length_limiter.h" | 51 #include "chrome/browser/chromeos/session_length_limiter.h" |
| 51 #include "chrome/browser/chromeos/settings/cros_settings.h" | 52 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 52 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" | 53 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" |
| 53 #include "chrome/browser/chromeos/system/timezone_util.h" | 54 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 55 #include "chrome/browser/extensions/permissions_updater.h" |
| 54 #include "chrome/browser/profiles/profile.h" | 56 #include "chrome/browser/profiles/profile.h" |
| 55 #include "chrome/browser/signin/easy_unlock_service.h" | 57 #include "chrome/browser/signin/easy_unlock_service.h" |
| 56 #include "chrome/browser/supervised_user/chromeos/manager_password_service_facto
ry.h" | 58 #include "chrome/browser/supervised_user/chromeos/manager_password_service_facto
ry.h" |
| 57 #include "chrome/browser/supervised_user/chromeos/supervised_user_password_servi
ce_factory.h" | 59 #include "chrome/browser/supervised_user/chromeos/supervised_user_password_servi
ce_factory.h" |
| 58 #include "chrome/common/chrome_constants.h" | 60 #include "chrome/common/chrome_constants.h" |
| 59 #include "chrome/common/chrome_switches.h" | 61 #include "chrome/common/chrome_switches.h" |
| 60 #include "chrome/common/crash_keys.h" | 62 #include "chrome/common/crash_keys.h" |
| 61 #include "chrome/common/pref_names.h" | 63 #include "chrome/common/pref_names.h" |
| 62 #include "chrome/grit/theme_resources.h" | 64 #include "chrome/grit/theme_resources.h" |
| 63 #include "chromeos/chromeos_switches.h" | 65 #include "chromeos/chromeos_switches.h" |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 void ChromeUserManagerImpl::PublicAccountUserLoggedIn( | 828 void ChromeUserManagerImpl::PublicAccountUserLoggedIn( |
| 827 user_manager::User* user) { | 829 user_manager::User* user) { |
| 828 SetIsCurrentUserNew(true); | 830 SetIsCurrentUserNew(true); |
| 829 active_user_ = user; | 831 active_user_ = user; |
| 830 | 832 |
| 831 // The UserImageManager chooses a random avatar picture when a user logs in | 833 // The UserImageManager chooses a random avatar picture when a user logs in |
| 832 // for the first time. Tell the UserImageManager that this user is not new to | 834 // for the first time. Tell the UserImageManager that this user is not new to |
| 833 // prevent the avatar from getting changed. | 835 // prevent the avatar from getting changed. |
| 834 GetUserImageManager(user->GetAccountId())->UserLoggedIn(false, true); | 836 GetUserImageManager(user->GetAccountId())->UserLoggedIn(false, true); |
| 835 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); | 837 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); |
| 838 |
| 839 // In Public Sessions set the PS delegate on PermissionsUpdater (used to |
| 840 // remove clipboard read permission from extensions in PS). This delegate will |
| 841 // be active for the whole user-session and it will go away together with the |
| 842 // browser process during logout (the browser process is destroyed during |
| 843 // logout), ie. it's not freed and it leaks but that is fine. |
| 844 extensions::PermissionsUpdater::SetPlatformDelegate( |
| 845 new extensions::PermissionsUpdaterDelegateChromeOS); |
| 836 } | 846 } |
| 837 | 847 |
| 838 void ChromeUserManagerImpl::KioskAppLoggedIn(user_manager::User* user) { | 848 void ChromeUserManagerImpl::KioskAppLoggedIn(user_manager::User* user) { |
| 839 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 849 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 840 | 850 |
| 841 active_user_ = user; | 851 active_user_ = user; |
| 842 active_user_->SetStubImage( | 852 active_user_->SetStubImage( |
| 843 base::MakeUnique<user_manager::UserImage>( | 853 base::MakeUnique<user_manager::UserImage>( |
| 844 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 854 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 845 IDR_PROFILE_PICTURE_LOADING)), | 855 IDR_PROFILE_PICTURE_LOADING)), |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 break; | 1382 break; |
| 1373 default: | 1383 default: |
| 1374 NOTREACHED(); | 1384 NOTREACHED(); |
| 1375 break; | 1385 break; |
| 1376 } | 1386 } |
| 1377 | 1387 |
| 1378 return user; | 1388 return user; |
| 1379 } | 1389 } |
| 1380 | 1390 |
| 1381 } // namespace chromeos | 1391 } // namespace chromeos |
| OLD | NEW |