Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/wallpaper_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | |
| 8 #include "ash/shell.h" | |
| 9 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 10 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 11 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 13 #include "base/synchronization/cancellation_flag.h" | 11 #include "base/synchronization/cancellation_flag.h" |
| 14 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chromeos/login/user_manager.h" | 13 #include "chrome/browser/chromeos/login/user_manager.h" |
| 16 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 14 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 17 #include "chrome/browser/extensions/extension_event_router.h" | 15 #include "chrome/browser/extensions/extension_event_router.h" |
| 18 #include "chrome/browser/image_decoder.h" | 16 #include "chrome/browser/image_decoder.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 this)); | 160 this)); |
| 163 } else { | 161 } else { |
| 164 BrowserThread::PostTask( | 162 BrowserThread::PostTask( |
| 165 BrowserThread::UI, FROM_HERE, | 163 BrowserThread::UI, FROM_HERE, |
| 166 base::Bind(&WallpaperSetWallpaperFunction::OnFail, | 164 base::Bind(&WallpaperSetWallpaperFunction::OnFail, |
| 167 this)); | 165 this)); |
| 168 } | 166 } |
| 169 } | 167 } |
| 170 | 168 |
| 171 void WallpaperSetWallpaperFunction::SetDecodedWallpaper() { | 169 void WallpaperSetWallpaperFunction::SetDecodedWallpaper() { |
| 172 ash::Shell::GetInstance()->desktop_background_controller()-> | 170 chromeos::WallpaperManager::Get()->SetWallpaperFromImageSkia(layout_, |
|
Nikita (slow)
2012/07/23 22:06:47
nit: Save WallpaperManager instance to local varia
bshe
2012/07/24 16:21:10
Done.
| |
| 173 SetCustomWallpaper(wallpaper_, layout_); | 171 wallpaper_); |
| 172 chromeos::WallpaperManager::Get()->SaveUserWallpaperInfos( | |
| 173 email_, file_name_, layout_, chromeos::User::DEFAULT); | |
| 174 wallpaper_decoder_ = NULL; | 174 wallpaper_decoder_ = NULL; |
| 175 SendResponse(true); | 175 SendResponse(true); |
| 176 } | 176 } |
| OLD | NEW |