| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/desktop_background/desktop_background_controller.h" | 9 #include "ash/desktop_background/desktop_background_controller.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/wm/window_cycle_controller.h" | 11 #include "ash/wm/window_cycle_controller.h" |
| 12 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/synchronization/cancellation_flag.h" | 17 #include "base/synchronization/cancellation_flag.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chromeos/login/user.h" | 19 #include "chrome/browser/chromeos/login/user.h" |
| 20 #include "chrome/browser/chromeos/login/user_image.h" | 20 #include "chrome/browser/chromeos/login/user_image.h" |
| 21 #include "chrome/browser/chromeos/login/user_manager.h" | 21 #include "chrome/browser/chromeos/login/user_manager.h" |
| 22 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 22 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 23 #include "chrome/browser/extensions/event_router.h" | 23 #include "chrome/browser/extensions/event_router.h" |
| 24 #include "chrome/browser/image_decoder.h" | 24 #include "chrome/browser/image_decoder.h" |
| 25 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 25 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 26 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
| 27 #include "net/url_request/url_fetcher.h" | 28 #include "net/url_request/url_fetcher.h" |
| 28 #include "net/url_request/url_fetcher_delegate.h" | 29 #include "net/url_request/url_fetcher_delegate.h" |
| 29 #include "net/url_request/url_request_status.h" | 30 #include "net/url_request/url_request_status.h" |
| 30 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
| 31 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| 32 #include "grit/platform_locale_settings.h" | 33 #include "grit/platform_locale_settings.h" |
| 33 #include "ui/aura/window_observer.h" | 34 #include "ui/aura/window_observer.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 361 } |
| 361 | 362 |
| 362 void WallpaperSetCustomWallpaperFunction::OnWallpaperDecoded( | 363 void WallpaperSetCustomWallpaperFunction::OnWallpaperDecoded( |
| 363 const gfx::ImageSkia& wallpaper) { | 364 const gfx::ImageSkia& wallpaper) { |
| 364 chromeos::UserImage::RawImage raw_image(image_data_.begin(), | 365 chromeos::UserImage::RawImage raw_image(image_data_.begin(), |
| 365 image_data_.end()); | 366 image_data_.end()); |
| 366 chromeos::UserImage image(wallpaper, raw_image); | 367 chromeos::UserImage image(wallpaper, raw_image); |
| 367 // In the new wallpaper picker UI, we do not depend on WallpaperDelegate | 368 // In the new wallpaper picker UI, we do not depend on WallpaperDelegate |
| 368 // to refresh thumbnail. Uses a null delegate here. | 369 // to refresh thumbnail. Uses a null delegate here. |
| 369 chromeos::WallpaperManager::Get()->SetCustomWallpaper( | 370 chromeos::WallpaperManager::Get()->SetCustomWallpaper( |
| 370 email_, layout_, chromeos::User::CUSTOMIZED, | 371 email_, layout_, chromeos::User::CUSTOMIZED, image); |
| 371 base::WeakPtr<chromeos::WallpaperDelegate>(), image); | |
| 372 wallpaper_decoder_ = NULL; | 372 wallpaper_decoder_ = NULL; |
| 373 SendResponse(true); | 373 SendResponse(true); |
| 374 } | 374 } |
| 375 | 375 |
| 376 WallpaperMinimizeInactiveWindowsFunction:: | 376 WallpaperMinimizeInactiveWindowsFunction:: |
| 377 WallpaperMinimizeInactiveWindowsFunction() { | 377 WallpaperMinimizeInactiveWindowsFunction() { |
| 378 } | 378 } |
| 379 | 379 |
| 380 WallpaperMinimizeInactiveWindowsFunction:: | 380 WallpaperMinimizeInactiveWindowsFunction:: |
| 381 ~WallpaperMinimizeInactiveWindowsFunction() { | 381 ~WallpaperMinimizeInactiveWindowsFunction() { |
| 382 } | 382 } |
| 383 | 383 |
| 384 bool WallpaperMinimizeInactiveWindowsFunction::RunImpl() { | 384 bool WallpaperMinimizeInactiveWindowsFunction::RunImpl() { |
| 385 WindowStateManager::MinimizeInactiveWindows(); | 385 WindowStateManager::MinimizeInactiveWindows(); |
| 386 return true; | 386 return true; |
| 387 } | 387 } |
| 388 | 388 |
| 389 WallpaperRestoreMinimizedWindowsFunction:: | 389 WallpaperRestoreMinimizedWindowsFunction:: |
| 390 WallpaperRestoreMinimizedWindowsFunction() { | 390 WallpaperRestoreMinimizedWindowsFunction() { |
| 391 } | 391 } |
| 392 | 392 |
| 393 WallpaperRestoreMinimizedWindowsFunction:: | 393 WallpaperRestoreMinimizedWindowsFunction:: |
| 394 ~WallpaperRestoreMinimizedWindowsFunction() { | 394 ~WallpaperRestoreMinimizedWindowsFunction() { |
| 395 } | 395 } |
| 396 | 396 |
| 397 bool WallpaperRestoreMinimizedWindowsFunction::RunImpl() { | 397 bool WallpaperRestoreMinimizedWindowsFunction::RunImpl() { |
| 398 WindowStateManager::RestoreWindows(); | 398 WindowStateManager::RestoreWindows(); |
| 399 return true; | 399 return true; |
| 400 } | 400 } |
| OLD | NEW |