| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_ | 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_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "apps/app_lifetime_monitor.h" | 10 #include "apps/app_lifetime_monitor.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class TaskRunner; | 15 class TaskRunner; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace chromeos { | 18 namespace chromeos { |
| 18 | 19 |
| 19 class UserContext; | 20 class UserContext; |
| 20 | 21 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 | 33 |
| 33 // The UserContext returned here can be NULL if its time-to-live has expired. | 34 // The UserContext returned here can be NULL if its time-to-live has expired. |
| 34 UserContext* user_context() { return user_context_.get(); } | 35 UserContext* user_context() { return user_context_.get(); } |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 void Reset(); | 38 void Reset(); |
| 38 | 39 |
| 39 // apps::AppLifetimeMonitor::Observer: | 40 // apps::AppLifetimeMonitor::Observer: |
| 40 void OnAppDeactivated(Profile* profile, const std::string& app_id) override; | 41 void OnAppDeactivated(Profile* profile, const std::string& app_id) override; |
| 41 | 42 |
| 42 scoped_ptr<UserContext> user_context_; | 43 std::unique_ptr<UserContext> user_context_; |
| 43 | 44 |
| 44 apps::AppLifetimeMonitor* app_lifetime_monitor_; | 45 apps::AppLifetimeMonitor* app_lifetime_monitor_; |
| 45 | 46 |
| 46 base::WeakPtrFactory<ShortLivedUserContext> weak_ptr_factory_; | 47 base::WeakPtrFactory<ShortLivedUserContext> weak_ptr_factory_; |
| 47 | 48 |
| 48 DISALLOW_COPY_AND_ASSIGN(ShortLivedUserContext); | 49 DISALLOW_COPY_AND_ASSIGN(ShortLivedUserContext); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace chromeos | 52 } // namespace chromeos |
| 52 | 53 |
| 53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_ | 54 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_SHORT_LIVED_USER_CONTEXT_H_ |
| OLD | NEW |