OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 return true; | 291 return true; |
292 } | 292 } |
293 | 293 |
294 WallpaperPrivateSetWallpaperIfExistsFunction:: | 294 WallpaperPrivateSetWallpaperIfExistsFunction:: |
295 WallpaperPrivateSetWallpaperIfExistsFunction() {} | 295 WallpaperPrivateSetWallpaperIfExistsFunction() {} |
296 | 296 |
297 WallpaperPrivateSetWallpaperIfExistsFunction:: | 297 WallpaperPrivateSetWallpaperIfExistsFunction:: |
298 ~WallpaperPrivateSetWallpaperIfExistsFunction() {} | 298 ~WallpaperPrivateSetWallpaperIfExistsFunction() {} |
299 | 299 |
300 bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() { | 300 bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() { |
| 301 #if !defined(USE_ATHENA) |
301 params = set_wallpaper_if_exists::Params::Create(*args_); | 302 params = set_wallpaper_if_exists::Params::Create(*args_); |
302 EXTENSION_FUNCTION_VALIDATE(params); | 303 EXTENSION_FUNCTION_VALIDATE(params); |
303 | 304 |
304 user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email(); | 305 user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email(); |
305 | 306 |
306 base::FilePath wallpaper_path; | 307 base::FilePath wallpaper_path; |
307 base::FilePath fallback_path; | 308 base::FilePath fallback_path; |
308 chromeos::WallpaperManager::WallpaperResolution resolution = | 309 chromeos::WallpaperManager::WallpaperResolution resolution = |
309 chromeos::WallpaperManager::GetAppropriateResolution(); | 310 chromeos::WallpaperManager::GetAppropriateResolution(); |
310 | 311 |
(...skipping 13 matching lines...) Expand all Loading... |
324 scoped_refptr<base::SequencedTaskRunner> task_runner = | 325 scoped_refptr<base::SequencedTaskRunner> task_runner = |
325 BrowserThread::GetBlockingPool()-> | 326 BrowserThread::GetBlockingPool()-> |
326 GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_, | 327 GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_, |
327 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); | 328 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); |
328 | 329 |
329 task_runner->PostTask(FROM_HERE, | 330 task_runner->PostTask(FROM_HERE, |
330 base::Bind( | 331 base::Bind( |
331 &WallpaperPrivateSetWallpaperIfExistsFunction:: | 332 &WallpaperPrivateSetWallpaperIfExistsFunction:: |
332 ReadFileAndInitiateStartDecode, | 333 ReadFileAndInitiateStartDecode, |
333 this, wallpaper_path, fallback_path)); | 334 this, wallpaper_path, fallback_path)); |
| 335 #endif |
334 return true; | 336 return true; |
335 } | 337 } |
336 | 338 |
337 void WallpaperPrivateSetWallpaperIfExistsFunction:: | 339 void WallpaperPrivateSetWallpaperIfExistsFunction:: |
338 ReadFileAndInitiateStartDecode(const base::FilePath& file_path, | 340 ReadFileAndInitiateStartDecode(const base::FilePath& file_path, |
339 const base::FilePath& fallback_path) { | 341 const base::FilePath& fallback_path) { |
340 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( | 342 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( |
341 sequence_token_)); | 343 sequence_token_)); |
342 std::string data; | 344 std::string data; |
343 base::FilePath path = file_path; | 345 base::FilePath path = file_path; |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 this, file_list)); | 881 this, file_list)); |
880 } | 882 } |
881 | 883 |
882 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( | 884 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( |
883 const std::vector<std::string>& file_list) { | 885 const std::vector<std::string>& file_list) { |
884 base::ListValue* results = new base::ListValue(); | 886 base::ListValue* results = new base::ListValue(); |
885 results->AppendStrings(file_list); | 887 results->AppendStrings(file_list); |
886 SetResult(results); | 888 SetResult(results); |
887 SendResponse(true); | 889 SendResponse(true); |
888 } | 890 } |
OLD | NEW |