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

Side by Side Diff: third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.h

Issue 2133673002: Push API: Implement and ship PushSubscription.options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add MODULES_EXPORT Created 4 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 2016 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 PushSubscriptionOptions_h
6 #define PushSubscriptionOptions_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "modules/ModulesExport.h"
10 #include "platform/heap/Handle.h"
11
12 namespace blink {
13
14 class DOMArrayBuffer;
15 class ExceptionState;
16 class PushSubscriptionOptionsInit;
17 struct WebPushSubscriptionOptions;
18
19 class PushSubscriptionOptions final : public GarbageCollected<PushSubscriptionOp tions>, public ScriptWrappable {
20 DEFINE_WRAPPERTYPEINFO();
21
22 public:
23 // Converts developer-provided dictionary to WebPushSubscriptionOptions.
24 // Throws if applicationServerKey is invalid.
25 MODULES_EXPORT static WebPushSubscriptionOptions toWeb(const PushSubscriptio nOptionsInit&, ExceptionState&);
26
27 static PushSubscriptionOptions* create(const WebPushSubscriptionOptions& opt ions)
28 {
29 return new PushSubscriptionOptions(options);
30 }
31
32 bool userVisibleOnly() const { return m_userVisibleOnly; }
33
34 // Mutable by web developer. See https://github.com/w3c/push-api/issues/198.
35 DOMArrayBuffer* applicationServerKey() const { return m_applicationServerKey ; }
36
37 DECLARE_TRACE();
38
39 private:
40 explicit PushSubscriptionOptions(const WebPushSubscriptionOptions&);
41
42 bool m_userVisibleOnly;
43 Member<DOMArrayBuffer> m_applicationServerKey;
44 };
45
46 } // namespace blink
47
48 #endif // PushSubscriptionOptions_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698