| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/login/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 observers_.AddObserver(observer); | 977 observers_.AddObserver(observer); |
| 978 } | 978 } |
| 979 | 979 |
| 980 void WallpaperManager::RemoveObserver(WallpaperManager::Observer* observer) { | 980 void WallpaperManager::RemoveObserver(WallpaperManager::Observer* observer) { |
| 981 observers_.RemoveObserver(observer); | 981 observers_.RemoveObserver(observer); |
| 982 } | 982 } |
| 983 | 983 |
| 984 void WallpaperManager::EnableSurpriseMe() { | 984 void WallpaperManager::EnableSurpriseMe() { |
| 985 Profile* profile = ProfileManager::GetActiveUserProfile(); | 985 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 986 DCHECK(profile); | 986 DCHECK(profile); |
| 987 DCHECK(extensions::ExtensionSystem::Get(profile)->event_router()); | 987 DCHECK(extensions::EventRouter::Get(profile)); |
| 988 scoped_ptr<extensions::Event> event( | 988 scoped_ptr<extensions::Event> event( |
| 989 new extensions::Event( | 989 new extensions::Event( |
| 990 extensions::api::wallpaper_private::OnRequestEnableSurpriseMe::kEventName, | 990 extensions::api::wallpaper_private::OnRequestEnableSurpriseMe::kEventName, |
| 991 extensions::api::wallpaper_private::OnRequestEnableSurpriseMe::Create())); | 991 extensions::api::wallpaper_private::OnRequestEnableSurpriseMe::Create())); |
| 992 | 992 |
| 993 extensions::ExtensionSystem::Get(profile)->event_router() | 993 extensions::EventRouter::Get(profile)->DispatchEventToExtension( |
| 994 ->DispatchEventToExtension(extension_misc::kWallpaperManagerId, | 994 extension_misc::kWallpaperManagerId, event.Pass()); |
| 995 event.Pass()); | |
| 996 } | 995 } |
| 997 | 996 |
| 998 void WallpaperManager::NotifyAnimationFinished() { | 997 void WallpaperManager::NotifyAnimationFinished() { |
| 999 FOR_EACH_OBSERVER( | 998 FOR_EACH_OBSERVER( |
| 1000 Observer, observers_, OnWallpaperAnimationFinished(last_selected_user_)); | 999 Observer, observers_, OnWallpaperAnimationFinished(last_selected_user_)); |
| 1001 } | 1000 } |
| 1002 | 1001 |
| 1003 // WallpaperManager, private: -------------------------------------------------- | 1002 // WallpaperManager, private: -------------------------------------------------- |
| 1004 | 1003 |
| 1005 bool WallpaperManager::GetWallpaperFromCache(const std::string& user_id, | 1004 bool WallpaperManager::GetWallpaperFromCache(const std::string& user_id, |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 base::Passed(on_finish.Pass()))); | 1593 base::Passed(on_finish.Pass()))); |
| 1595 } | 1594 } |
| 1596 | 1595 |
| 1597 const char* WallpaperManager::GetCustomWallpaperSubdirForCurrentResolution() { | 1596 const char* WallpaperManager::GetCustomWallpaperSubdirForCurrentResolution() { |
| 1598 WallpaperResolution resolution = GetAppropriateResolution(); | 1597 WallpaperResolution resolution = GetAppropriateResolution(); |
| 1599 return resolution == WALLPAPER_RESOLUTION_SMALL ? kSmallWallpaperSubDir | 1598 return resolution == WALLPAPER_RESOLUTION_SMALL ? kSmallWallpaperSubDir |
| 1600 : kLargeWallpaperSubDir; | 1599 : kLargeWallpaperSubDir; |
| 1601 } | 1600 } |
| 1602 | 1601 |
| 1603 } // namespace chromeos | 1602 } // namespace chromeos |
| OLD | NEW |