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

Unified Diff: chrome/browser/chromeos/login/users/user.cc

Issue 290513003: Move UserContext to its own file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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/users/user.cc
diff --git a/chrome/browser/chromeos/login/users/user.cc b/chrome/browser/chromeos/login/users/user.cc
index 9929496fcea3089c46906e2b8206926ad05aaa93..c28e48828723b73637c91c02fed620dce72bffe5 100644
--- a/chrome/browser/chromeos/login/users/user.cc
+++ b/chrome/browser/chromeos/login/users/user.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/chromeos/login/users/avatar/default_user_images.h"
#include "chrome/browser/chromeos/login/users/user_manager.h"
#include "google_apis/gaia/gaia_auth_util.h"
-#include "google_apis/gaia/gaia_auth_util.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -109,116 +108,6 @@ class PublicAccountUser : public User {
DISALLOW_COPY_AND_ASSIGN(PublicAccountUser);
};
-UserContext::UserContext() : does_need_password_hashing_(true),
- is_using_oauth_(true),
- auth_flow_(AUTH_FLOW_OFFLINE) {
-}
-
-UserContext::UserContext(const UserContext& other)
- : user_id_(other.user_id_),
- password_(other.password_),
- does_need_password_hashing_(other.does_need_password_hashing_),
- key_label_(other.key_label_),
- auth_code_(other.auth_code_),
- user_id_hash_(other.user_id_hash_),
- is_using_oauth_(other.is_using_oauth_),
- auth_flow_(other.auth_flow_) {
-}
-
-UserContext::UserContext(const std::string& user_id)
- : user_id_(login::CanonicalizeUserID(user_id)),
- does_need_password_hashing_(true),
- is_using_oauth_(true),
- auth_flow_(AUTH_FLOW_OFFLINE) {
-}
-
-UserContext::~UserContext() {
-}
-
-bool UserContext::operator==(const UserContext& context) const {
- return context.user_id_ == user_id_ &&
- context.password_ == password_ &&
- context.does_need_password_hashing_ == does_need_password_hashing_ &&
- context.key_label_ == key_label_ &&
- context.auth_code_ == auth_code_ &&
- context.user_id_hash_ == user_id_hash_ &&
- context.is_using_oauth_ == is_using_oauth_ &&
- context.auth_flow_ == auth_flow_;
-}
-
-const std::string& UserContext::GetUserID() const {
- return user_id_;
-}
-
-const std::string& UserContext::GetPassword() const {
- return password_;
-}
-
-bool UserContext::DoesNeedPasswordHashing() const {
- return does_need_password_hashing_;
-}
-
-const std::string& UserContext::GetKeyLabel() const {
- return key_label_;
-}
-
-const std::string& UserContext::GetAuthCode() const {
- return auth_code_;
-}
-
-const std::string& UserContext::GetUserIDHash() const {
- return user_id_hash_;
-}
-
-bool UserContext::IsUsingOAuth() const {
- return is_using_oauth_;
-}
-
-UserContext::AuthFlow UserContext::GetAuthFlow() const {
- return auth_flow_;
-}
-
-bool UserContext::HasCredentials() const {
- return (!user_id_.empty() && !password_.empty()) || !auth_code_.empty();
-}
-
-void UserContext::SetUserID(const std::string& user_id) {
- user_id_ = login::CanonicalizeUserID(user_id);
-}
-
-void UserContext::SetPassword(const std::string& password) {
- password_ = password;
-}
-
-void UserContext::SetDoesNeedPasswordHashing(bool does_need_password_hashing) {
- does_need_password_hashing_ = does_need_password_hashing;
-}
-
-void UserContext::SetKeyLabel(const std::string& key_label) {
- key_label_ = key_label;
-}
-
-void UserContext::SetAuthCode(const std::string& auth_code) {
- auth_code_ = auth_code;
-}
-
-void UserContext::SetUserIDHash(const std::string& user_id_hash) {
- user_id_hash_ = user_id_hash;
-}
-
-void UserContext::SetIsUsingOAuth(bool is_using_oauth) {
- is_using_oauth_ = is_using_oauth;
-}
-
-void UserContext::SetAuthFlow(AuthFlow auth_flow) {
- auth_flow_ = auth_flow;
-}
-
-void UserContext::ClearSecrets() {
- password_.clear();
- auth_code_.clear();
-}
-
std::string User::GetEmail() const {
return display_email();
}
« no previous file with comments | « chrome/browser/chromeos/login/users/user.h ('k') | chrome/browser/chromeos/login/users/user_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698