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

Side by Side Diff: chrome/browser/policy/user_policy_token_loader.h

Issue 11946017: Remove old cloud policy code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_TOKEN_LOADER_H_
6 #define CHROME_BROWSER_POLICY_USER_POLICY_TOKEN_LOADER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/file_path.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h"
14
15 namespace policy {
16
17 // Handles disk access and threading details for loading and storing tokens.
18 // This is legacy-support code that reads the token from its prior location
19 // within the profile directory new code keeps the token in the policy blob
20 // maintained by session_manager.
21 class UserPolicyTokenLoader
22 : public base::RefCountedThreadSafe<UserPolicyTokenLoader> {
23 public:
24 // Callback interface for reporting a successful load.
25 class Delegate {
26 public:
27 virtual ~Delegate();
28 virtual void OnTokenLoaded(const std::string& token,
29 const std::string& device_id) = 0;
30 };
31
32 UserPolicyTokenLoader(const base::WeakPtr<Delegate>& delegate,
33 const FilePath& cache_file);
34
35 // Starts loading the disk cache. After the load is finished, the result is
36 // reported through the delegate.
37 void Load();
38
39 private:
40 friend class base::RefCountedThreadSafe<UserPolicyTokenLoader>;
41 ~UserPolicyTokenLoader();
42
43 void LoadOnFileThread();
44 void NotifyOnUIThread(const std::string& token,
45 const std::string& device_id);
46
47 const base::WeakPtr<Delegate> delegate_;
48 const FilePath cache_file_;
49
50 DISALLOW_COPY_AND_ASSIGN(UserPolicyTokenLoader);
51 };
52
53 } // namespace policy
54
55 #endif // CHROME_BROWSER_POLICY_USER_POLICY_TOKEN_LOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/user_policy_token_cache.cc ('k') | chrome/browser/policy/user_policy_token_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698