Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4509)

Unified Diff: chrome/browser/chromeos/background/desktop_background_observer.cc

Issue 10207030: Asynchronously load wallpapers when user pod is selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/background/desktop_background_observer.cc
diff --git a/chrome/browser/chromeos/background/desktop_background_observer.cc b/chrome/browser/chromeos/background/desktop_background_observer.cc
deleted file mode 100644
index 3cc21fac8c577678e51da0f4137d1cfd4872052f..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/background/desktop_background_observer.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/background/desktop_background_observer.h"
-
-#include "ash/shell.h"
-#include "ash/desktop_background/desktop_background_controller.h"
-#include "ash/desktop_background/desktop_background_resources.h"
-#include "base/logging.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
-#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/common/chrome_notification_types.h"
-#include "content/public/browser/notification_service.h"
-
-namespace chromeos {
-
-namespace {
-
-class UserWallpaperDelegate: public ash::UserWallpaperDelegate {
- public:
- UserWallpaperDelegate() {
- }
-
- virtual ~UserWallpaperDelegate() {
- }
-
- virtual const int GetUserWallpaperIndex() OVERRIDE {
- return chromeos::UserManager::Get()->GetUserWallpaperIndex();
- }
-
- virtual void OpenSetWallpaperPage() OVERRIDE {
- Browser* browser = Browser::GetOrCreateTabbedBrowser(
- ProfileManager::GetDefaultProfileOrOffTheRecord());
- browser->ShowOptionsTab("setWallpaper");
- }
-
- virtual bool CanOpenSetWallpaperPage() OVERRIDE {
- return !chromeos::UserManager::Get()->IsLoggedInAsGuest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate);
-};
-
-} // namespace
-
-ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() {
- return new chromeos::UserWallpaperDelegate();
-}
-
-DesktopBackgroundObserver::DesktopBackgroundObserver() {
- registrar_.Add(
- this,
- chrome::NOTIFICATION_LOGIN_USER_CHANGED,
- content::NotificationService::AllSources());
-}
-
-DesktopBackgroundObserver::~DesktopBackgroundObserver() {
-}
-
-void DesktopBackgroundObserver::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_LOGIN_USER_CHANGED: {
- ash::Shell::GetInstance()->desktop_background_controller()->
- SetDesktopBackgroundImageMode();
- break;
- }
- default:
- NOTREACHED();
- }
-}
-
-} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698