| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 wallpaper::kThumbnailWallpaperSubDir, user_id_hash_, | 135 wallpaper::kThumbnailWallpaperSubDir, user_id_hash_, |
| 136 params_->details.filename); | 136 params_->details.filename); |
| 137 | 137 |
| 138 sequence_token_ = BrowserThread::GetBlockingPool()->GetNamedSequenceToken( | 138 sequence_token_ = BrowserThread::GetBlockingPool()->GetNamedSequenceToken( |
| 139 wallpaper::kWallpaperSequenceTokenName); | 139 wallpaper::kWallpaperSequenceTokenName); |
| 140 scoped_refptr<base::SequencedTaskRunner> task_runner = | 140 scoped_refptr<base::SequencedTaskRunner> task_runner = |
| 141 BrowserThread::GetBlockingPool()-> | 141 BrowserThread::GetBlockingPool()-> |
| 142 GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_, | 142 GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_, |
| 143 base::SequencedWorkerPool::BLOCK_SHUTDOWN); | 143 base::SequencedWorkerPool::BLOCK_SHUTDOWN); |
| 144 wallpaper::WallpaperLayout layout = wallpaper_api_util::GetLayoutEnum( | 144 wallpaper::WallpaperLayout layout = wallpaper_api_util::GetLayoutEnum( |
| 145 set_wallpaper::Params::Details::ToString(params_->details.layout)); | 145 extensions::api::wallpaper::ToString(params_->details.layout)); |
| 146 bool update_wallpaper = | 146 bool update_wallpaper = |
| 147 user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); | 147 user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
| 148 wallpaper_manager->SetCustomWallpaper(user_id_, | 148 wallpaper_manager->SetCustomWallpaper(user_id_, |
| 149 user_id_hash_, | 149 user_id_hash_, |
| 150 params_->details.filename, | 150 params_->details.filename, |
| 151 layout, | 151 layout, |
| 152 user_manager::User::CUSTOMIZED, | 152 user_manager::User::CUSTOMIZED, |
| 153 image, | 153 image, |
| 154 update_wallpaper); | 154 update_wallpaper); |
| 155 unsafe_wallpaper_decoder_ = NULL; | 155 unsafe_wallpaper_decoder_ = NULL; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 const std::string& response) { | 225 const std::string& response) { |
| 226 if (success) { | 226 if (success) { |
| 227 params_->details.data.reset( | 227 params_->details.data.reset( |
| 228 new std::vector<char>(response.begin(), response.end())); | 228 new std::vector<char>(response.begin(), response.end())); |
| 229 StartDecode(*params_->details.data); | 229 StartDecode(*params_->details.data); |
| 230 } else { | 230 } else { |
| 231 SetError(response); | 231 SetError(response); |
| 232 SendResponse(false); | 232 SendResponse(false); |
| 233 } | 233 } |
| 234 } | 234 } |
| OLD | NEW |