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

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

Issue 3407008: [Chrome OS] Infrastucture for doing offline/online login simultaneously (Closed)
Patch Set: re-upload (again) due to 500s Created 10 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_CRYPTOHOME_OP_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_CRYPTOHOME_OP_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/ref_counted.h"
12 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
13 #include "chrome/browser/chrome_thread.h"
14
15 namespace chromeos {
16 class AuthAttemptState;
17 class AuthAttemptStateResolver;
18
19 class CryptohomeOp
20 : public base::RefCountedThreadSafe<CryptohomeOp>,
21 public CryptohomeLibrary::Delegate {
22 public:
23 CryptohomeOp(AuthAttemptState* current_attempt,
24 AuthAttemptStateResolver* callback);
25
26 virtual ~CryptohomeOp();
27
28 virtual bool Initiate() = 0;
29
30 // Implementation of CryptohomeLibrary::Delegate.
31 virtual void OnComplete(bool success, int return_code);
32
33 protected:
34 virtual void TriggerResolve(bool offline_outcome, int offline_code);
35
36 AuthAttemptState* const attempt_;
37 AuthAttemptStateResolver* const resolver_;
38
39 private:
40 DISALLOW_COPY_AND_ASSIGN(CryptohomeOp);
41 };
42
43 class MountAttempt : public CryptohomeOp {
44 public:
45 MountAttempt(AuthAttemptState* current_attempt,
46 AuthAttemptStateResolver* callback);
47 virtual ~MountAttempt();
48
49 bool Initiate();
50
51 private:
52 DISALLOW_COPY_AND_ASSIGN(MountAttempt);
53 };
54
55 class MountGuestAttempt : public CryptohomeOp {
56 public:
57 MountGuestAttempt(AuthAttemptState* current_attempt,
58 AuthAttemptStateResolver* callback);
59 virtual ~MountGuestAttempt();
60
61 bool Initiate();
62
63 private:
64 DISALLOW_COPY_AND_ASSIGN(MountGuestAttempt);
65 };
66
67 class MigrateAttempt : public CryptohomeOp {
68 public:
69 MigrateAttempt(AuthAttemptState* current_attempt,
70 AuthAttemptStateResolver* callback,
71 bool passing_old_hash,
72 const std::string& hash);
73 virtual ~MigrateAttempt();
74
75 bool Initiate();
76
77 private:
78 void TriggerResolve(bool offline_outcome, int offline_code);
79
80 const bool is_old_hash_;
81 const std::string hash_;
82
83 DISALLOW_COPY_AND_ASSIGN(MigrateAttempt);
84 };
85
86 class RemoveAttempt : public CryptohomeOp {
87 public:
88 RemoveAttempt(AuthAttemptState* current_attempt,
89 AuthAttemptStateResolver* callback);
90 virtual ~RemoveAttempt();
91
92 bool Initiate();
93
94 private:
95 void TriggerResolve(bool offline_outcome, int offline_code);
96
97 DISALLOW_COPY_AND_ASSIGN(RemoveAttempt);
98 };
99
100 } // namespace chromeos
101
102 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_CRYPTOHOME_OP_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/auth_attempt_state_resolver.cc ('k') | chrome/browser/chromeos/login/cryptohome_op.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698