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

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: makeUnique 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(
haraken 2017/03/31 04:20:09 Would you help me understand why you adopted the b
wychen 2017/03/31 07:51:54 For all the visited pages, we want to collect some
haraken 2017/04/04 06:27:57 Makes sense.
16 LocalFrame* frame,
17 mojom::blink::CopylessPasteRequest request) {
18 DCHECK(frame);
19
20 mojo::MakeStrongBinding(WTF::makeUnique<CopylessPasteServer>(*frame),
21 std::move(request));
22 }
23
24 void CopylessPasteServer::GetEntities(const GetEntitiesCallback& callback) {
25 if (!m_frame || !m_frame->document()) {
haraken 2017/03/31 04:20:09 Instead of doing this, I'd prefer making CopylessP
wychen 2017/03/31 07:51:54 I'm still trying to figure out whether it makes mo
haraken 2017/04/04 06:27:57 I'd prefer this CL. Here I'm just asking making C
wychen 2017/04/05 19:25:50 I gave it a try using ContextClient, but it seems
26 callback.Run(mojom::blink::WebPage::New());
27 return;
28 }
29 mojom::blink::WebPagePtr webpage = mojom::blink::WebPage::New();
30 // TODO(wychen): connect with CopylessPasteExtractor::extract() like:
31 // CopylessPasteExtractor::extract(*m_frame->document(), webpage);
32 callback.Run(std::move(webpage));
33 }
34
35 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698