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" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/wm/mru_window_tracker.h" | 12 #include "ash/wm/mru_window_tracker.h" |
13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
17 #include "base/files/file_enumerator.h" | 17 #include "base/files/file_enumerator.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "base/threading/worker_pool.h" | 22 #include "base/threading/worker_pool.h" |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/chromeos/login/user.h" | 24 #include "chrome/browser/chromeos/login/users/avatar/user_image.h" |
25 #include "chrome/browser/chromeos/login/user_image.h" | 25 #include "chrome/browser/chromeos/login/users/user.h" |
26 #include "chrome/browser/chromeos/login/user_manager.h" | 26 #include "chrome/browser/chromeos/login/users/user_manager.h" |
27 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 27 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
28 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "extensions/browser/event_router.h" | 30 #include "extensions/browser/event_router.h" |
31 #include "grit/app_locale_settings.h" | 31 #include "grit/app_locale_settings.h" |
32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
33 #include "grit/platform_locale_settings.h" | 33 #include "grit/platform_locale_settings.h" |
34 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
35 #include "ui/base/webui/web_ui_util.h" | 35 #include "ui/base/webui/web_ui_util.h" |
36 #include "url/gurl.h" | 36 #include "url/gurl.h" |
37 | 37 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 }; | 373 }; |
374 wallpaper_manager->SetUserWallpaperInfo(user_id_, info, is_persistent); | 374 wallpaper_manager->SetUserWallpaperInfo(user_id_, info, is_persistent); |
375 SetResult(base::Value::CreateBooleanValue(true)); | 375 SetResult(base::Value::CreateBooleanValue(true)); |
376 SendResponse(true); | 376 SendResponse(true); |
377 } | 377 } |
378 | 378 |
379 void WallpaperPrivateSetWallpaperIfExistsFunction::OnFileNotExists( | 379 void WallpaperPrivateSetWallpaperIfExistsFunction::OnFileNotExists( |
380 const std::string& error) { | 380 const std::string& error) { |
381 SetResult(base::Value::CreateBooleanValue(false)); | 381 SetResult(base::Value::CreateBooleanValue(false)); |
382 OnFailure(error); | 382 OnFailure(error); |
383 }; | 383 } |
384 | 384 |
385 WallpaperPrivateSetWallpaperFunction::WallpaperPrivateSetWallpaperFunction() { | 385 WallpaperPrivateSetWallpaperFunction::WallpaperPrivateSetWallpaperFunction() { |
386 } | 386 } |
387 | 387 |
388 WallpaperPrivateSetWallpaperFunction::~WallpaperPrivateSetWallpaperFunction() { | 388 WallpaperPrivateSetWallpaperFunction::~WallpaperPrivateSetWallpaperFunction() { |
389 } | 389 } |
390 | 390 |
391 bool WallpaperPrivateSetWallpaperFunction::RunAsync() { | 391 bool WallpaperPrivateSetWallpaperFunction::RunAsync() { |
392 params = set_wallpaper::Params::Create(*args_); | 392 params = set_wallpaper::Params::Create(*args_); |
393 EXTENSION_FUNCTION_VALIDATE(params); | 393 EXTENSION_FUNCTION_VALIDATE(params); |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 this, file_list)); | 848 this, file_list)); |
849 } | 849 } |
850 | 850 |
851 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( | 851 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( |
852 const std::vector<std::string>& file_list) { | 852 const std::vector<std::string>& file_list) { |
853 base::ListValue* results = new base::ListValue(); | 853 base::ListValue* results = new base::ListValue(); |
854 results->AppendStrings(file_list); | 854 results->AppendStrings(file_list); |
855 SetResult(results); | 855 SetResult(results); |
856 SendResponse(true); | 856 SendResponse(true); |
857 } | 857 } |
OLD | NEW |