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 WebCredentialManager_h | 5 #ifndef WebCredentialManagerClient_h |
6 #define WebCredentialManager_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/WebString.h" | |
11 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
12 | 11 |
13 namespace blink { | 12 namespace blink { |
14 | 13 |
15 // WebCredentialManager provides an interface for asking Blink's embedder to | 14 class WebCredential; |
16 // respond to `navigator.credentials.*` calls. | 15 class WebURL; |
17 class WebCredentialManager { | 16 |
17 // WebCredentialManagerClient is an interface which allows an embedder to | |
18 // implement 'navigator.credential.*' calls which are defined in the | |
19 // 'credentialmanager' module. | |
20 class WebCredentialManagerClient { | |
18 public: | 21 public: |
19 typedef WebCallbacks<WebCredential, WebCredentialManagerError> RequestCallba cks; | 22 typedef WebCallbacks<WebCredential, WebCredentialManagerError> RequestCallba cks; |
20 typedef WebCallbacks<void, WebCredentialManagerError> NotificationCallbacks; | 23 typedef WebCallbacks<void, WebCredentialManagerError> NotificationCallbacks; |
21 | 24 |
22 WebCredentialManager() { } | 25 // Ownership of the callback is transferred to the callee for each of |
23 virtual ~WebCredentialManager() { } | 26 // the following methods. |
24 | 27 virtual void dispatchFailedSignIn(const WebCredential&, NotificationCallback s*) = 0; |
pfeldman
2014/08/20 12:23:43
Do you plan on further growing this interface? If
Mike West
2014/08/20 13:05:43
Sounds reasonable. It's not yet clear what the API
| |
25 // Ownership of the callback is transferred to the callee for each of the fo llowing methods. | 28 virtual void dispatchSignedIn(const WebCredential&, NotificationCallbacks*) = 0; |
26 virtual void dispatchFailedSignIn(const WebCredential&, NotificationCallback s*) { } | 29 virtual void dispatchSignedOut(NotificationCallbacks*) = 0; |
27 virtual void dispatchSignedIn(const WebCredential&, NotificationCallbacks*) { } | 30 virtual void dispatchRequest(bool zeroClickOnly, const WebVector<WebURL>& fe derations, RequestCallbacks*) = 0; |
28 virtual void dispatchSignedOut(NotificationCallbacks*) { } | |
29 virtual void dispatchRequest(bool zeroClickOnly, const WebVector<WebURL>& fe derations, RequestCallbacks*) { } | |
30 }; | 31 }; |
31 | 32 |
32 } // namespace blink | 33 } // namespace blink |
33 | 34 |
34 #endif // WebCredentialManager_h | 35 #endif // WebCredentialManager_h |
OLD | NEW |