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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return ash::mojom::WallpaperLayout::CENTER; | 206 return ash::mojom::WallpaperLayout::CENTER; |
207 } | 207 } |
208 | 208 |
209 // A helper to set the wallpaper image for Ash and Mash. | 209 // A helper to set the wallpaper image for Ash and Mash. |
210 void SetWallpaper(const gfx::ImageSkia& image, | 210 void SetWallpaper(const gfx::ImageSkia& image, |
211 wallpaper::WallpaperLayout layout) { | 211 wallpaper::WallpaperLayout layout) { |
212 if (chrome::IsRunningInMash()) { | 212 if (chrome::IsRunningInMash()) { |
213 shell::Connector* connector = | 213 shell::Connector* connector = |
214 content::MojoShellConnection::GetForProcess()->GetConnector(); | 214 content::MojoShellConnection::GetForProcess()->GetConnector(); |
215 ash::mojom::WallpaperControllerPtr wallpaper_controller; | 215 ash::mojom::WallpaperControllerPtr wallpaper_controller; |
216 connector->ConnectToInterface("mojo:ash", &wallpaper_controller); | 216 connector->ConnectToInterface("service:ash", &wallpaper_controller); |
217 wallpaper_controller->SetWallpaper(*image.bitmap(), | 217 wallpaper_controller->SetWallpaper(*image.bitmap(), |
218 WallpaperLayoutToMojo(layout)); | 218 WallpaperLayoutToMojo(layout)); |
219 return; | 219 return; |
220 } | 220 } |
221 // Avoid loading unnecessary wallpapers in tests without a shell instance. | 221 // Avoid loading unnecessary wallpapers in tests without a shell instance. |
222 if (ash::WmShell::HasInstance()) { | 222 if (ash::WmShell::HasInstance()) { |
223 ash::WmShell::Get()->wallpaper_controller()->SetWallpaperImage(image, | 223 ash::WmShell::Get()->wallpaper_controller()->SetWallpaperImage(image, |
224 layout); | 224 layout); |
225 } | 225 } |
226 } | 226 } |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 &stored_value)) { | 1180 &stored_value)) { |
1181 return wallpaper::WallpaperFilesId::FromString(stored_value); | 1181 return wallpaper::WallpaperFilesId::FromString(stored_value); |
1182 } | 1182 } |
1183 const std::string& old_id = account_id.GetUserEmail(); // Migrated | 1183 const std::string& old_id = account_id.GetUserEmail(); // Migrated |
1184 const wallpaper::WallpaperFilesId files_id = HashWallpaperFilesIdStr(old_id); | 1184 const wallpaper::WallpaperFilesId files_id = HashWallpaperFilesIdStr(old_id); |
1185 SetKnownUserWallpaperFilesId(account_id, files_id); | 1185 SetKnownUserWallpaperFilesId(account_id, files_id); |
1186 return files_id; | 1186 return files_id; |
1187 } | 1187 } |
1188 | 1188 |
1189 } // namespace chromeos | 1189 } // namespace chromeos |
OLD | NEW |