| 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/desktop_background_observer.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 "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "chrome/browser/chromeos/login/user_manager.h" | 11 #include "chrome/browser/chromeos/login/user_manager.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 44 private: | 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 45 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 50 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
| 51 return new chromeos::UserWallpaperDelegate(); | 51 return new chromeos::UserWallpaperDelegate(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 DesktopBackgroundObserver::DesktopBackgroundObserver() { | |
| 55 registrar_.Add( | |
| 56 this, | |
| 57 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | |
| 58 content::NotificationService::AllSources()); | |
| 59 } | |
| 60 | |
| 61 DesktopBackgroundObserver::~DesktopBackgroundObserver() { | |
| 62 } | |
| 63 | |
| 64 void DesktopBackgroundObserver::Observe(int type, | |
| 65 const content::NotificationSource& source, | |
| 66 const content::NotificationDetails& details) { | |
| 67 switch (type) { | |
| 68 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { | |
| 69 ash::Shell::GetInstance()->desktop_background_controller()-> | |
| 70 SetDesktopBackgroundImageMode(); | |
| 71 break; | |
| 72 } | |
| 73 default: | |
| 74 NOTREACHED(); | |
| 75 } | |
| 76 } | |
| 77 | |
| 78 } // namespace chromeos | 54 } // namespace chromeos |
| OLD | NEW |