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 CredentialManagerClient_h | 5 #ifndef CredentialManagerClient_h |
6 #define CredentialManagerClient_h | 6 #define CredentialManagerClient_h |
7 | 7 |
8 #include "core/page/Page.h" | 8 #include "core/page/Page.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
11 #include "public/platform/WebCredentialManagerClient.h" | 11 #include "public/platform/WebCredentialManagerClient.h" |
12 #include "public/platform/WebVector.h" | 12 #include "public/platform/WebVector.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class ExecutionContext; | 16 class ExecutionContext; |
17 class Page; | 17 class Page; |
18 class WebCredential; | 18 class WebCredential; |
19 class WebURL; | 19 class WebURL; |
20 | 20 |
21 // CredentialManagerClient lives as a supplement to Page, and wraps the embedder
-provided | 21 // CredentialManagerClient lives as a supplement to Page, and wraps the embedder
-provided |
22 // WebCredentialManagerClient's methods to make them visible to the bindings cod
e. | 22 // WebCredentialManagerClient's methods to make them visible to the bindings cod
e. |
23 class MODULES_EXPORT CredentialManagerClient final : public GarbageCollectedFina
lized<CredentialManagerClient>, public HeapSupplement<Page> { | 23 class MODULES_EXPORT CredentialManagerClient final : public GarbageCollectedFina
lized<CredentialManagerClient>, public Supplement<Page> { |
24 USING_GARBAGE_COLLECTED_MIXIN(CredentialManagerClient); | 24 USING_GARBAGE_COLLECTED_MIXIN(CredentialManagerClient); |
25 public: | 25 public: |
26 explicit CredentialManagerClient(WebCredentialManagerClient*); | 26 explicit CredentialManagerClient(WebCredentialManagerClient*); |
27 virtual ~CredentialManagerClient(); | 27 virtual ~CredentialManagerClient(); |
28 DECLARE_VIRTUAL_TRACE(); | 28 DECLARE_VIRTUAL_TRACE(); |
29 | 29 |
30 static const char* supplementName(); | 30 static const char* supplementName(); |
31 static CredentialManagerClient* from(Page*); | 31 static CredentialManagerClient* from(Page*); |
32 static CredentialManagerClient* from(ExecutionContext*); | 32 static CredentialManagerClient* from(ExecutionContext*); |
33 | 33 |
34 // Ownership of the callback is transferred to the callee for each of | 34 // Ownership of the callback is transferred to the callee for each of |
35 // the following methods. | 35 // the following methods. |
36 virtual void dispatchFailedSignIn(const WebCredential&, WebCredentialManager
Client::NotificationCallbacks*); | 36 virtual void dispatchFailedSignIn(const WebCredential&, WebCredentialManager
Client::NotificationCallbacks*); |
37 virtual void dispatchStore(const WebCredential&, WebCredentialManagerClient:
:NotificationCallbacks*); | 37 virtual void dispatchStore(const WebCredential&, WebCredentialManagerClient:
:NotificationCallbacks*); |
38 virtual void dispatchRequireUserMediation(WebCredentialManagerClient::Notifi
cationCallbacks*); | 38 virtual void dispatchRequireUserMediation(WebCredentialManagerClient::Notifi
cationCallbacks*); |
39 virtual void dispatchGet(bool zeroClickOnly, bool includePasswords, const We
bVector<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks*); | 39 virtual void dispatchGet(bool zeroClickOnly, bool includePasswords, const We
bVector<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks*); |
40 | 40 |
41 private: | 41 private: |
42 WebCredentialManagerClient* m_client; | 42 WebCredentialManagerClient* m_client; |
43 }; | 43 }; |
44 | 44 |
45 MODULES_EXPORT void provideCredentialManagerClientTo(Page&, CredentialManagerCli
ent*); | 45 MODULES_EXPORT void provideCredentialManagerClientTo(Page&, CredentialManagerCli
ent*); |
46 | 46 |
47 } // namespace blink | 47 } // namespace blink |
48 | 48 |
49 #endif // CredentialManagerClient_h | 49 #endif // CredentialManagerClient_h |
OLD | NEW |