| Index: components/webauth/authenticator_impl.h | 
| diff --git a/components/webauth/authenticator_impl.h b/components/webauth/authenticator_impl.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..5a8ee9a23a304a942cd01ec840b9b36e4f6fef7e | 
| --- /dev/null | 
| +++ b/components/webauth/authenticator_impl.h | 
| @@ -0,0 +1,65 @@ | 
| +// Copyright 2017 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef COMPONENTS_WEBAUTH_AUTHENTICATOR_IMPL_H_ | 
| +#define COMPONENTS_WEBAUTH_AUTHENTICATOR_IMPL_H_ | 
| + | 
| +#include <vector> | 
| + | 
| +#include "base/macros.h" | 
| +#include "components/webauth/authenticator.mojom.h" | 
| +#include "content/public/browser/web_contents.h" | 
| +#include "mojo/public/cpp/bindings/binding.h" | 
| +#include "mojo/public/cpp/bindings/interface_request.h" | 
| + | 
| +namespace content { | 
| +class RenderFrameHost; | 
| +} | 
| + | 
| +namespace webauth { | 
| + | 
| +// Implementation of the public Authenticator interface. | 
| +class AuthenticatorImpl : public mojom::Authenticator { | 
| + public: | 
| +  static void Create(content::RenderFrameHost* render_frame_host, | 
| +                     mojo::InterfaceRequest<mojom::Authenticator> request); | 
| +  ~AuthenticatorImpl() override; | 
| + | 
| +  void set_connection_error_handler(const base::Closure& error_handler) { | 
| +    connection_error_handler_ = error_handler; | 
| +  } | 
| + | 
| + private: | 
| +  AuthenticatorImpl(content::RenderFrameHost* render_frame_host); | 
| + | 
| +  // mojom:Authenticator | 
| +  void MakeCredential( | 
| +      mojom::RelyingPartyAccountPtr account, | 
| +      std::vector<mojom::ScopedCredentialParametersPtr> parameters, | 
| +      const std::vector<uint8_t>& challenge, | 
| +      mojom::ScopedCredentialOptionsPtr options, | 
| +      MakeCredentialCallback callback) override; | 
| + | 
| +  // Callback to handle the async response from a U2fDevice. | 
| +  void OnRegister(MakeCredentialCallback callback, | 
| +                  std::string& client_data_json, | 
| +                  uint8_t status_code, | 
| +                  std::vector<uint8_t> data); | 
| + | 
| +  void OnTimeout(MakeCredentialCallback callback); | 
| + | 
| +  // As a result of a browser-side error or renderer-initiated mojo channel | 
| +  // closure (e.g. there was an error on the renderer side, or payment was | 
| +  // successful), this method is called. It is responsible for cleaning up. | 
| +  void OnConnectionTerminated(); | 
| + | 
| +  base::Closure connection_error_handler_; | 
| +  base::CancelableClosure timeout_callback_; | 
| +  url::Origin caller_origin_; | 
| +  DISALLOW_COPY_AND_ASSIGN(AuthenticatorImpl); | 
| +}; | 
| + | 
| +}  // namespace webauth | 
| + | 
| +#endif  // COMPONENTS_WEBAUTH_AUTHENTICATOR_IMPL_H_ | 
|  |