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

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

Issue 286933002: [cros login] Split login related classes into subfolders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in new tests 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_
7
8 #include <string>
9
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h"
14
15 class Profile;
16
17 namespace chromeos {
18
19 class AuthAttemptState;
20 class OnlineAttempt;
21 class UserContext;
22
23 // Helper class which hosts OnlineAttempt for online credentials checking.
24 class OnlineAttemptHost : public AuthAttemptStateResolver {
25 public:
26 class Delegate {
27 public:
28 // Called after user_context were checked online.
29 virtual void OnChecked(const std::string &username, bool success) = 0;
30 };
31
32 explicit OnlineAttemptHost(Delegate *delegate);
33 virtual ~OnlineAttemptHost();
34
35 // Checks user credentials using an online attempt. Calls callback with the
36 // check result (whether authentication was successful). Note, only one
37 // checking at a time (the newest call stops the old one, if called with
38 // another username and password combination).
39 void Check(Profile* profile,
40 const UserContext& user_context);
41
42 // Resets the checking process.
43 void Reset();
44
45 // AuthAttemptStateResolver overrides.
46 // Executed on IO thread.
47 virtual void Resolve() OVERRIDE;
48
49 // Does an actual resolve on UI thread.
50 void ResolveOnUIThread(bool success);
51
52 private:
53 Delegate* delegate_;
54 std::string current_attempt_hash_;
55 std::string current_username_;
56 scoped_ptr<OnlineAttempt> online_attempt_;
57 scoped_ptr<AuthAttemptState> state_;
58 base::WeakPtrFactory<OnlineAttemptHost> weak_ptr_factory_;
59
60 DISALLOW_COPY_AND_ASSIGN(OnlineAttemptHost);
61 };
62
63 } // namespace chromeos
64
65 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ONLINE_ATTEMPT_HOST_H_
66
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