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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/NotificationManager.h

Issue 1995663003: Revert of Introduce the Blink NotificationService, move permission checks there (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 NotificationManager_h
6 #define NotificationManager_h
7
8 #include "core/dom/ContextLifecycleObserver.h"
9 #include "core/dom/ExecutionContext.h"
10 #include "public/platform/modules/notifications/notification_service.mojom-blink .h"
11 #include "wtf/Noncopyable.h"
12 #include "wtf/text/WTFString.h"
13
14 namespace blink {
15
16 namespace mojom {
17 namespace blink {
18 enum class PermissionStatus;
19 }
20 }
21
22 // The notification manager, unique to the execution context, is responsible for
23 // connecting and communicating with the Mojo notification service.
24 //
25 // TODO(peter): Make the NotificationManager responsible for resource loading.
26 class NotificationManager final
27 : public GarbageCollectedFinalized<NotificationManager>
28 , public ContextLifecycleObserver
29 , public Supplement<ExecutionContext> {
30 USING_GARBAGE_COLLECTED_MIXIN(NotificationManager);
31 WTF_MAKE_NONCOPYABLE(NotificationManager);
32 public:
33 static NotificationManager* from(ExecutionContext*);
34 static const char* supplementName();
35
36 ~NotificationManager();
37
38 // Returns the notification permission status of the current origin. This
39 // method is synchronous to support the Notification.permission getter.
40 mojom::blink::PermissionStatus permissionStatus() const;
41
42 // ContextLifecycleObserver implementation.
43 void contextDestroyed() override;
44
45 DECLARE_VIRTUAL_TRACE();
46
47 private:
48 explicit NotificationManager(ExecutionContext*);
49
50 mojom::blink::NotificationServicePtr m_service;
51 };
52
53 } // namespace blink
54
55 #endif // NotificationManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698