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

Unified Diff: ios/chrome/browser/passwords/js_credential_manager.h

Issue 1456983002: Move JS-related password manager code upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Indent fixed, capitalisation fixed, typo fixed Created 5 years, 1 month 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: ios/chrome/browser/passwords/js_credential_manager.h
diff --git a/ios/chrome/browser/passwords/js_credential_manager.h b/ios/chrome/browser/passwords/js_credential_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d6d34900829f61a5b315b0e23ed63dd0b94af354
--- /dev/null
+++ b/ios/chrome/browser/passwords/js_credential_manager.h
@@ -0,0 +1,50 @@
+// Copyright 2015 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 IOS_CHROME_BROWSER_PASSWORDS_JS_CREDENTIAL_MANAGER_H_
+#define IOS_CHROME_BROWSER_PASSWORDS_JS_CREDENTIAL_MANAGER_H_
+
+#include "ios/web/public/web_state/credential.h"
+#import "ios/web/public/web_state/js/crw_js_injection_manager.h"
+
+namespace base {
+class DictionaryValue;
+} // namespace base
+
+// Constants for rejecting requests.
+extern const char kCredentialsPendingRequestErrorType[];
+extern const char kCredentialsPendingRequestErrorMessage[];
+extern const char kCredentialsSecurityErrorType[];
+extern const char kCredentialsPasswordStoreUnavailableErrorType[];
+extern const char kCredentialsPasswordStoreUnavailableErrorMessage[];
+extern const char kCredentialsSecurityErrorMessageUntrustedOrigin[];
+
+// Injects the JavaScript that implements the request credentials API and
+// provides an app-side interface for interacting with it.
+@interface JSCredentialManager : CRWJSInjectionManager
+
+// Resolves the JavaScript Promise associated with |requestID| with the
+// specified |credential|. |completionHandler| will be invoked after the
+// operation has completed with YES if successful.
+- (void)resolvePromiseWithRequestID:(NSInteger)requestID
+ credential:(const web::Credential&)credential
+ completionHandler:(void (^)(BOOL))completionHandler;
+
+// Resolves the JavaScript Promise associated with |requestID|.
+// |completionHandler| will be invoked after the operation has completed with
+// YES if successful.
+- (void)resolvePromiseWithRequestID:(NSInteger)requestID
+ completionHandler:(void (^)(BOOL))completionHandler;
+
+// Rejects the JavaScript Promise associated with |requestID| with an Error of
+// the specified |errorType| and |message|. |completionHandler| will be invoked
+// after the operation has completed with YES if successful.
+- (void)rejectPromiseWithRequestID:(NSInteger)requestID
+ errorType:(NSString*)errorType
+ message:(NSString*)message
+ completionHandler:(void (^)(BOOL))completionHandler;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_PASSWORDS_JS_CREDENTIAL_MANAGER_H_
« no previous file with comments | « ios/chrome/browser/passwords/credential_manager.mm ('k') | ios/chrome/browser/passwords/js_credential_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698