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/wallpaper/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <numeric> | 8 #include <numeric> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/chrome_notification_types.h" | 33 #include "chrome/browser/chrome_notification_types.h" |
34 #include "chrome/browser/chromeos/customization/customization_document.h" | 34 #include "chrome/browser/chromeos/customization/customization_document.h" |
35 #include "chrome/browser/chromeos/login/startup_utils.h" | 35 #include "chrome/browser/chromeos/login/startup_utils.h" |
36 #include "chrome/browser/chromeos/login/wizard_controller.h" | 36 #include "chrome/browser/chromeos/login/wizard_controller.h" |
37 #include "chrome/browser/chromeos/settings/cros_settings.h" | 37 #include "chrome/browser/chromeos/settings/cros_settings.h" |
38 #include "chrome/common/chrome_paths.h" | 38 #include "chrome/common/chrome_paths.h" |
39 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
41 #include "chromeos/chromeos_switches.h" | 41 #include "chromeos/chromeos_switches.h" |
42 #include "chromeos/cryptohome/async_method_caller.h" | 42 #include "chromeos/cryptohome/async_method_caller.h" |
| 43 #include "chromeos/cryptohome/cryptohome_parameters.h" |
43 #include "chromeos/dbus/dbus_thread_manager.h" | 44 #include "chromeos/dbus/dbus_thread_manager.h" |
44 #include "chromeos/login/user_names.h" | 45 #include "chromeos/login/user_names.h" |
45 #include "components/prefs/pref_registry_simple.h" | 46 #include "components/prefs/pref_registry_simple.h" |
46 #include "components/prefs/pref_service.h" | 47 #include "components/prefs/pref_service.h" |
47 #include "components/prefs/scoped_user_pref_update.h" | 48 #include "components/prefs/scoped_user_pref_update.h" |
48 #include "components/signin/core/account_id/account_id.h" | 49 #include "components/signin/core/account_id/account_id.h" |
49 #include "components/user_manager/user.h" | 50 #include "components/user_manager/user.h" |
50 #include "components/user_manager/user_image/user_image.h" | 51 #include "components/user_manager/user_image/user_image.h" |
51 #include "components/user_manager/user_manager.h" | 52 #include "components/user_manager/user_manager.h" |
52 #include "components/user_manager/user_type.h" | 53 #include "components/user_manager/user_type.h" |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 const user_manager::UserImage& user_image) { | 799 const user_manager::UserImage& user_image) { |
799 const user_manager::User* user = | 800 const user_manager::User* user = |
800 user_manager::UserManager::Get()->FindUser(account_id); | 801 user_manager::UserManager::Get()->FindUser(account_id); |
801 if (!user) { | 802 if (!user) { |
802 NOTREACHED() << "Unknown user."; | 803 NOTREACHED() << "Unknown user."; |
803 return; | 804 return; |
804 } | 805 } |
805 | 806 |
806 if (user->username_hash().empty()) { | 807 if (user->username_hash().empty()) { |
807 cryptohome::AsyncMethodCaller::GetInstance()->AsyncGetSanitizedUsername( | 808 cryptohome::AsyncMethodCaller::GetInstance()->AsyncGetSanitizedUsername( |
808 account_id.GetUserEmail(), | 809 cryptohome::Identification(account_id), |
809 base::Bind(&WallpaperManager::SetCustomWallpaperOnSanitizedUsername, | 810 base::Bind(&WallpaperManager::SetCustomWallpaperOnSanitizedUsername, |
810 weak_factory_.GetWeakPtr(), account_id, user_image.image(), | 811 weak_factory_.GetWeakPtr(), account_id, user_image.image(), |
811 true /* update wallpaper */)); | 812 true /* update wallpaper */)); |
812 } else { | 813 } else { |
813 SetCustomWallpaper( | 814 SetCustomWallpaper( |
814 account_id, user->username_hash(), "policy-controlled.jpeg", | 815 account_id, user->username_hash(), "policy-controlled.jpeg", |
815 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, user_manager::User::POLICY, | 816 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, user_manager::User::POLICY, |
816 user_image.image(), true /* update wallpaper */); | 817 user_image.image(), true /* update wallpaper */); |
817 } | 818 } |
818 } | 819 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 default_wallpaper_image_->set_file_path(default_large_wallpaper_file); | 1095 default_wallpaper_image_->set_file_path(default_large_wallpaper_file); |
1095 } | 1096 } |
1096 } | 1097 } |
1097 | 1098 |
1098 if (need_update_screen) { | 1099 if (need_update_screen) { |
1099 DoSetDefaultWallpaper(EmptyAccountId(), MovableOnDestroyCallbackHolder()); | 1100 DoSetDefaultWallpaper(EmptyAccountId(), MovableOnDestroyCallbackHolder()); |
1100 } | 1101 } |
1101 } | 1102 } |
1102 | 1103 |
1103 } // namespace chromeos | 1104 } // namespace chromeos |
OLD | NEW |