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/user_wallpaper_delegate.h" | 8 #include "ash/desktop_background/user_wallpaper_delegate.h" |
9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" | 12 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" |
13 #include "chrome/browser/chromeos/login/startup_utils.h" | 13 #include "chrome/browser/chromeos/login/startup_utils.h" |
14 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | 14 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
15 #include "chrome/browser/chromeos/login/wizard_controller.h" | 15 #include "chrome/browser/chromeos/login/wizard_controller.h" |
16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
19 #include "chrome/browser/ui/chrome_pages.h" | 19 #include "chrome/browser/ui/chrome_pages.h" |
20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
21 #include "chrome/common/chrome_switches.h" | |
22 #include "chromeos/chromeos_switches.h" | 21 #include "chromeos/chromeos_switches.h" |
23 #include "chromeos/login/login_state.h" | 22 #include "chromeos/login/login_state.h" |
24 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
25 | 24 |
26 namespace chromeos { | 25 namespace chromeos { |
27 | 26 |
28 namespace { | 27 namespace { |
29 | 28 |
30 bool IsNormalWallpaperChange() { | 29 bool IsNormalWallpaperChange() { |
31 if (chromeos::LoginState::Get()->IsUserLoggedIn() || | 30 if (chromeos::LoginState::Get()->IsUserLoggedIn() || |
(...skipping 23 matching lines...) Expand all Loading... |
55 virtual bool ShouldShowInitialAnimation() OVERRIDE { | 54 virtual bool ShouldShowInitialAnimation() OVERRIDE { |
56 if (IsNormalWallpaperChange() || boot_animation_finished_) | 55 if (IsNormalWallpaperChange() || boot_animation_finished_) |
57 return false; | 56 return false; |
58 | 57 |
59 // It is a first boot case now. If kDisableBootAnimation flag | 58 // It is a first boot case now. If kDisableBootAnimation flag |
60 // is passed, it only disables any transition after OOBE. | 59 // is passed, it only disables any transition after OOBE. |
61 // |kDisableOobeAnimation| disables OOBE animation for slow hardware. | 60 // |kDisableOobeAnimation| disables OOBE animation for slow hardware. |
62 bool is_registered = StartupUtils::IsDeviceRegistered(); | 61 bool is_registered = StartupUtils::IsDeviceRegistered(); |
63 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 62 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
64 bool disable_boot_animation = command_line-> | 63 bool disable_boot_animation = command_line-> |
65 HasSwitch(::switches::kDisableBootAnimation); | 64 HasSwitch(switches::kDisableBootAnimation); |
66 bool disable_oobe_animation = command_line-> | 65 bool disable_oobe_animation = command_line-> |
67 HasSwitch(::switches::kDisableOobeAnimation); | 66 HasSwitch(switches::kDisableOobeAnimation); |
68 if ((!is_registered && disable_oobe_animation) || | 67 if ((!is_registered && disable_oobe_animation) || |
69 (is_registered && disable_boot_animation)) | 68 (is_registered && disable_boot_animation)) |
70 return false; | 69 return false; |
71 | 70 |
72 return true; | 71 return true; |
73 } | 72 } |
74 | 73 |
75 virtual void UpdateWallpaper() OVERRIDE { | 74 virtual void UpdateWallpaper() OVERRIDE { |
76 chromeos::WallpaperManager::Get()->UpdateWallpaper(); | 75 chromeos::WallpaperManager::Get()->UpdateWallpaper(); |
77 } | 76 } |
(...skipping 28 matching lines...) Expand all Loading... |
106 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 105 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
107 }; | 106 }; |
108 | 107 |
109 } // namespace | 108 } // namespace |
110 | 109 |
111 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 110 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
112 return new chromeos::UserWallpaperDelegate(); | 111 return new chromeos::UserWallpaperDelegate(); |
113 } | 112 } |
114 | 113 |
115 } // namespace chromeos | 114 } // namespace chromeos |
OLD | NEW |