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

Side by Side Diff: chromeos/login/auth/auth_attempt_state.cc

Issue 391373002: Refactoring : Move AuthAttempt and Authenticators to chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge wit ToT Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 #include "chrome/browser/chromeos/login/auth/auth_attempt_state.h" 5 #include "chromeos/login/auth/auth_attempt_state.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
stevenjb 2014/07/22 16:38:43 Layering violation.
Denis Kuznetsov (DE-MUC) 2014/07/23 17:34:11 Done.
10 #include "google_apis/gaia/gaia_auth_consumer.h" 10 #include "google_apis/gaia/gaia_auth_consumer.h"
11 #include "google_apis/gaia/gaia_auth_fetcher.h" 11 #include "google_apis/gaia/gaia_auth_fetcher.h"
12 12
13 using content::BrowserThread; 13 using content::BrowserThread;
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 AuthAttemptState::AuthAttemptState(const UserContext& user_context, 17 AuthAttemptState::AuthAttemptState(const UserContext& user_context,
18 user_manager::UserType user_type, 18 user_manager::UserType user_type,
19 bool unlock, 19 bool unlock,
20 bool online_complete, 20 bool online_complete,
21 bool user_is_new) 21 bool user_is_new)
22 : user_context(user_context), 22 : user_context(user_context),
23 user_type(user_type), 23 user_type(user_type),
24 unlock(unlock), 24 unlock(unlock),
25 online_complete_(online_complete), 25 online_complete_(online_complete),
26 online_outcome_(online_complete ? AuthFailure::UNLOCK_FAILED 26 online_outcome_(online_complete ? AuthFailure::UNLOCK_FAILED
27 : AuthFailure::NONE), 27 : AuthFailure::NONE),
28 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), 28 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed),
29 is_first_time_user_(user_is_new), 29 is_first_time_user_(user_is_new),
30 cryptohome_complete_(false), 30 cryptohome_complete_(false),
31 cryptohome_outcome_(false), 31 cryptohome_outcome_(false),
32 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE), 32 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE),
33 username_hash_obtained_(true), 33 username_hash_obtained_(true),
34 username_hash_valid_(true) { 34 username_hash_valid_(true) {
35 } 35 }
36 36
37 AuthAttemptState::~AuthAttemptState() {} 37 AuthAttemptState::~AuthAttemptState() {
38 }
38 39
39 void AuthAttemptState::RecordOnlineLoginStatus(const AuthFailure& outcome) { 40 void AuthAttemptState::RecordOnlineLoginStatus(const AuthFailure& outcome) {
40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
41 online_complete_ = true; 42 online_complete_ = true;
42 online_outcome_ = outcome; 43 online_outcome_ = outcome;
43 // We're either going to not try again, or try again with HOSTED 44 // We're either going to not try again, or try again with HOSTED
44 // accounts not allowed, so just set this here. 45 // accounts not allowed, so just set this here.
45 DisableHosted(); 46 DisableHosted();
46 } 47 }
47 48
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 124 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
124 return username_hash_obtained_; 125 return username_hash_obtained_;
125 } 126 }
126 127
127 bool AuthAttemptState::username_hash_valid() { 128 bool AuthAttemptState::username_hash_valid() {
128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
129 return username_hash_obtained_; 130 return username_hash_obtained_;
130 } 131 }
131 132
132 } // namespace chromeos 133 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698