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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/user_policy_token_loader.h
diff --git a/chrome/browser/policy/user_policy_token_loader.h b/chrome/browser/policy/user_policy_token_loader.h
new file mode 100644
index 0000000000000000000000000000000000000000..b73d78484cfc76fe8c2aad3136fec929f746f9a2
--- /dev/null
+++ b/chrome/browser/policy/user_policy_token_loader.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 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_TOKEN_LOADER_H_
+#define CHROME_BROWSER_POLICY_USER_POLICY_TOKEN_LOADER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/file_path.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+
+namespace policy {
+
+// Handles disk access and threading details for loading and storing tokens.
+// This is legacy-support code that reads the token from its prior location
+// within the profile directory new code keeps the token in the policy blob
+// maintained by session_manager.
+class UserPolicyTokenLoader
+ : public base::RefCountedThreadSafe<UserPolicyTokenLoader> {
+ public:
+ // Callback interface for reporting a successful load.
+ class Delegate {
+ public:
+ virtual ~Delegate();
+ virtual void OnTokenLoaded(const std::string& token,
+ const std::string& device_id) = 0;
+ };
+
+ UserPolicyTokenLoader(const base::WeakPtr<Delegate>& delegate,
+ const FilePath& cache_file);
+
+ // Starts loading the disk cache. After the load is finished, the result is
+ // reported through the delegate.
+ void Load();
+
+ private:
+ friend class base::RefCountedThreadSafe<UserPolicyTokenLoader>;
+ ~UserPolicyTokenLoader();
+
+ void LoadOnFileThread();
+ void NotifyOnUIThread(const std::string& token,
+ const std::string& device_id);
+
+ const base::WeakPtr<Delegate> delegate_;
+ const FilePath cache_file_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserPolicyTokenLoader);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_USER_POLICY_TOKEN_LOADER_H_
« 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