OLD | NEW |
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/easy_unlock/short_lived_user_context.h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/short_lived_user_context.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/location.h" | 10 #include "base/location.h" |
9 #include "base/task_runner.h" | 11 #include "base/task_runner.h" |
10 #include "chrome/common/extensions/extension_constants.h" | 12 #include "chrome/common/extensions/extension_constants.h" |
11 #include "chromeos/login/auth/user_context.h" | 13 #include "chromeos/login/auth/user_context.h" |
12 | 14 |
13 namespace chromeos { | 15 namespace chromeos { |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 // The number of minutes that the user context will be stored. | 19 // The number of minutes that the user context will be stored. |
18 const int64 kUserContextTimeToLiveMinutes = 10; | 20 const int64_t kUserContextTimeToLiveMinutes = 10; |
19 | 21 |
20 } // namespace | 22 } // namespace |
21 | 23 |
22 ShortLivedUserContext::ShortLivedUserContext( | 24 ShortLivedUserContext::ShortLivedUserContext( |
23 const UserContext& user_context, | 25 const UserContext& user_context, |
24 apps::AppLifetimeMonitor* app_lifetime_monitor, | 26 apps::AppLifetimeMonitor* app_lifetime_monitor, |
25 base::TaskRunner* task_runner) | 27 base::TaskRunner* task_runner) |
26 : user_context_(new UserContext(user_context)), | 28 : user_context_(new UserContext(user_context)), |
27 app_lifetime_monitor_(app_lifetime_monitor), | 29 app_lifetime_monitor_(app_lifetime_monitor), |
28 weak_ptr_factory_(this) { | 30 weak_ptr_factory_(this) { |
(...skipping 17 matching lines...) Expand all Loading... |
46 } | 48 } |
47 } | 49 } |
48 | 50 |
49 void ShortLivedUserContext::OnAppDeactivated(Profile* profile, | 51 void ShortLivedUserContext::OnAppDeactivated(Profile* profile, |
50 const std::string& app_id) { | 52 const std::string& app_id) { |
51 if (app_id == extension_misc::kEasyUnlockAppId) | 53 if (app_id == extension_misc::kEasyUnlockAppId) |
52 Reset(); | 54 Reset(); |
53 } | 55 } |
54 | 56 |
55 } // namespace chromeos | 57 } // namespace chromeos |
OLD | NEW |