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

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

Issue 2398783002: Rename a bunch of Mojo Application stuff to reference Services. (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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "components/user_manager/known_user.h" 53 #include "components/user_manager/known_user.h"
54 #include "components/user_manager/user.h" 54 #include "components/user_manager/user.h"
55 #include "components/user_manager/user_image/user_image.h" 55 #include "components/user_manager/user_image/user_image.h"
56 #include "components/user_manager/user_manager.h" 56 #include "components/user_manager/user_manager.h"
57 #include "components/user_manager/user_type.h" 57 #include "components/user_manager/user_type.h"
58 #include "components/wallpaper/wallpaper_files_id.h" 58 #include "components/wallpaper/wallpaper_files_id.h"
59 #include "components/wallpaper/wallpaper_layout.h" 59 #include "components/wallpaper/wallpaper_layout.h"
60 #include "content/public/browser/browser_thread.h" 60 #include "content/public/browser/browser_thread.h"
61 #include "content/public/browser/notification_service.h" 61 #include "content/public/browser/notification_service.h"
62 #include "content/public/common/content_switches.h" 62 #include "content/public/common/content_switches.h"
63 #include "content/public/common/mojo_shell_connection.h" 63 #include "content/public/common/service_manager_connection.h"
64 #include "services/shell/public/cpp/connector.h" 64 #include "services/shell/public/cpp/connector.h"
65 #include "third_party/skia/include/core/SkColor.h" 65 #include "third_party/skia/include/core/SkColor.h"
66 #include "ui/gfx/codec/jpeg_codec.h" 66 #include "ui/gfx/codec/jpeg_codec.h"
67 #include "ui/gfx/image/image_skia_operations.h" 67 #include "ui/gfx/image/image_skia_operations.h"
68 #include "ui/gfx/skia_util.h" 68 #include "ui/gfx/skia_util.h"
69 69
70 using content::BrowserThread; 70 using content::BrowserThread;
71 using wallpaper::WallpaperManagerBase; 71 using wallpaper::WallpaperManagerBase;
72 using wallpaper::WallpaperInfo; 72 using wallpaper::WallpaperInfo;
73 using wallpaper::MovableOnDestroyCallback; 73 using wallpaper::MovableOnDestroyCallback;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 shell::Connector* connector =
214 content::MojoShellConnection::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,
224 layout); 224 layout);
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_interface_factory.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698