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" |
| 11 #include "base/command_line.h" |
10 #include "base/logging.h" | 12 #include "base/logging.h" |
11 #include "chrome/browser/chromeos/extensions/wallpaper_manager_api.h" | 13 #include "chrome/browser/chromeos/extensions/wallpaper_manager_api.h" |
12 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/wizard_controller.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
16 #include "chrome/browser/ui/chrome_pages.h" | 19 #include "chrome/browser/ui/chrome_pages.h" |
17 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "chrome/common/chrome_switches.h" |
18 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
19 | 23 |
20 namespace chromeos { | 24 namespace chromeos { |
21 | 25 |
22 namespace { | 26 namespace { |
23 | 27 |
24 class UserWallpaperDelegate: public ash::UserWallpaperDelegate { | 28 class UserWallpaperDelegate: public ash::UserWallpaperDelegate { |
25 public: | 29 public: |
26 UserWallpaperDelegate() { | 30 UserWallpaperDelegate() { |
27 } | 31 } |
28 | 32 |
29 virtual ~UserWallpaperDelegate() { | 33 virtual ~UserWallpaperDelegate() { |
30 } | 34 } |
31 | 35 |
| 36 virtual ash::WindowVisibilityAnimationType GetAnimationType() OVERRIDE { |
| 37 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) |
| 38 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; |
| 39 |
| 40 bool is_registered = WizardController::IsDeviceRegistered(); |
| 41 // TODO(nkostylev): Figure out whether this would affect autotests as well. |
| 42 if (is_registered) |
| 43 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; |
| 44 else |
| 45 return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE; |
| 46 } |
| 47 |
32 virtual void InitializeWallpaper() OVERRIDE { | 48 virtual void InitializeWallpaper() OVERRIDE { |
33 chromeos::UserManager::Get()->InitializeWallpaper(); | 49 chromeos::UserManager::Get()->InitializeWallpaper(); |
34 } | 50 } |
35 | 51 |
36 virtual void OpenSetWallpaperPage() OVERRIDE { | 52 virtual void OpenSetWallpaperPage() OVERRIDE { |
37 wallpaper_manager_util::OpenWallpaperManager(); | 53 wallpaper_manager_util::OpenWallpaperManager(); |
38 } | 54 } |
39 | 55 |
40 virtual bool CanOpenSetWallpaperPage() OVERRIDE { | 56 virtual bool CanOpenSetWallpaperPage() OVERRIDE { |
41 return !chromeos::UserManager::Get()->IsLoggedInAsGuest(); | 57 return !chromeos::UserManager::Get()->IsLoggedInAsGuest(); |
(...skipping 10 matching lines...) Expand all Loading... |
52 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
53 }; | 69 }; |
54 | 70 |
55 } // namespace | 71 } // namespace |
56 | 72 |
57 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 73 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
58 return new chromeos::UserWallpaperDelegate(); | 74 return new chromeos::UserWallpaperDelegate(); |
59 } | 75 } |
60 | 76 |
61 } // namespace chromeos | 77 } // namespace chromeos |
OLD | NEW |