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

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

Issue 1886653002: Remove WallpaperManager dependency on Cryptohome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase (raw_salt_ is now properly set). Created 4 years, 8 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_WALLPAPER_WALLPAPER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_WALLPAPER_WALLPAPER_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_WALLPAPER_WALLPAPER_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_WALLPAPER_WALLPAPER_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 wallpaper::WallpaperLayout layout, 121 wallpaper::WallpaperLayout layout,
122 bool update_wallpaper) override; 122 bool update_wallpaper) override;
123 123
124 // Updates current wallpaper. It may switch the size of wallpaper based on the 124 // Updates current wallpaper. It may switch the size of wallpaper based on the
125 // current display's resolution. (asynchronously with zero delay) 125 // current display's resolution. (asynchronously with zero delay)
126 void UpdateWallpaper(bool clear_cache) override; 126 void UpdateWallpaper(bool clear_cache) override;
127 127
128 // Returns queue size. 128 // Returns queue size.
129 size_t GetPendingListSizeForTesting() const override; 129 size_t GetPendingListSizeForTesting() const override;
130 130
131 // Returns wallpaper files id for the user. 131 // Returns wallpaper files id for the |account_id|.
132 wallpaper::WallpaperFilesId GetFilesId( 132 wallpaper::WallpaperFilesId GetFilesId(
133 const user_manager::User& user) const override; 133 const AccountId& account_id) const override;
134 134
135 // Overridden from user_manager::UserManager::UserSessionStateObserver: 135 // Overridden from user_manager::UserManager::UserSessionStateObserver:
136 void UserChangedChildStatus(user_manager::User* user) override; 136 void UserChangedChildStatus(user_manager::User* user) override;
137 137
138 private: 138 private:
139 friend class TestApi; 139 friend class TestApi;
140 friend class WallpaperManagerBrowserTest; 140 friend class WallpaperManagerBrowserTest;
141 friend class WallpaperManagerBrowserTestDefaultWallpaper; 141 friend class WallpaperManagerBrowserTestDefaultWallpaper;
142 friend class WallpaperManagerPolicyTest; 142 friend class WallpaperManagerPolicyTest;
143 143
144 WallpaperManager(); 144 WallpaperManager();
145 145
146 // Returns modifiable PendingWallpaper. 146 // Returns modifiable PendingWallpaper.
147 // Returns pending_inactive_ or creates new PendingWallpaper if necessary. 147 // Returns pending_inactive_ or creates new PendingWallpaper if necessary.
148 PendingWallpaper* GetPendingWallpaper(const AccountId& account_id, 148 PendingWallpaper* GetPendingWallpaper(const AccountId& account_id,
149 bool delayed); 149 bool delayed);
150 150
151 // This is called by PendingWallpaper when load is finished. 151 // This is called by PendingWallpaper when load is finished.
152 void RemovePendingWallpaperFromList(PendingWallpaper* pending); 152 void RemovePendingWallpaperFromList(PendingWallpaper* pending);
153 153
154 // Set wallpaper to |user_image| controlled by policy. (Takes a UserImage 154 // Set wallpaper to |user_image| controlled by policy. (Takes a UserImage
155 // because that's the callback interface provided by UserImageLoader.) 155 // because that's the callback interface provided by UserImageLoader.)
156 void SetPolicyControlledWallpaper( 156 void SetPolicyControlledWallpaper(
157 const AccountId& account_id, 157 const AccountId& account_id,
158 std::unique_ptr<user_manager::UserImage> user_image); 158 std::unique_ptr<user_manager::UserImage> user_image);
159 159
160 // Calls SetCustomWallpaper() with |wallpaper_files_id_str| received from
161 // cryptohome.
162 void SetCustomWallpaperOnSanitizedUsername(
163 const AccountId& account_id,
164 const gfx::ImageSkia& image,
165 bool update_wallpaper,
166 bool cryptohome_success,
167 const std::string& wallpaper_files_id_str);
168
169 // WallpaperManagerBase overrides: 160 // WallpaperManagerBase overrides:
170 void InitializeRegisteredDeviceWallpaper() override; 161 void InitializeRegisteredDeviceWallpaper() override;
171 bool GetUserWallpaperInfo(const AccountId& account_id, 162 bool GetUserWallpaperInfo(const AccountId& account_id,
172 wallpaper::WallpaperInfo* info) const override; 163 wallpaper::WallpaperInfo* info) const override;
173 void OnWallpaperDecoded( 164 void OnWallpaperDecoded(
174 const AccountId& account_id, 165 const AccountId& account_id,
175 wallpaper::WallpaperLayout layout, 166 wallpaper::WallpaperLayout layout,
176 bool update_wallpaper, 167 bool update_wallpaper,
177 wallpaper::MovableOnDestroyCallbackHolder on_finish, 168 wallpaper::MovableOnDestroyCallbackHolder on_finish,
178 std::unique_ptr<user_manager::UserImage> user_image) override; 169 std::unique_ptr<user_manager::UserImage> user_image) override;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 217
227 content::NotificationRegistrar registrar_; 218 content::NotificationRegistrar registrar_;
228 219
229 base::WeakPtrFactory<WallpaperManager> weak_factory_; 220 base::WeakPtrFactory<WallpaperManager> weak_factory_;
230 DISALLOW_COPY_AND_ASSIGN(WallpaperManager); 221 DISALLOW_COPY_AND_ASSIGN(WallpaperManager);
231 }; 222 };
232 223
233 } // namespace chromeos 224 } // namespace chromeos
234 225
235 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_WALLPAPER_WALLPAPER_MANAGER_H_ 226 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_WALLPAPER_WALLPAPER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698