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

Side by Side Diff: components/user_manager/user_manager_base.h

Issue 2798343003: Merge "cros: Fix flaky owner detection" (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_
6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Should be called when regular user was removed. 243 // Should be called when regular user was removed.
244 virtual void OnUserRemoved(const AccountId& account_id) = 0; 244 virtual void OnUserRemoved(const AccountId& account_id) = 0;
245 245
246 // Update the global LoginState. 246 // Update the global LoginState.
247 virtual void UpdateLoginState(const User* active_user, 247 virtual void UpdateLoginState(const User* active_user,
248 const User* primary_user, 248 const User* primary_user,
249 bool is_current_user_owner) const = 0; 249 bool is_current_user_owner) const = 0;
250 250
251 // Getters/setters for private members. 251 // Getters/setters for private members.
252 252
253 virtual void SetCurrentUserIsOwner(bool is_current_user_owner);
254
255 virtual bool GetEphemeralUsersEnabled() const; 253 virtual bool GetEphemeralUsersEnabled() const;
256 virtual void SetEphemeralUsersEnabled(bool enabled); 254 virtual void SetEphemeralUsersEnabled(bool enabled);
257 255
258 virtual void SetOwnerId(const AccountId& owner_account_id); 256 virtual void SetOwnerId(const AccountId& owner_account_id);
259 257
260 virtual const AccountId& GetPendingUserSwitchID() const; 258 virtual const AccountId& GetPendingUserSwitchID() const;
261 virtual void SetPendingUserSwitchId(const AccountId& account_id); 259 virtual void SetPendingUserSwitchId(const AccountId& account_id);
262 260
263 // The logged-in user that is currently active in current session. 261 // The logged-in user that is currently active in current session.
264 // NULL until a user has logged in, then points to one 262 // NULL until a user has logged in, then points to one
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 virtual void UpdateUserAccountLocale(const AccountId& account_id, 331 virtual void UpdateUserAccountLocale(const AccountId& account_id,
334 const std::string& locale); 332 const std::string& locale);
335 333
336 // Updates user account after locale was resolved. 334 // Updates user account after locale was resolved.
337 void DoUpdateAccountLocale(const AccountId& account_id, 335 void DoUpdateAccountLocale(const AccountId& account_id,
338 std::unique_ptr<std::string> resolved_locale); 336 std::unique_ptr<std::string> resolved_locale);
339 337
340 // Indicates stage of loading user from prefs. 338 // Indicates stage of loading user from prefs.
341 UserLoadStage user_loading_stage_ = STAGE_NOT_LOADED; 339 UserLoadStage user_loading_stage_ = STAGE_NOT_LOADED;
342 340
343 // Cached flag of whether currently logged-in user is owner or not.
344 // May be accessed on different threads, requires locking.
345 bool is_current_user_owner_ = false;
346 mutable base::Lock is_current_user_owner_lock_;
347
348 // Cached flag of whether the currently logged-in user existed before this 341 // Cached flag of whether the currently logged-in user existed before this
349 // login. 342 // login.
350 bool is_current_user_new_ = false; 343 bool is_current_user_new_ = false;
351 344
352 // Cached flag of whether the currently logged-in user is a regular user who 345 // Cached flag of whether the currently logged-in user is a regular user who
353 // logged in as ephemeral. Storage of persistent information is avoided for 346 // logged in as ephemeral. Storage of persistent information is avoided for
354 // such users by not adding them to the persistent user list, not downloading 347 // such users by not adding them to the persistent user list, not downloading
355 // their custom avatars and mounting their cryptohomes using tmpfs. Defaults 348 // their custom avatars and mounting their cryptohomes using tmpfs. Defaults
356 // to |false|. 349 // to |false|.
357 bool is_current_user_ephemeral_regular_user_ = false; 350 bool is_current_user_ephemeral_regular_user_ = false;
(...skipping 30 matching lines...) Expand all
388 scoped_refptr<base::TaskRunner> task_runner_; 381 scoped_refptr<base::TaskRunner> task_runner_;
389 382
390 base::WeakPtrFactory<UserManagerBase> weak_factory_; 383 base::WeakPtrFactory<UserManagerBase> weak_factory_;
391 384
392 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); 385 DISALLOW_COPY_AND_ASSIGN(UserManagerBase);
393 }; 386 };
394 387
395 } // namespace user_manager 388 } // namespace user_manager
396 389
397 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ 390 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_service_unittest.cc ('k') | components/user_manager/user_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698