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

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

Issue 10805007: [cros] UserManager cleanup regarding stub/demo users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused fields and fix compile Created 8 years, 5 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.h
diff --git a/chrome/browser/chromeos/login/user.h b/chrome/browser/chromeos/login/user.h
index 1bac12651f35021808dbad09203c9983eec9f32e..cd9a23fdcf2a6834552eb36e1e630c534810ca6e 100644
--- a/chrome/browser/chromeos/login/user.h
+++ b/chrome/browser/chromeos/login/user.h
@@ -14,11 +14,14 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_skia.h"
-// The demo user is represented by a domainless username.
-const char kDemoUser[] = "demouser";
-
namespace chromeos {
+// Fake username for the demo user.
+extern const char kDemoUser[];
+
+// Username for incognito login.
+extern const char kGuestUser[];
+
// A class representing information about a previously logged in user.
// Each user has a canonical email (username), returned by |email()| and
// may have a different displayed email (in the raw form as entered by user),
@@ -92,8 +95,8 @@ class User {
// The displayed (non-canonical) user email.
std::string display_email() const { return display_email_; }
- bool is_demo_user() const { return is_demo_user_; }
- bool is_guest() const { return is_guest_; }
+ bool is_demo_user() const { return email_ == kDemoUser; }
+ bool is_guest() const { return email_ == kGuestUser; }
private:
friend class UserManagerImpl;
@@ -101,7 +104,7 @@ class User {
friend class UserManagerTest;
// Do not allow anyone else to create new User instances.
- User(const std::string& email, bool is_guest);
+ explicit User(const std::string& email_guest);
~User();
// Setters are private so only UserManager can call them.
@@ -143,12 +146,6 @@ class User {
// True if current user image is a stub set by a |SetStubImage| call.
bool image_is_stub_;
- // Is this a guest account?
- bool is_guest_;
-
- // Is this a demo user account?
- bool is_demo_user_;
-
DISALLOW_COPY_AND_ASSIGN(User);
};

Powered by Google App Engine
This is Rietveld 408576698