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

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.cc

Issue 542623002: Minimal support for OOBE/login for chrome-athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 (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
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)
302 // TODO(bshe): Support wallpaper manager in Athena, crbug.com/408734.
301 params = set_wallpaper_if_exists::Params::Create(*args_); 303 params = set_wallpaper_if_exists::Params::Create(*args_);
302 EXTENSION_FUNCTION_VALIDATE(params); 304 EXTENSION_FUNCTION_VALIDATE(params);
303 305
304 user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email(); 306 user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email();
305 307
306 base::FilePath wallpaper_path; 308 base::FilePath wallpaper_path;
307 base::FilePath fallback_path; 309 base::FilePath fallback_path;
308 chromeos::WallpaperManager::WallpaperResolution resolution = 310 chromeos::WallpaperManager::WallpaperResolution resolution =
309 chromeos::WallpaperManager::GetAppropriateResolution(); 311 chromeos::WallpaperManager::GetAppropriateResolution();
310 312
(...skipping 13 matching lines...) Expand all
324 scoped_refptr<base::SequencedTaskRunner> task_runner = 326 scoped_refptr<base::SequencedTaskRunner> task_runner =
325 BrowserThread::GetBlockingPool()-> 327 BrowserThread::GetBlockingPool()->
326 GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_, 328 GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_,
327 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 329 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
328 330
329 task_runner->PostTask(FROM_HERE, 331 task_runner->PostTask(FROM_HERE,
330 base::Bind( 332 base::Bind(
331 &WallpaperPrivateSetWallpaperIfExistsFunction:: 333 &WallpaperPrivateSetWallpaperIfExistsFunction::
332 ReadFileAndInitiateStartDecode, 334 ReadFileAndInitiateStartDecode,
333 this, wallpaper_path, fallback_path)); 335 this, wallpaper_path, fallback_path));
336 #endif
334 return true; 337 return true;
335 } 338 }
336 339
337 void WallpaperPrivateSetWallpaperIfExistsFunction:: 340 void WallpaperPrivateSetWallpaperIfExistsFunction::
338 ReadFileAndInitiateStartDecode(const base::FilePath& file_path, 341 ReadFileAndInitiateStartDecode(const base::FilePath& file_path,
339 const base::FilePath& fallback_path) { 342 const base::FilePath& fallback_path) {
340 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( 343 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread(
341 sequence_token_)); 344 sequence_token_));
342 std::string data; 345 std::string data;
343 base::FilePath path = file_path; 346 base::FilePath path = file_path;
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 this, file_list)); 882 this, file_list));
880 } 883 }
881 884
882 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( 885 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete(
883 const std::vector<std::string>& file_list) { 886 const std::vector<std::string>& file_list) {
884 base::ListValue* results = new base::ListValue(); 887 base::ListValue* results = new base::ListValue();
885 results->AppendStrings(file_list); 888 results->AppendStrings(file_list);
886 SetResult(results); 889 SetResult(results);
887 SendResponse(true); 890 SendResponse(true);
888 } 891 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698