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

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

Issue 12704002: Support for auth code based authentication flow for both app and web UI driven flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 #include "chrome/browser/chromeos/login/user.h" 5 #include "chrome/browser/chromeos/login/user.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/login/default_user_images.h" 10 #include "chrome/browser/chromeos/login/default_user_images.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 explicit PublicAccountUser(const std::string& email); 104 explicit PublicAccountUser(const std::string& email);
105 virtual ~PublicAccountUser(); 105 virtual ~PublicAccountUser();
106 106
107 // Overridden from User: 107 // Overridden from User:
108 virtual UserType GetType() const OVERRIDE; 108 virtual UserType GetType() const OVERRIDE;
109 109
110 private: 110 private:
111 DISALLOW_COPY_AND_ASSIGN(PublicAccountUser); 111 DISALLOW_COPY_AND_ASSIGN(PublicAccountUser);
112 }; 112 };
113 113
114 UserCredentials::UserCredentials() {
115 }
116
117 UserCredentials::UserCredentials(const std::string& username,
118 const std::string& password,
119 const std::string& auth_code)
120 : username(username),
121 password(password),
122 auth_code(auth_code) {
123 }
124
114 string16 User::GetDisplayName() const { 125 string16 User::GetDisplayName() const {
115 // Fallback to the email account name in case display name haven't been set. 126 // Fallback to the email account name in case display name haven't been set.
116 return display_name_.empty() ? 127 return display_name_.empty() ?
117 UTF8ToUTF16(GetAccountName(true)) : 128 UTF8ToUTF16(GetAccountName(true)) :
118 display_name_; 129 display_name_;
119 } 130 }
120 131
121 std::string User::GetAccountName(bool use_display_email) const { 132 std::string User::GetAccountName(bool use_display_email) const {
122 if (use_display_email && !display_email_.empty()) 133 if (use_display_email && !display_email_.empty())
123 return GetUserName(display_email_); 134 return GetUserName(display_email_);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 PublicAccountUser::PublicAccountUser(const std::string& email) : User(email) { 269 PublicAccountUser::PublicAccountUser(const std::string& email) : User(email) {
259 } 270 }
260 271
261 PublicAccountUser::~PublicAccountUser() {} 272 PublicAccountUser::~PublicAccountUser() {}
262 273
263 User::UserType PublicAccountUser::GetType() const { 274 User::UserType PublicAccountUser::GetType() const {
264 return USER_TYPE_PUBLIC_ACCOUNT; 275 return USER_TYPE_PUBLIC_ACCOUNT;
265 } 276 }
266 277
267 } // namespace chromeos 278 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698