OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebCredentialManagerClient_h | 5 #ifndef WebCredentialManagerClient_h |
6 #define WebCredentialManagerClient_h | 6 #define WebCredentialManagerClient_h |
7 | 7 |
8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
9 #include "public/platform/WebCredentialManagerError.h" | 9 #include "public/platform/WebCredentialManagerError.h" |
10 #include "public/platform/WebPassOwnPtr.h" | |
11 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
12 | 11 |
| 12 #include <memory> |
| 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class WebCredential; | 16 class WebCredential; |
16 class WebURL; | 17 class WebURL; |
17 | 18 |
18 // WebCredentialManagerClient is an interface which allows an embedder to | 19 // WebCredentialManagerClient is an interface which allows an embedder to |
19 // implement 'navigator.credential.*' calls which are defined in the | 20 // implement 'navigator.credential.*' calls which are defined in the |
20 // 'credentialmanager' module. | 21 // 'credentialmanager' module. |
21 class WebCredentialManagerClient { | 22 class WebCredentialManagerClient { |
22 public: | 23 public: |
23 typedef WebCallbacks<WebPassOwnPtr<WebCredential>, WebCredentialManagerError
> RequestCallbacks; | 24 typedef WebCallbacks<std::unique_ptr<WebCredential>, WebCredentialManagerErr
or> RequestCallbacks; |
24 typedef WebCallbacks<void, WebCredentialManagerError> NotificationCallbacks; | 25 typedef WebCallbacks<void, WebCredentialManagerError> NotificationCallbacks; |
25 | 26 |
26 // Ownership of the callback is transferred to the callee for each of | 27 // Ownership of the callback is transferred to the callee for each of |
27 // the following methods. | 28 // the following methods. |
28 virtual void dispatchFailedSignIn(const WebCredential&, NotificationCallback
s*) { } | 29 virtual void dispatchFailedSignIn(const WebCredential&, NotificationCallback
s*) { } |
29 virtual void dispatchStore(const WebCredential&, NotificationCallbacks*) { } | 30 virtual void dispatchStore(const WebCredential&, NotificationCallbacks*) { } |
30 virtual void dispatchRequireUserMediation(NotificationCallbacks*) { } | 31 virtual void dispatchRequireUserMediation(NotificationCallbacks*) { } |
31 virtual void dispatchGet(bool zeroClickOnly, bool includePasswords, const We
bVector<WebURL>& federations, RequestCallbacks*) {} | 32 virtual void dispatchGet(bool zeroClickOnly, bool includePasswords, const We
bVector<WebURL>& federations, RequestCallbacks*) {} |
32 }; | 33 }; |
33 | 34 |
34 } // namespace blink | 35 } // namespace blink |
35 | 36 |
36 #endif // WebCredentialManager_h | 37 #endif // WebCredentialManager_h |
OLD | NEW |