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

Unified Diff: chrome/browser/chromeos/login/owner_key_utils.h

Issue 3141031: [Chrome OS] Wire up ownership API from libcros (Closed)
Patch Set: address davemoore comments Created 10 years, 4 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
Index: chrome/browser/chromeos/login/owner_key_utils.h
diff --git a/chrome/browser/chromeos/login/owner_key_utils.h b/chrome/browser/chromeos/login/owner_key_utils.h
index 38d9cbb7f4ac74a66685dbe7ce3b3c71969d4811..cc23b28eb76088e31490afe3ca8ab57cbf9c5e50 100644
--- a/chrome/browser/chromeos/login/owner_key_utils.h
+++ b/chrome/browser/chromeos/login/owner_key_utils.h
@@ -9,6 +9,8 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/ref_counted.h"
+#include "chrome/browser/chromeos/cros/login_library.h"
class FilePath;
@@ -18,7 +20,7 @@ class RSAPrivateKey;
namespace chromeos {
-class OwnerKeyUtils {
+class OwnerKeyUtils : public base::RefCounted<OwnerKeyUtils> {
public:
class Factory {
public:
@@ -26,7 +28,6 @@ class OwnerKeyUtils {
};
OwnerKeyUtils();
- virtual ~OwnerKeyUtils();
// Sets the factory used by the static method Create to create an
// OwnerKeyUtils. OwnerKeyUtils does not take ownership of
@@ -47,10 +48,13 @@ class OwnerKeyUtils {
// Returns NULL on error.
virtual base::RSAPrivateKey* GenerateKeyPair() = 0;
- // DER encodes public half of |pair| and exports it via DBus.
+ // DER encodes public half of |pair| and asynchronously exports it via DBus.
// The data sent is a DER-encoded X509 SubjectPublicKeyInfo object.
- // Returns false on error.
- virtual bool ExportPublicKeyViaDbus(base::RSAPrivateKey* pair) = 0;
+ // Returns false on error, true if the attempt is successfully begun.
+ // d->Run() will be called with a boolean indicating success or failure when
+ // the attempt is complete.
+ virtual bool ExportPublicKeyViaDbus(base::RSAPrivateKey* pair,
+ LoginLibrary::Delegate<bool>* d) = 0;
// DER encodes public half of |pair| and writes it out to |key_file|.
// The blob on disk is a DER-encoded X509 SubjectPublicKeyInfo object.
@@ -71,7 +75,11 @@ class OwnerKeyUtils {
virtual FilePath GetOwnerKeyFilePath() = 0;
+ protected:
+ virtual ~OwnerKeyUtils();
+
private:
+ friend class base::RefCounted<OwnerKeyUtils>;
static Factory* factory_;
};
« no previous file with comments | « chrome/browser/chromeos/login/mock_owner_key_utils.h ('k') | chrome/browser/chromeos/login/owner_key_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698