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

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.h

Issue 10590004: [cros] Fake a stub user login when no --login-manager and --login-user are given. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further test fixes. Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 bool AreEphemeralUsersEnabled() const; 142 bool AreEphemeralUsersEnabled() const;
143 143
144 // Returns true if the user with the given email address is to be treated as 144 // Returns true if the user with the given email address is to be treated as
145 // ephemeral. 145 // ephemeral.
146 bool IsEphemeralUser(const std::string& email) const; 146 bool IsEphemeralUser(const std::string& email) const;
147 147
148 // Returns the user with the given email address if found in the persistent 148 // Returns the user with the given email address if found in the persistent
149 // list. Returns |NULL| otherwise. 149 // list. Returns |NULL| otherwise.
150 const User* FindUserInList(const std::string& email) const; 150 const User* FindUserInList(const std::string& email) const;
151 151
152 // Makes stub user the current logged-in user (for test paths).
153 void StubUserLoggedIn();
154
155 // Notifies on new user session. 152 // Notifies on new user session.
156 void NotifyOnLogin(); 153 void NotifyOnLogin();
157 154
158 // Reads user's oauth token status from local state preferences. 155 // Reads user's oauth token status from local state preferences.
159 User::OAuthTokenStatus LoadUserOAuthStatus(const std::string& username) const; 156 User::OAuthTokenStatus LoadUserOAuthStatus(const std::string& username) const;
160 157
161 void SetCurrentUserIsOwner(bool is_current_user_owner); 158 void SetCurrentUserIsOwner(bool is_current_user_owner);
162 159
163 // Sets one of the default images for the specified user and saves this 160 // Sets one of the default images for the specified user and saves this
164 // setting in local state. 161 // setting in local state.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 282
286 // Loads user image from its file. 283 // Loads user image from its file.
287 scoped_refptr<UserImageLoader> image_loader_; 284 scoped_refptr<UserImageLoader> image_loader_;
288 285
289 // List of all known users. User instances are owned by |this| and deleted 286 // List of all known users. User instances are owned by |this| and deleted
290 // when users are removed by |RemoveUserFromListInternal|. 287 // when users are removed by |RemoveUserFromListInternal|.
291 mutable UserList users_; 288 mutable UserList users_;
292 289
293 // The logged-in user. NULL until a user has logged in, then points to one 290 // The logged-in user. NULL until a user has logged in, then points to one
294 // of the User instances in |users_|, the |guest_user_| instance or an 291 // of the User instances in |users_|, the |guest_user_| instance or an
295 // ephemeral user instance. In test paths without login points to the 292 // ephemeral user instance.
296 // |stub_user_| instance.
297 User* logged_in_user_; 293 User* logged_in_user_;
298 294
299 // True if SessionStarted() has been called. 295 // True if SessionStarted() has been called.
300 bool session_started_; 296 bool session_started_;
301 297
302 // Cached flag of whether currently logged-in user is owner or not. 298 // Cached flag of whether currently logged-in user is owner or not.
303 // May be accessed on different threads, requires locking. 299 // May be accessed on different threads, requires locking.
304 bool is_current_user_owner_; 300 bool is_current_user_owner_;
305 mutable base::Lock is_current_user_owner_lock_; 301 mutable base::Lock is_current_user_owner_lock_;
306 302
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 350
355 // Data URL for |downloaded_profile_image_|. 351 // Data URL for |downloaded_profile_image_|.
356 std::string downloaded_profile_image_data_url_; 352 std::string downloaded_profile_image_data_url_;
357 353
358 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 354 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
359 }; 355 };
360 356
361 } // namespace chromeos 357 } // namespace chromeos
362 358
363 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 359 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698