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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webauth/NavigatorAuth.cpp
diff --git a/third_party/WebKit/Source/modules/webauth/NavigatorAuth.cpp b/third_party/WebKit/Source/modules/webauth/NavigatorAuth.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e0146a32ea641365228ea0a06b4b54bccb3bbdcd
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webauth/NavigatorAuth.cpp
@@ -0,0 +1,44 @@
+// Copyright 2016 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.
+
+#include "modules/webauth/NavigatorAuth.h"
+
+#include "core/frame/Navigator.h"
+#include "modules/webauth/WebAuthentication.h"
+
+namespace blink {
+
+NavigatorAuth& NavigatorAuth::from(Navigator& navigator) {
+ NavigatorAuth* supplement = static_cast<NavigatorAuth*>(
+ Supplement<Navigator>::from(navigator, supplementName()));
+ if (!supplement) {
+ supplement = new NavigatorAuth(navigator);
+ provideTo(navigator, supplementName(), supplement);
+ }
+ return *supplement;
+}
+
+WebAuthentication* NavigatorAuth::authentication(Navigator& navigator) {
+ return NavigatorAuth::from(navigator).authentication();
+}
+
+WebAuthentication* NavigatorAuth::authentication() {
+ return m_webauthentication;
+}
+
+DEFINE_TRACE(NavigatorAuth) {
+ visitor->trace(m_webauthentication);
+ Supplement<Navigator>::trace(visitor);
+}
+
+NavigatorAuth::NavigatorAuth(Navigator& navigator) {
+ if (navigator.frame())
+ m_webauthentication = WebAuthentication::create(*navigator.frame());
+}
+
+const char* NavigatorAuth::supplementName() {
+ return "NavigatorAuth";
+}
+
+} // namespace blink
« 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