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

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

Issue 11419184: Add public accounts to UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-upload against the correct upstream commit. Created 8 years, 1 month 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_manager_impl.h
diff --git a/chrome/browser/chromeos/login/user_manager_impl.h b/chrome/browser/chromeos/login/user_manager_impl.h
index 93e32f07d9192a3941ccfe6cedf1c35cfd43fe95..f1baa25ef4fe59dd2385468b2de859cc18752e30 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.h
+++ b/chrome/browser/chromeos/login/user_manager_impl.h
@@ -5,18 +5,23 @@
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
+#include <set>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
+#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/synchronization/lock.h"
+#include "base/values.h"
#include "chrome/browser/api/sync/profile_sync_service_observer.h"
#include "chrome/browser/chromeos/login/user.h"
#include "chrome/browser/chromeos/login/user_image_manager_impl.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/login/wallpaper_manager.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -68,6 +73,7 @@ class UserManagerImpl : public UserManager,
virtual bool IsCurrentUserEphemeral() const OVERRIDE;
virtual bool CanCurrentUserLock() const OVERRIDE;
virtual bool IsUserLoggedIn() const OVERRIDE;
+ virtual bool IsLoggedInAsRegularUser() const OVERRIDE;
virtual bool IsLoggedInAsDemoUser() const OVERRIDE;
virtual bool IsLoggedInAsPublicAccount() const OVERRIDE;
virtual bool IsLoggedInAsGuest() const OVERRIDE;
@@ -93,6 +99,16 @@ class UserManagerImpl : public UserManager,
UserManagerImpl();
+ // Helper function that copies users from |users_list| to |users_vector| and
+ // |users_set|. Duplicates and users already present in |existing_users| are
+ // skipped. The |logged_in_user| is also skipped and the return value
+ // indicates whether that user was found in |users_list|.
+ bool ParseUserList(std::vector<std::string>* users_vector,
+ std::set<std::string>* users_set,
+ const ListValue& users_list,
pastarmovj 2012/11/28 09:57:16 nit: move |users_vector| and |users_set| to be las
bartfab (slow) 2012/11/28 12:30:17 Done.
+ const std::set<std::string>& existing_users,
+ const std::string& logged_in_user) const;
+
// Loads |users_| from Local State if the list has not been loaded yet.
// Subsequent calls have no effect. Must be called on the UI thread.
void EnsureUsersLoaded();
@@ -125,12 +141,31 @@ class UserManagerImpl : public UserManager,
// Triggers an asynchronous ownership check.
void CheckOwnership();
- // Removes the user from the persistent list only. Also removes the user's
- // picture.
- void RemoveUserFromListInternal(const std::string& email);
+ // Removes data stored or cached outside the user's cryptohome (wallpaper,
+ // avatar, OAuth token status, display name, display email).
+ void RemoveNonCryptohomeData(const std::string& email);
+
+ // Moves the regular user identified by |email| out of the user list or to its
+ // front, as specified by |move_to_front|.
pastarmovj 2012/11/28 09:57:16 Can you please put some description why is this ne
bartfab (slow) 2012/11/28 12:30:17 Done.
+ User *UpdateRegularUsers(const std::string& email, bool move_to_front);
+
+ // Replaces the list of device-local users with |local_users_list|. Ensures
+ // that data stored outside theit cryptohomes is removed for any users who are
pastarmovj 2012/11/28 09:57:16 s/theit/their/
bartfab (slow) 2012/11/28 12:30:17 Done.
+ // no longer on the list. Returns |true| if the user list has changed.
+ bool UpdateLocalUsers(const base::ListValue& local_users_list);
+
+ // Interface to the signed settings store.
+ CrosSettings* cros_settings_;
- // List of all known users. User instances are owned by |this| and deleted
- // when users are removed by |RemoveUserFromListInternal|.
+ // True if observers have been registered with the signed settings store.
+ bool observing_cros_settings_;
+
+ // True if users have been loaded from prefs already.
+ bool users_loaded_;
+
+ // List of all known users. User instances are owned by |this|. Regular users
+ // are removed by |RemoveUserFromListInternal|, device-local users by
+ // |UpdateLocalUsers|.
pastarmovj 2012/11/28 09:57:16 Write a justification for having this member mutab
bartfab (slow) 2012/11/28 12:30:17 Actually, there is no justification. This seems to
mutable UserList users_;
// The logged-in user. NULL until a user has logged in, then points to one
@@ -178,6 +213,9 @@ class UserManagerImpl : public UserManager,
scoped_ptr<UserImageManagerImpl> user_image_manager_;
+ // Weak pointer factory.
+ base::WeakPtrFactory<UserManagerImpl> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
};

Powered by Google App Engine
This is Rietveld 408576698