| 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 NoBaseWillBeGarbageC
ollectedFinalized<CredentialManagerClient>, public WillBeHeapSupplement<Page> { | 23 class MODULES_EXPORT CredentialManagerClient final : public GarbageCollectedFina
lized<CredentialManagerClient>, public HeapSupplement<Page> { |
| 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CredentialManagerClient); | 24 USING_GARBAGE_COLLECTED_MIXIN(CredentialManagerClient); |
| 25 USING_FAST_MALLOC_WILL_BE_REMOVED(CredentialManagerClient); | |
| 26 public: | 25 public: |
| 27 explicit CredentialManagerClient(WebCredentialManagerClient*); | 26 explicit CredentialManagerClient(WebCredentialManagerClient*); |
| 28 virtual ~CredentialManagerClient(); | 27 virtual ~CredentialManagerClient(); |
| 29 DECLARE_VIRTUAL_TRACE(); | 28 DECLARE_VIRTUAL_TRACE(); |
| 30 | 29 |
| 31 static const char* supplementName(); | 30 static const char* supplementName(); |
| 32 static CredentialManagerClient* from(Page*); | 31 static CredentialManagerClient* from(Page*); |
| 33 static CredentialManagerClient* from(ExecutionContext*); | 32 static CredentialManagerClient* from(ExecutionContext*); |
| 34 | 33 |
| 35 // 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 |
| 36 // the following methods. | 35 // the following methods. |
| 37 virtual void dispatchFailedSignIn(const WebCredential&, WebCredentialManager
Client::NotificationCallbacks*); | 36 virtual void dispatchFailedSignIn(const WebCredential&, WebCredentialManager
Client::NotificationCallbacks*); |
| 38 virtual void dispatchStore(const WebCredential&, WebCredentialManagerClient:
:NotificationCallbacks*); | 37 virtual void dispatchStore(const WebCredential&, WebCredentialManagerClient:
:NotificationCallbacks*); |
| 39 virtual void dispatchRequireUserMediation(WebCredentialManagerClient::Notifi
cationCallbacks*); | 38 virtual void dispatchRequireUserMediation(WebCredentialManagerClient::Notifi
cationCallbacks*); |
| 40 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*); |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 WebCredentialManagerClient* m_client; | 42 WebCredentialManagerClient* m_client; |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 MODULES_EXPORT void provideCredentialManagerClientTo(Page&, CredentialManagerCli
ent*); | 45 MODULES_EXPORT void provideCredentialManagerClientTo(Page&, CredentialManagerCli
ent*); |
| 47 | 46 |
| 48 } // namespace blink | 47 } // namespace blink |
| 49 | 48 |
| 50 #endif // CredentialManagerClient_h | 49 #endif // CredentialManagerClient_h |
| OLD | NEW |