OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_IMPL_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/cancelable_callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "content/common/content_export.h" |
| 13 #include "mojo/public/cpp/bindings/binding.h" |
| 14 #include "mojo/public/cpp/bindings/interface_request.h" |
| 15 #include "third_party/WebKit/public/platform/modules/webauth/authenticator.mojom
.h" |
| 16 #include "url/origin.h" |
| 17 |
| 18 namespace service_manager { |
| 19 struct BindSourceInfo; |
| 20 } |
| 21 |
| 22 namespace content { |
| 23 |
| 24 class RenderFrameHost; |
| 25 |
| 26 // Implementation of the public Authenticator interface. |
| 27 class CONTENT_EXPORT AuthenticatorImpl |
| 28 : public NON_EXPORTED_BASE(webauth::mojom::Authenticator) { |
| 29 public: |
| 30 static void Create(RenderFrameHost* render_frame_host, |
| 31 const service_manager::BindSourceInfo& source_info, |
| 32 webauth::mojom::AuthenticatorRequest request); |
| 33 ~AuthenticatorImpl() override; |
| 34 |
| 35 void set_connection_error_handler(const base::Closure& error_handler) { |
| 36 connection_error_handler_ = error_handler; |
| 37 } |
| 38 |
| 39 private: |
| 40 explicit AuthenticatorImpl(RenderFrameHost* render_frame_host); |
| 41 |
| 42 // mojom:Authenticator |
| 43 void MakeCredential( |
| 44 webauth::mojom::RelyingPartyAccountPtr account, |
| 45 std::vector<webauth::mojom::ScopedCredentialParametersPtr> parameters, |
| 46 const std::vector<uint8_t>& challenge, |
| 47 webauth::mojom::ScopedCredentialOptionsPtr options, |
| 48 MakeCredentialCallback callback) override; |
| 49 |
| 50 base::Closure connection_error_handler_; |
| 51 base::CancelableClosure timeout_callback_; |
| 52 url::Origin caller_origin_; |
| 53 DISALLOW_COPY_AND_ASSIGN(AuthenticatorImpl); |
| 54 }; |
| 55 |
| 56 } // namespace content |
| 57 |
| 58 #endif // CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_IMPL_H_ |
OLD | NEW |