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

Unified Diff: third_party/WebKit/Source/modules/webshare/NavigatorShare.h

Issue 1806253002: Added Web Share (navigator.share) experimental web API (stub). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 6 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/modules/webshare/NavigatorShare.h
diff --git a/third_party/WebKit/Source/modules/webshare/NavigatorShare.h b/third_party/WebKit/Source/modules/webshare/NavigatorShare.h
new file mode 100644
index 0000000000000000000000000000000000000000..2559f611f7e32a5938ce49765193d7101df2bdfb
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.h
@@ -0,0 +1,50 @@
+// Copyright 2016 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 NavigatorShare_h
+#define NavigatorShare_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+#include "public/platform/modules/webshare/webshare.mojom-blink.h"
+#include "wtf/HashSet.h"
+
+namespace blink {
+
+class Navigator;
+
+class NavigatorShare final : public GarbageCollectedFinalized<NavigatorShare>, public Supplement<Navigator> {
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorShare);
+public:
+ ~NavigatorShare();
+
+ // Gets, or creates, NavigatorShare supplement on Navigator.
+ // See platform/Supplementable.h
+ static NavigatorShare& from(Navigator&);
+
+ // Navigator partial interface
+ ScriptPromise share(ScriptState*, const String&, const String&);
+ static ScriptPromise share(ScriptState*, Navigator&, const String&, const String&);
Mike West 2016/07/08 07:17:49 Nit: Can you name the various `String` parameters
Matt Giuca 2016/07/11 07:40:38 Done.
+
+ DECLARE_TRACE();
+
+private:
+ class ShareClientImpl;
+
+ NavigatorShare();
+ static const char* supplementName();
+
+ blink::mojom::blink::ShareServicePtr m_service;
+
+ HeapHashSet<Member<ShareClientImpl>> m_clients;
+};
+
+} // namespace blink
+
+#endif // NavigatorShare_h

Powered by Google App Engine
This is Rietveld 408576698