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

Side by Side Diff: third_party/WebKit/Source/modules/document_metadata/CopylessPasteServer.cpp

Issue 2787703002: Add mojo service for CopylessPaste in Blink (Closed)
Patch Set: update to new mojo namespace Created 3 years, 8 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 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 #include "modules/document_metadata/CopylessPasteServer.h"
6
7 #include "core/frame/LocalFrame.h"
8 #include "modules/document_metadata/CopylessPasteExtractor.h"
9 #include "mojo/public/cpp/bindings/strong_binding.h"
10
11 namespace blink {
12
13 CopylessPasteServer::CopylessPasteServer(LocalFrame& frame) : m_frame(frame) {}
14
15 void CopylessPasteServer::bindMojoRequest(
16 LocalFrame* frame,
17 mojom::document_metadata::blink::CopylessPasteRequest request) {
18 DCHECK(frame);
19
20 // TODO(wychen): remove bindMojoRequest pattern, and make this a service
21 // associated with frame lifetime.
22 mojo::MakeStrongBinding(WTF::makeUnique<CopylessPasteServer>(*frame),
23 std::move(request));
24 }
25
26 void CopylessPasteServer::GetEntities(const GetEntitiesCallback& callback) {
27 if (!m_frame || !m_frame->document()) {
28 callback.Run(nullptr);
29 return;
30 }
31 // TODO(wychen): connect with CopylessPasteExtractor::extract() like:
32 // callback.Run(CopylessPasteExtractor::extract(*m_frame->document()));
33 callback.Run(nullptr);
34 }
35
36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698