| Index: third_party/WebKit/Source/modules/webauthentication/NavigatorAuth.cpp
|
| diff --git a/third_party/WebKit/Source/modules/webauthentication/NavigatorAuth.cpp b/third_party/WebKit/Source/modules/webauthentication/NavigatorAuth.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b685be9cc58ef6cd3178ef2ac9812673409937ef
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/webauthentication/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/webauthentication/NavigatorAuth.h"
|
| +
|
| +#include "core/frame/Navigator.h"
|
| +#include "modules/webauthentication/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
|
|
|