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

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

Issue 137323005: Fixing endless loop when getting the active profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 6 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 virtual bool can_lock() const; 164 virtual bool can_lock() const;
165 165
166 virtual std::string username_hash() const; 166 virtual std::string username_hash() const;
167 167
168 // True if current user is logged in. 168 // True if current user is logged in.
169 virtual bool is_logged_in() const; 169 virtual bool is_logged_in() const;
170 170
171 // True if current user is active within the current session. 171 // True if current user is active within the current session.
172 virtual bool is_active() const; 172 virtual bool is_active() const;
173 173
174 // True if the user Profile is created.
175 bool is_profile_created() const {
176 return profile_is_created_;
177 }
178
174 protected: 179 protected:
175 friend class SupervisedUserManagerImpl; 180 friend class SupervisedUserManagerImpl;
176 friend class UserManagerImpl; 181 friend class UserManagerImpl;
177 friend class UserImageManagerImpl; 182 friend class UserImageManagerImpl;
178 // For testing: 183 // For testing:
179 friend class MockUserManager; 184 friend class MockUserManager;
180 friend class FakeUserManager; 185 friend class FakeUserManager;
181 186
182 // Do not allow anyone else to create new User instances. 187 // Do not allow anyone else to create new User instances.
183 static User* CreateRegularUser(const std::string& email); 188 static User* CreateRegularUser(const std::string& email);
184 static User* CreateGuestUser(); 189 static User* CreateGuestUser();
185 static User* CreateKioskAppUser(const std::string& kiosk_app_username); 190 static User* CreateKioskAppUser(const std::string& kiosk_app_username);
186 static User* CreateLocallyManagedUser(const std::string& username); 191 static User* CreateLocallyManagedUser(const std::string& username);
187 static User* CreateRetailModeUser(); 192 static User* CreateRetailModeUser();
188 static User* CreatePublicAccountUser(const std::string& email); 193 static User* CreatePublicAccountUser(const std::string& email);
189 194
190 explicit User(const std::string& email); 195 explicit User(const std::string& email);
191 virtual ~User(); 196 virtual ~User();
192 197
193 bool is_profile_created() const {
194 return profile_is_created_;
195 }
196
197 const std::string* GetAccountLocale() const { 198 const std::string* GetAccountLocale() const {
198 return account_locale_.get(); 199 return account_locale_.get();
199 } 200 }
200 201
201 // Setters are private so only UserManager can call them. 202 // Setters are private so only UserManager can call them.
202 void SetAccountLocale(const std::string& resolved_account_locale); 203 void SetAccountLocale(const std::string& resolved_account_locale);
203 204
204 void SetImage(const UserImage& user_image, int image_index); 205 void SetImage(const UserImage& user_image, int image_index);
205 206
206 void SetImageURL(const GURL& image_url); 207 void SetImageURL(const GURL& image_url);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 285
285 DISALLOW_COPY_AND_ASSIGN(User); 286 DISALLOW_COPY_AND_ASSIGN(User);
286 }; 287 };
287 288
288 // List of known users. 289 // List of known users.
289 typedef std::vector<User*> UserList; 290 typedef std::vector<User*> UserList;
290 291
291 } // namespace chromeos 292 } // namespace chromeos
292 293
293 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ 294 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698