Chromium Code Reviews| Index: chrome/browser/policy/user_policy_key.h |
| diff --git a/chrome/browser/policy/user_policy_key.h b/chrome/browser/policy/user_policy_key.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2b5afd406e6335dd9db63c79add8204c4c1e14ae |
| --- /dev/null |
| +++ b/chrome/browser/policy/user_policy_key.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_ |
| +#define CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback_forward.h" |
| +#include "base/file_path.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/threading/non_thread_safe.h" |
| + |
| +namespace policy { |
| + |
| +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.
|
| + public: |
| + explicit UserPolicyKey(const FilePath& path); |
| + ~UserPolicyKey(); |
| + |
| + // Reloads the user policy key from |path_|, and posts |callback| to the |
| + // message loop that owns the object. |
| + void Load(const base::Closure& callback); |
| + |
| + const std::vector<uint8>& key() const { return key_; } |
| + |
| + private: |
| + void OnKeyLoaded(std::vector<uint8>* key, const base::Closure& callback); |
| + |
| + FilePath path_; |
| + std::vector<uint8> key_; |
| + base::WeakPtrFactory<UserPolicyKey> weak_ptr_factory_; |
|
Mattias Nissler (ping if slow)
2013/02/07 14:12:07
DISALLOw_COPY_AND_ASSIGN?
|
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_ |