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

Side by Side Diff: chrome/browser/chromeos/login/online_attempt_host.h

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: rebase4 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h" 12 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h"
13 13
14 class Profile; 14 class Profile;
15 15
16 namespace chromeos { 16 namespace chromeos {
17 17
18 class AuthAttemptState; 18 class AuthAttemptState;
19 class OnlineAttempt; 19 class OnlineAttempt;
20 struct UserCredentials;
20 21
21 // Helper class which hosts OnlineAttempt for online credentials checking. 22 // Helper class which hosts OnlineAttempt for online credentials checking.
22 class OnlineAttemptHost : public AuthAttemptStateResolver { 23 class OnlineAttemptHost : public AuthAttemptStateResolver {
23 public: 24 public:
24 class Delegate { 25 class Delegate {
25 public: 26 public:
26 // Called after credentials were checked online. 27 // Called after credentials were checked online.
27 virtual void OnChecked(const std::string &username, bool success) = 0; 28 virtual void OnChecked(const std::string &username, bool success) = 0;
28 }; 29 };
29 30
30 explicit OnlineAttemptHost(Delegate *delegate); 31 explicit OnlineAttemptHost(Delegate *delegate);
31 virtual ~OnlineAttemptHost(); 32 virtual ~OnlineAttemptHost();
32 33
33 // Checks credentials using an online attempt. Calls callback with the check 34 // Checks credentials using an online attempt. Calls callback with the check
34 // result (whether authentication was successful). Note, only one checking at 35 // result (whether authentication was successful). Note, only one checking at
35 // a time (the newest call stops the old one, if called with another username 36 // a time (the newest call stops the old one, if called with another username
36 // and password combination). 37 // and password combination).
37 void Check(Profile* profile, 38 void Check(Profile* profile,
38 const std::string &username, 39 const UserCredentials& credentials);
39 const std::string &password);
40 40
41 // Resets the checking process. 41 // Resets the checking process.
42 void Reset(); 42 void Reset();
43 43
44 // AuthAttemptStateResolver overrides. 44 // AuthAttemptStateResolver overrides.
45 // Executed on IO thread. 45 // Executed on IO thread.
46 virtual void Resolve() OVERRIDE; 46 virtual void Resolve() OVERRIDE;
47 47
48 // Does an actual resolve on UI thread. 48 // Does an actual resolve on UI thread.
49 void ResolveOnUIThread(bool success); 49 void ResolveOnUIThread(bool success);
50 50
51 private: 51 private:
52 Delegate* delegate_; 52 Delegate* delegate_;
53 std::string current_attempt_hash_; 53 std::string current_attempt_hash_;
54 std::string current_username_; 54 std::string current_username_;
55 scoped_ptr<OnlineAttempt> online_attempt_; 55 scoped_ptr<OnlineAttempt> online_attempt_;
56 scoped_ptr<AuthAttemptState> state_; 56 scoped_ptr<AuthAttemptState> state_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(OnlineAttemptHost); 58 DISALLOW_COPY_AND_ASSIGN(OnlineAttemptHost);
59 }; 59 };
60 60
61 } // chromeos 61 } // chromeos
62 62
63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_ 63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/online_attempt.cc ('k') | chrome/browser/chromeos/login/online_attempt_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698