Chromium Code Reviews| 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 COMPONENTS_WEBAUTH_AUTHENTICATOR_WEB_CONTENTS_MANAGER_H_ | |
| 6 #define COMPONENTS_WEBAUTH_AUTHENTICATOR_WEB_CONTENTS_MANAGER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "content/public/browser/web_contents_user_data.h" | |
| 12 #include "mojo/public/cpp/bindings/interface_request.h" | |
| 13 #include "public/platform/modules/webauth/authenticator.mojom.h" | |
|
jam
2017/06/27 13:52:17
nit: preface include with third_party/WebKit
| |
| 14 | |
| 15 // This class owns the Authenticator associated with a given WebContents. | |
| 16 // The Authenticator is destroyed when the WebContents goes away. | |
| 17 class AuthenticatorWebContentsManager | |
| 18 : public content::WebContentsUserData<AuthenticatorWebContentsManager> { | |
| 19 public: | |
| 20 ~AuthenticatorWebContentsManager() override; | |
| 21 | |
| 22 // Retrieves the instance of AuthenticatorWebContentsManager that was | |
| 23 // attached to the specified WebContents. If no instance was attached, | |
| 24 // creates one, and attaches it to the specified WebContents. | |
| 25 static AuthenticatorWebContentsManager* GetOrCreateForWebContents( | |
| 26 content::WebContents* web_contents); | |
| 27 | |
| 28 // Creates the Authenticator that will interact with this |web_contents|. | |
| 29 void CreateAuthenticator( | |
| 30 content::RenderFrameHost* render_frame_host, | |
| 31 mojo::InterfaceRequest<webauth::mojom::Authenticator> authenticator); | |
| 32 | |
| 33 private: | |
| 34 explicit AuthenticatorWebContentsManager(content::WebContents* web_contents); | |
| 35 friend class content::WebContentsUserData<AuthenticatorWebContentsManager>; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(AuthenticatorWebContentsManager); | |
| 38 }; | |
| 39 | |
| 40 #endif // COMPONENTS_WEBAUTH_AUTHENTICATOR_WEB_CONTENTS_MANAGER_H_ | |
| OLD | NEW |