Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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_POLICY_USER_POLICY_KEY_H_ | |
| 6 #define CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback_forward.h" | |
| 12 #include "base/file_path.h" | |
| 13 #include "base/memory/weak_ptr.h" | |
| 14 #include "base/threading/non_thread_safe.h" | |
| 15 | |
| 16 namespace policy { | |
| 17 | |
| 18 class UserPolicyKey : public base::NonThreadSafe { | |
|
Mattias Nissler (ping if slow)
2013/02/07 14:12:07
Not quite convinced putting this into its own clas
Joao da Silva
2013/02/07 16:32:00
Done.
| |
| 19 public: | |
| 20 explicit UserPolicyKey(const FilePath& path); | |
| 21 ~UserPolicyKey(); | |
| 22 | |
| 23 // Reloads the user policy key from |path_|, and posts |callback| to the | |
| 24 // message loop that owns the object. | |
| 25 void Load(const base::Closure& callback); | |
| 26 | |
| 27 const std::vector<uint8>& key() const { return key_; } | |
| 28 | |
| 29 private: | |
| 30 void OnKeyLoaded(std::vector<uint8>* key, const base::Closure& callback); | |
| 31 | |
| 32 FilePath path_; | |
| 33 std::vector<uint8> key_; | |
| 34 base::WeakPtrFactory<UserPolicyKey> weak_ptr_factory_; | |
|
Mattias Nissler (ping if slow)
2013/02/07 14:12:07
DISALLOw_COPY_AND_ASSIGN?
| |
| 35 }; | |
| 36 | |
| 37 } // namespace policy | |
| 38 | |
| 39 #endif // CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_ | |
| OLD | NEW |