| 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..f85a1216760f67350039edb59328ef1e9603571f
|
| --- /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& title, const String& text);
|
| + static ScriptPromise share(ScriptState*, Navigator&, const String& title, const String& text);
|
| +
|
| + 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
|
|
|