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

Unified Diff: third_party/WebKit/Source/core/clipboard/Clipboard.h

Issue 2695593006: Initial stub version of Async Clipboard API (Closed)
Patch Set: Add WPTs; Update naming conventions; Review comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/clipboard/Clipboard.h
diff --git a/third_party/WebKit/Source/core/clipboard/Clipboard.h b/third_party/WebKit/Source/core/clipboard/Clipboard.h
new file mode 100644
index 0000000000000000000000000000000000000000..b1b439f9f4df786de3b7d9922c7c6cfc6cd6655d
--- /dev/null
+++ b/third_party/WebKit/Source/core/clipboard/Clipboard.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef Clipboard_h
+#define Clipboard_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
+#include "platform/wtf/Noncopyable.h"
+
+namespace blink {
+
+class DataTransfer;
+class ScriptState;
+
+class Clipboard : public EventTargetWithInlineData,
+ public ContextLifecycleObserver {
+ USING_GARBAGE_COLLECTED_MIXIN(Clipboard);
+ DEFINE_WRAPPERTYPEINFO();
+ WTF_MAKE_NONCOPYABLE(Clipboard);
+
+ public:
+ explicit Clipboard(ExecutionContext*);
+
+ ScriptPromise read(ScriptState*);
+ ScriptPromise readText(ScriptState*);
+
+ ScriptPromise write(ScriptState*, DataTransfer*);
+ ScriptPromise writeText(ScriptState*, const String&);
+
+ // EventTarget
+ const AtomicString& InterfaceName() const override;
+ // ContextLifecycleObserver
+ ExecutionContext* GetExecutionContext() const override;
+
+ DECLARE_VIRTUAL_TRACE();
+};
+
+} // namespace blink
+
+#endif // Clipboard_h

Powered by Google App Engine
This is Rietveld 408576698