| 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/background/ash_user_wallpaper_delegate.h" | 5 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
| 9 #include "ash/desktop_background/desktop_background_resources.h" | 9 #include "ash/desktop_background/desktop_background_resources.h" |
| 10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "chrome/browser/chromeos/extensions/wallpaper_manager_api.h" | 13 #include "chrome/browser/chromeos/extensions/wallpaper_manager_api.h" |
| 14 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 15 #include "chrome/browser/chromeos/login/wizard_controller.h" | 16 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_finder.h" | 19 #include "chrome/browser/ui/browser_finder.h" |
| 19 #include "chrome/browser/ui/chrome_pages.h" | 20 #include "chrome/browser/ui/chrome_pages.h" |
| 20 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 22 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
| 23 | 24 |
| 24 namespace chromeos { | 25 namespace chromeos { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 | 43 |
| 43 bool is_registered = WizardController::IsDeviceRegistered(); | 44 bool is_registered = WizardController::IsDeviceRegistered(); |
| 44 // TODO(nkostylev): Figure out whether this would affect autotests as well. | 45 // TODO(nkostylev): Figure out whether this would affect autotests as well. |
| 45 if (is_registered) | 46 if (is_registered) |
| 46 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; | 47 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; |
| 47 else | 48 else |
| 48 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE; | 49 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE; |
| 49 } | 50 } |
| 50 | 51 |
| 51 virtual void InitializeWallpaper() OVERRIDE { | 52 virtual void InitializeWallpaper() OVERRIDE { |
| 52 chromeos::UserManager::Get()->InitializeWallpaper(); | 53 chromeos::WallpaperManager::Get()->InitializeWallpaper(); |
| 53 } | 54 } |
| 54 | 55 |
| 55 virtual void OpenSetWallpaperPage() OVERRIDE { | 56 virtual void OpenSetWallpaperPage() OVERRIDE { |
| 56 wallpaper_manager_util::OpenWallpaperManager(); | 57 wallpaper_manager_util::OpenWallpaperManager(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 virtual bool CanOpenSetWallpaperPage() OVERRIDE { | 60 virtual bool CanOpenSetWallpaperPage() OVERRIDE { |
| 60 return !chromeos::UserManager::Get()->IsLoggedInAsGuest(); | 61 return !chromeos::UserManager::Get()->IsLoggedInAsGuest(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 virtual void OnWallpaperAnimationFinished() OVERRIDE { | 64 virtual void OnWallpaperAnimationFinished() OVERRIDE { |
| 64 content::NotificationService::current()->Notify( | 65 content::NotificationService::current()->Notify( |
| 65 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 66 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
| 66 content::NotificationService::AllSources(), | 67 content::NotificationService::AllSources(), |
| 67 content::NotificationService::NoDetails()); | 68 content::NotificationService::NoDetails()); |
| 68 } | 69 } |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace | 75 } // namespace |
| 75 | 76 |
| 76 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 77 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
| 77 return new chromeos::UserWallpaperDelegate(); | 78 return new chromeos::UserWallpaperDelegate(); |
| 78 } | 79 } |
| 79 | 80 |
| 80 } // namespace chromeos | 81 } // namespace chromeos |
| OLD | NEW |