Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: third_party/WebKit/Source/modules/webauth/NavigatorAuth.cpp

Issue 2533863002: Add WebAuthn bindings and client interface. (Closed)
Patch Set: Layout test expected file tweaks Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 #include "modules/webauth/NavigatorAuth.h"
6
7 #include "core/frame/Navigator.h"
8 #include "modules/webauth/WebAuthentication.h"
9
10 namespace blink {
11
12 NavigatorAuth& NavigatorAuth::from(Navigator& navigator) {
13 NavigatorAuth* supplement = static_cast<NavigatorAuth*>(
14 Supplement<Navigator>::from(navigator, supplementName()));
15 if (!supplement) {
16 supplement = new NavigatorAuth(navigator);
17 provideTo(navigator, supplementName(), supplement);
18 }
19 return *supplement;
20 }
21
22 WebAuthentication* NavigatorAuth::authentication(Navigator& navigator) {
23 return NavigatorAuth::from(navigator).authentication();
24 }
25
26 WebAuthentication* NavigatorAuth::authentication() {
27 return m_webauthentication;
28 }
29
30 DEFINE_TRACE(NavigatorAuth) {
31 visitor->trace(m_webauthentication);
32 Supplement<Navigator>::trace(visitor);
33 }
34
35 NavigatorAuth::NavigatorAuth(Navigator& navigator) {
36 if (navigator.frame())
37 m_webauthentication = WebAuthentication::create(*navigator.frame());
38 }
39
40 const char* NavigatorAuth::supplementName() {
41 return "NavigatorAuth";
42 }
43
44 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webauth/NavigatorAuth.h ('k') | third_party/WebKit/Source/modules/webauth/NavigatorAuth.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698