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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
10 #include "ash/common/wallpaper/wallpaper_controller.h" | 10 #include "ash/common/wallpaper/wallpaper_controller.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void SetKnownUserWallpaperFilesId( | 191 void SetKnownUserWallpaperFilesId( |
192 const AccountId& account_id, | 192 const AccountId& account_id, |
193 const wallpaper::WallpaperFilesId& wallpaper_files_id) { | 193 const wallpaper::WallpaperFilesId& wallpaper_files_id) { |
194 user_manager::known_user::SetStringPref(account_id, kWallpaperFilesId, | 194 user_manager::known_user::SetStringPref(account_id, kWallpaperFilesId, |
195 wallpaper_files_id.id()); | 195 wallpaper_files_id.id()); |
196 } | 196 } |
197 | 197 |
198 // A helper to set the wallpaper image for Classic Ash and Mash. | 198 // A helper to set the wallpaper image for Classic Ash and Mash. |
199 void SetWallpaper(const gfx::ImageSkia& image, | 199 void SetWallpaper(const gfx::ImageSkia& image, |
200 wallpaper::WallpaperLayout layout) { | 200 wallpaper::WallpaperLayout layout) { |
201 if (ash_util::IsRunningInMash()) { | 201 if (IsRunningInMash()) { |
202 // In mash, connect to the WallpaperController interface via mojo. | 202 // In mash, connect to the WallpaperController interface via mojo. |
203 service_manager::Connector* connector = | 203 service_manager::Connector* connector = |
204 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 204 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
205 if (!connector) | 205 if (!connector) |
206 return; | 206 return; |
207 | 207 |
208 ash::mojom::WallpaperControllerPtr wallpaper_controller; | 208 ash::mojom::WallpaperControllerPtr wallpaper_controller; |
209 connector->BindInterface(ash::mojom::kServiceName, &wallpaper_controller); | 209 connector->BindInterface(ash::mojom::kServiceName, &wallpaper_controller); |
210 // TODO(crbug.com/655875): Optimize ash wallpaper transport; avoid sending | 210 // TODO(crbug.com/655875): Optimize ash wallpaper transport; avoid sending |
211 // large bitmaps over Mojo; use shared memory like BitmapUploader, etc. | 211 // large bitmaps over Mojo; use shared memory like BitmapUploader, etc. |
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 | 1407 |
1408 UMA_HISTOGRAM_ENUMERATION( | 1408 UMA_HISTOGRAM_ENUMERATION( |
1409 "Ash.Wallpaper.Apps", | 1409 "Ash.Wallpaper.Apps", |
1410 wallpaper_manager_util::ShouldUseAndroidWallpapersApp(profile) | 1410 wallpaper_manager_util::ShouldUseAndroidWallpapersApp(profile) |
1411 ? WALLPAPERS_APP_ANDROID | 1411 ? WALLPAPERS_APP_ANDROID |
1412 : WALLPAPERS_PICKER_APP_CHROMEOS, | 1412 : WALLPAPERS_PICKER_APP_CHROMEOS, |
1413 WALLPAPERS_APPS_NUM); | 1413 WALLPAPERS_APPS_NUM); |
1414 } | 1414 } |
1415 | 1415 |
1416 } // namespace chromeos | 1416 } // namespace chromeos |
OLD | NEW |