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

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

Issue 2559503003: mash: Have chrome set itself as the wallpaper picker. (Closed)
Patch Set: Check for a null service manager connection. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
index d633dd17d1e2c004c48050efa2868fffbfe6785f..b1a2d71c2a96184e122d7ebb82c3ca8adfae68b6 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -369,11 +369,6 @@ void WallpaperManager::Shutdown() {
wallpaper_manager = nullptr;
}
-void WallpaperManager::BindRequest(
- ash::mojom::WallpaperManagerRequest request) {
- bindings_.AddBinding(this, std::move(request));
-}
-
WallpaperManager::WallpaperResolution
WallpaperManager::GetAppropriateResolution() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -807,7 +802,7 @@ void WallpaperManager::UpdateWallpaper(bool clear_cache) {
// WallpaperManager, private: --------------------------------------------------
WallpaperManager::WallpaperManager()
- : pending_inactive_(NULL), weak_factory_(this) {
+ : binding_(this), pending_inactive_(nullptr), weak_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
wallpaper::WallpaperManagerBase::SetPathIds(
chrome::DIR_USER_DATA, chrome::DIR_CHROMEOS_WALLPAPERS,
@@ -828,6 +823,18 @@ WallpaperManager::WallpaperManager()
sequence_token_, base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
user_manager::UserManager::Get()->AddSessionStateObserver(this);
+
+ content::ServiceManagerConnection* connection =
+ content::ServiceManagerConnection::GetForProcess();
+ if (connection && connection->GetConnector()) {
James Cook 2016/12/07 23:03:47 Are you sure these can be null? Is that in tests?
msw 2016/12/07 23:12:55 Yes, the earlier patch sets failed because the con
+ // Connect to the wallpaper controller interface in the ash service.
+ ash::mojom::WallpaperControllerPtr wallpaper_controller_ptr;
+ connection->GetConnector()->ConnectToInterface(
+ ash_util::GetAshServiceName(), &wallpaper_controller_ptr);
+ // Register this object as the wallpaper picker.
+ wallpaper_controller_ptr->SetWallpaperPicker(
+ binding_.CreateInterfacePtrAndBind());
+ }
}
WallpaperManager::PendingWallpaper* WallpaperManager::GetPendingWallpaper(

Powered by Google App Engine
This is Rietveld 408576698