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/desktop_background/user_wallpaper_delegate.h" | 7 #include "ash/desktop_background/user_wallpaper_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.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/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" | 13 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" |
14 #include "chrome/browser/chromeos/login/startup_utils.h" | 14 #include "chrome/browser/chromeos/login/startup_utils.h" |
15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
16 #include "chrome/browser/chromeos/login/wizard_controller.h" | 16 #include "chrome/browser/chromeos/login/wizard_controller.h" |
17 #include "chromeos/chromeos_switches.h" | 17 #include "chromeos/chromeos_switches.h" |
18 #include "chromeos/login/login_state.h" | 18 #include "chromeos/login/login_state.h" |
19 #include "components/user_manager/user.h" | 19 #include "components/user_manager/user.h" |
20 #include "components/user_manager/user_manager.h" | 20 #include "components/user_manager/user_manager.h" |
21 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
22 | 22 |
23 namespace chromeos { | 23 namespace chromeos { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 bool IsNormalWallpaperChange() { | 27 bool IsNormalWallpaperChange() { |
28 if (chromeos::LoginState::Get()->IsUserLoggedIn() || | 28 if (chromeos::LoginState::Get()->IsUserLoggedIn() || |
29 !CommandLine::ForCurrentProcess()->HasSwitch( | 29 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
30 switches::kFirstExecAfterBoot) || | 30 switches::kFirstExecAfterBoot) || |
31 WizardController::IsZeroDelayEnabled() || | 31 WizardController::IsZeroDelayEnabled() || |
32 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) { | 32 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 33 switches::kLoginManager)) { |
33 return true; | 34 return true; |
34 } | 35 } |
35 | 36 |
36 return false; | 37 return false; |
37 } | 38 } |
38 | 39 |
39 class UserWallpaperDelegate : public ash::UserWallpaperDelegate { | 40 class UserWallpaperDelegate : public ash::UserWallpaperDelegate { |
40 public: | 41 public: |
41 UserWallpaperDelegate() | 42 UserWallpaperDelegate() |
42 : boot_animation_finished_(false), | 43 : boot_animation_finished_(false), |
(...skipping 18 matching lines...) Expand all Loading... |
61 animation_duration_override_in_ms_ = animation_duration_in_ms; | 62 animation_duration_override_in_ms_ = animation_duration_in_ms; |
62 } | 63 } |
63 | 64 |
64 virtual bool ShouldShowInitialAnimation() override { | 65 virtual bool ShouldShowInitialAnimation() override { |
65 if (IsNormalWallpaperChange() || boot_animation_finished_) | 66 if (IsNormalWallpaperChange() || boot_animation_finished_) |
66 return false; | 67 return false; |
67 | 68 |
68 // It is a first boot case now. If kDisableBootAnimation flag | 69 // It is a first boot case now. If kDisableBootAnimation flag |
69 // is passed, it only disables any transition after OOBE. | 70 // is passed, it only disables any transition after OOBE. |
70 bool is_registered = StartupUtils::IsDeviceRegistered(); | 71 bool is_registered = StartupUtils::IsDeviceRegistered(); |
71 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 72 const base::CommandLine* command_line = |
| 73 base::CommandLine::ForCurrentProcess(); |
72 bool disable_boot_animation = command_line-> | 74 bool disable_boot_animation = command_line-> |
73 HasSwitch(switches::kDisableBootAnimation); | 75 HasSwitch(switches::kDisableBootAnimation); |
74 if (is_registered && disable_boot_animation) | 76 if (is_registered && disable_boot_animation) |
75 return false; | 77 return false; |
76 | 78 |
77 return true; | 79 return true; |
78 } | 80 } |
79 | 81 |
80 virtual void UpdateWallpaper(bool clear_cache) override { | 82 virtual void UpdateWallpaper(bool clear_cache) override { |
81 chromeos::WallpaperManager::Get()->UpdateWallpaper(clear_cache); | 83 chromeos::WallpaperManager::Get()->UpdateWallpaper(clear_cache); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 137 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
136 }; | 138 }; |
137 | 139 |
138 } // namespace | 140 } // namespace |
139 | 141 |
140 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 142 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
141 return new chromeos::UserWallpaperDelegate(); | 143 return new chromeos::UserWallpaperDelegate(); |
142 } | 144 } |
143 | 145 |
144 } // namespace chromeos | 146 } // namespace chromeos |
OLD | NEW |