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

Side by Side Diff: third_party/WebKit/Source/core/clipboard/ClipboardPromise.h

Issue 2695593006: Initial stub version of Async Clipboard API (Closed)
Patch Set: Expected layout tests results for mac Created 3 years, 5 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 #ifndef ClipboardPromise_h
6 #define ClipboardPromise_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "core/CoreExport.h"
10 #include "core/dom/ContextLifecycleObserver.h"
11 #include "public/platform/WebClipboard.h"
12
13 namespace blink {
14
15 class DataTransfer;
16 class ScriptPromiseResolver;
17
18 class ClipboardPromise final
19 : public GarbageCollectedFinalized<ClipboardPromise>,
20 public ContextLifecycleObserver {
21 USING_GARBAGE_COLLECTED_MIXIN(ClipboardPromise);
22 WTF_MAKE_NONCOPYABLE(ClipboardPromise);
23
24 public:
25 virtual ~ClipboardPromise(){};
26
27 static ScriptPromise CreateForRead(ScriptState*);
28 static ScriptPromise CreateForReadText(ScriptState*);
29 static ScriptPromise CreateForWrite(ScriptState*, DataTransfer*);
30 static ScriptPromise CreateForWriteText(ScriptState*, const String&);
31
32 DECLARE_VIRTUAL_TRACE();
33
34 private:
35 ClipboardPromise(ScriptState*);
36
37 WebTaskRunner* GetTaskRunner();
38
39 void HandleRead();
40 void HandleReadText();
41
42 void HandleWrite(DataTransfer*);
43 void HandleWriteText(const String&);
44
45 Member<ScriptPromiseResolver> script_promise_resolver_;
46
47 WebClipboard::Buffer buffer_;
48 };
49
50 } // namespace blink
51
52 #endif // ClipboardPromise_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/clipboard/Clipboard.idl ('k') | third_party/WebKit/Source/core/clipboard/ClipboardPromise.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698