| Index: third_party/WebKit/Source/modules/document_metadata/CopylessPasteServer.cpp
|
| diff --git a/third_party/WebKit/Source/modules/document_metadata/CopylessPasteServer.cpp b/third_party/WebKit/Source/modules/document_metadata/CopylessPasteServer.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..10f0fb323ad8693f06b8859b08bcc094bb8a2f98
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/document_metadata/CopylessPasteServer.cpp
|
| @@ -0,0 +1,36 @@
|
| +// 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.
|
| +
|
| +#include "modules/document_metadata/CopylessPasteServer.h"
|
| +
|
| +#include "core/frame/LocalFrame.h"
|
| +#include "modules/document_metadata/CopylessPasteExtractor.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
| +
|
| +namespace blink {
|
| +
|
| +CopylessPasteServer::CopylessPasteServer(LocalFrame& frame) : m_frame(frame) {}
|
| +
|
| +void CopylessPasteServer::bindMojoRequest(
|
| + LocalFrame* frame,
|
| + mojom::document_metadata::blink::CopylessPasteRequest request) {
|
| + DCHECK(frame);
|
| +
|
| + // TODO(wychen): remove bindMojoRequest pattern, and make this a service
|
| + // associated with frame lifetime.
|
| + mojo::MakeStrongBinding(WTF::makeUnique<CopylessPasteServer>(*frame),
|
| + std::move(request));
|
| +}
|
| +
|
| +void CopylessPasteServer::GetEntities(const GetEntitiesCallback& callback) {
|
| + if (!m_frame || !m_frame->document()) {
|
| + callback.Run(nullptr);
|
| + return;
|
| + }
|
| + // TODO(wychen): connect with CopylessPasteExtractor::extract() like:
|
| + // callback.Run(CopylessPasteExtractor::extract(*m_frame->document()));
|
| + callback.Run(nullptr);
|
| +}
|
| +
|
| +} // namespace blink
|
|
|