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

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/short_lived_user_context.h

Issue 668213003: Reauthenticate the user before launching Smart Lock setup app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2014 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_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10
11 namespace base {
12 class TaskRunner;
13 }
14
15 namespace chromeos {
16
17 class UserContext;
18
19 // Stores the UserContext of an authentication operation on the sign-in/lock
20 // screen, which is used to generate the keys for Easy Sign-in. Because the
21 // UserContext stores the key to login, this class will schedule it to be
22 // deleted after a set period of time for security.
23 class ShortLivedUserContext {
24 public:
25 ShortLivedUserContext(const UserContext& user_context,
26 base::TaskRunner* task_runner);
27 virtual ~ShortLivedUserContext();
28
29 // The UserContext returned here can be NULL if its time-to-live has expired.
30 UserContext* user_context() { return user_context_.get(); }
31
32 private:
33 void DeleteUserContext();
34
35 scoped_ptr<UserContext> user_context_;
36
37 base::WeakPtrFactory<ShortLivedUserContext> weak_ptr_factory_;
38
39 DISALLOW_COPY_AND_ASSIGN(ShortLivedUserContext);
40 };
41
42 } // namespace chromeos
43
44 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698