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

Unified Diff: chrome/browser/chromeos/login/user_image_manager.h

Issue 286933002: [cros login] Split login related classes into subfolders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in new tests Created 6 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/login/user_image_manager.h
diff --git a/chrome/browser/chromeos/login/user_image_manager.h b/chrome/browser/chromeos/login/user_image_manager.h
deleted file mode 100644
index ad13a1e05ce9b5bdad5934d3f569af4d1a37307b..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/user_image_manager.h
+++ /dev/null
@@ -1,107 +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.
-
-#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_MANAGER_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_MANAGER_H_
-
-#include <string>
-
-#include "chrome/browser/chromeos/login/user.h"
-
-class PrefRegistrySimple;
-
-namespace base {
-class FilePath;
-}
-
-namespace gfx {
-class ImageSkia;
-}
-
-namespace chromeos {
-
-class UserImage;
-class UserImageSyncObserver;
-
-// Base class that provides a mechanism for updating user images.
-// There is an instance of this class for each user in the system.
-class UserImageManager {
- public:
- // Registers user image manager preferences.
- static void RegisterPrefs(PrefRegistrySimple* registry);
-
- explicit UserImageManager(const std::string& user_id);
- virtual ~UserImageManager();
-
- // Loads user image data from Local State.
- virtual void LoadUserImage() = 0;
-
- // Indicates that a user has just logged in.
- virtual void UserLoggedIn(bool user_is_new, bool user_is_local) = 0;
-
- // Sets user image to the default image with index |image_index|, sends
- // LOGIN_USER_IMAGE_CHANGED notification and updates Local State.
- virtual void SaveUserDefaultImageIndex(int image_index) = 0;
-
- // Saves image to file, sends LOGIN_USER_IMAGE_CHANGED notification and
- // updates Local State.
- virtual void SaveUserImage(const UserImage& user_image) = 0;
-
- // Tries to load user image from disk; if successful, sets it for the user,
- // sends LOGIN_USER_IMAGE_CHANGED notification and updates Local State.
- virtual void SaveUserImageFromFile(const base::FilePath& path) = 0;
-
- // Sets profile image as user image for the user, sends
- // LOGIN_USER_IMAGE_CHANGED notification and updates Local State. If
- // the user is not logged-in or the last |DownloadProfileImage| call
- // has failed, a default grey avatar will be used until the user logs
- // in and profile image is downloaded successfully.
- virtual void SaveUserImageFromProfileImage() = 0;
-
- // Deletes user image and the corresponding image file.
- virtual void DeleteUserImage() = 0;
-
- // Starts downloading the profile image for the user. If user's image
- // index is |kProfileImageIndex|, newly downloaded image is immediately
- // set as user's current picture. |reason| is an arbitrary string
- // (used to report UMA histograms with download times).
- virtual void DownloadProfileImage(const std::string& reason) = 0;
-
- // Returns the result of the last successful profile image download, if any.
- // Otherwise, returns an empty bitmap.
- virtual const gfx::ImageSkia& DownloadedProfileImage() const = 0;
-
- // Returns sync observer attached to the user. Returns NULL if current
- // user can't sync images or user is not logged in.
- virtual UserImageSyncObserver* GetSyncObserver() const = 0;
-
- // Unregisters preference observers before browser process shutdown.
- // Also cancels any profile image download in progress.
- virtual void Shutdown() = 0;
-
- // Invoked when an external data reference is set for the user.
- virtual void OnExternalDataSet(const std::string& policy) = 0;
-
- // Invoked when the external data reference is cleared for the user.
- virtual void OnExternalDataCleared(const std::string& policy) = 0;
-
- // Invoked when the external data referenced for the user has been
- // fetched. Failed fetches are retried and the method is called only
- // when a fetch eventually succeeds. If a fetch fails permanently
- // (e.g. because the external data reference specifies an invalid URL),
- // the method is not called at all.
- virtual void OnExternalDataFetched(const std::string& policy,
- scoped_ptr<std::string> data) = 0;
-
- protected:
- const std::string& user_id() const { return user_id_; }
-
- // ID of user which images are managed by current instance of
- // UserImageManager.
- const std::string user_id_;
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_MANAGER_H_
« no previous file with comments | « chrome/browser/chromeos/login/user_image_loader.cc ('k') | chrome/browser/chromeos/login/user_image_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698