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" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (user_type != LoginState::LOGGED_IN_USER_REGULAR && | 102 if (user_type != LoginState::LOGGED_IN_USER_REGULAR && |
103 user_type != LoginState::LOGGED_IN_USER_OWNER && | 103 user_type != LoginState::LOGGED_IN_USER_OWNER && |
104 user_type != LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT && | 104 user_type != LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT && |
105 user_type != LoginState::LOGGED_IN_USER_SUPERVISED) { | 105 user_type != LoginState::LOGGED_IN_USER_SUPERVISED) { |
106 return false; | 106 return false; |
107 } | 107 } |
108 const user_manager::User* user = | 108 const user_manager::User* user = |
109 user_manager::UserManager::Get()->GetActiveUser(); | 109 user_manager::UserManager::Get()->GetActiveUser(); |
110 if (!user) | 110 if (!user) |
111 return false; | 111 return false; |
112 if (chromeos::WallpaperManager::Get()->IsPolicyControlled(user->email())) | 112 if (chromeos::WallpaperManager::Get()->IsPolicyControlled( |
| 113 user->GetAccountId())) |
113 return false; | 114 return false; |
114 return true; | 115 return true; |
115 } | 116 } |
116 | 117 |
117 void OnWallpaperAnimationFinished() override { | 118 void OnWallpaperAnimationFinished() override { |
118 content::NotificationService::current()->Notify( | 119 content::NotificationService::current()->Notify( |
119 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 120 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
120 content::NotificationService::AllSources(), | 121 content::NotificationService::AllSources(), |
121 content::NotificationService::NoDetails()); | 122 content::NotificationService::NoDetails()); |
122 } | 123 } |
(...skipping 12 matching lines...) Expand all Loading... |
135 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 136 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
136 }; | 137 }; |
137 | 138 |
138 } // namespace | 139 } // namespace |
139 | 140 |
140 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 141 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
141 return new chromeos::UserWallpaperDelegate(); | 142 return new chromeos::UserWallpaperDelegate(); |
142 } | 143 } |
143 | 144 |
144 } // namespace chromeos | 145 } // namespace chromeos |
OLD | NEW |