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

Unified Diff: chrome/browser/extensions/api/passwords_private/passwords_private_api.h

Issue 1142693003: Implement the chrome.passwordsPrivate API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 5 years, 7 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/extensions/api/passwords_private/passwords_private_api.h
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_api.h b/chrome/browser/extensions/api/passwords_private/passwords_private_api.h
index 4cef1917f65877cd7aac77e2b9afeac96a7b7e94..2380b58996fa076fd1c506d6b6de489cda69f8e7 100644
--- a/chrome/browser/extensions/api/passwords_private/passwords_private_api.h
+++ b/chrome/browser/extensions/api/passwords_private/passwords_private_api.h
@@ -8,6 +8,8 @@
#include <string>
#include "base/macros.h"
+#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h"
+#include "chrome/browser/ui/passwords/password_manager_presenter.h"
#include "extensions/browser/extension_function.h"
namespace extensions {
@@ -66,8 +68,8 @@ class PasswordsPrivateRemovePasswordExceptionFunction :
class PasswordsPrivateGetPlaintextPasswordFunction :
public UIThreadExtensionFunction {
public:
- PasswordsPrivateGetPlaintextPasswordFunction() {}
- DECLARE_EXTENSION_FUNCTION("passwordsPrivate.GetPlaintextPassword",
+ PasswordsPrivateGetPlaintextPasswordFunction();
+ DECLARE_EXTENSION_FUNCTION("passwordsPrivate.getPlaintextPassword",
PASSWORDSPRIVATE_GETPLAINTEXTPASSWORD);
protected:
@@ -77,6 +79,17 @@ class PasswordsPrivateGetPlaintextPasswordFunction :
ResponseAction Run() override;
private:
+ // Called by the observer when the password has been retrieved so that this
+ // function can return the password value.
+ void ReplyWithPlaintextPassword(const std::string& plaintext_password);
+
+ // Observer used by PasswordsPrivateGetPlaintextPasswordFunction to listen
+ // for when PasswordsPrivateDelegate fetches the requested plaintext
+ // password.
+ class PlaintextPasswordObserver;
+
+ PlaintextPasswordObserver* observer_;
+
DISALLOW_COPY_AND_ASSIGN(PasswordsPrivateGetPlaintextPasswordFunction);
};

Powered by Google App Engine
This is Rietveld 408576698