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

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

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return ash::mojom::WallpaperLayout::CENTER; 203 return ash::mojom::WallpaperLayout::CENTER;
204 } 204 }
205 NOTREACHED(); 205 NOTREACHED();
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 service_manager::Connector* connector =
214 content::ServiceManagerConnection::GetForProcess()->GetConnector(); 214 content::ServiceManagerConnection::GetForProcess()->GetConnector();
215 ash::mojom::WallpaperControllerPtr wallpaper_controller; 215 ash::mojom::WallpaperControllerPtr wallpaper_controller;
216 connector->ConnectToInterface("service: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,
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 &stored_value)) { 1182 &stored_value)) {
1183 return wallpaper::WallpaperFilesId::FromString(stored_value); 1183 return wallpaper::WallpaperFilesId::FromString(stored_value);
1184 } 1184 }
1185 const std::string& old_id = account_id.GetUserEmail(); // Migrated 1185 const std::string& old_id = account_id.GetUserEmail(); // Migrated
1186 const wallpaper::WallpaperFilesId files_id = HashWallpaperFilesIdStr(old_id); 1186 const wallpaper::WallpaperFilesId files_id = HashWallpaperFilesIdStr(old_id);
1187 SetKnownUserWallpaperFilesId(account_id, files_id); 1187 SetKnownUserWallpaperFilesId(account_id, files_id);
1188 return files_id; 1188 return files_id;
1189 } 1189 }
1190 1190
1191 } // namespace chromeos 1191 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698