Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cryptohome::Identification() . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 const user_manager::UserImage& user_image) { 801 const user_manager::UserImage& user_image) {
801 const user_manager::User* user = 802 const user_manager::User* user =
802 user_manager::UserManager::Get()->FindUser(account_id); 803 user_manager::UserManager::Get()->FindUser(account_id);
803 if (!user) { 804 if (!user) {
804 NOTREACHED() << "Unknown user."; 805 NOTREACHED() << "Unknown user.";
805 return; 806 return;
806 } 807 }
807 808
808 if (user->username_hash().empty()) { 809 if (user->username_hash().empty()) {
809 cryptohome::AsyncMethodCaller::GetInstance()->AsyncGetSanitizedUsername( 810 cryptohome::AsyncMethodCaller::GetInstance()->AsyncGetSanitizedUsername(
810 account_id.GetUserEmail(), 811 cryptohome::Identification(account_id),
811 base::Bind(&WallpaperManager::SetCustomWallpaperOnSanitizedUsername, 812 base::Bind(&WallpaperManager::SetCustomWallpaperOnSanitizedUsername,
812 weak_factory_.GetWeakPtr(), account_id, user_image.image(), 813 weak_factory_.GetWeakPtr(), account_id, user_image.image(),
813 true /* update wallpaper */)); 814 true /* update wallpaper */));
814 } else { 815 } else {
815 SetCustomWallpaper( 816 SetCustomWallpaper(
816 account_id, user->username_hash(), "policy-controlled.jpeg", 817 account_id, user->username_hash(), "policy-controlled.jpeg",
817 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, user_manager::User::POLICY, 818 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, user_manager::User::POLICY,
818 user_image.image(), true /* update wallpaper */); 819 user_image.image(), true /* update wallpaper */);
819 } 820 }
820 } 821 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 default_large_wallpaper_file.value()); 1099 default_large_wallpaper_file.value());
1099 } 1100 }
1100 } 1101 }
1101 1102
1102 if (need_update_screen) { 1103 if (need_update_screen) {
1103 DoSetDefaultWallpaper(EmptyAccountId(), MovableOnDestroyCallbackHolder()); 1104 DoSetDefaultWallpaper(EmptyAccountId(), MovableOnDestroyCallbackHolder());
1104 } 1105 }
1105 } 1106 }
1106 1107
1107 } // namespace chromeos 1108 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698