summaryrefslogtreecommitdiffstats
path: root/content/browser/notifications/notification_event_dispatcher_impl.h
blob: fc19dc9ed77ed7c2aa9780de611a6bd6ab6b0b97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2014 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 CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_
#define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_

#include <stdint.h>

#include "base/macros.h"
#include "base/memory/singleton.h"
#include "content/public/browser/notification_database_data.h"
#include "content/public/browser/notification_event_dispatcher.h"

namespace content {

class NotificationEventDispatcherImpl : public NotificationEventDispatcher {
 public:
  // Returns the instance of the NotificationEventDispatcherImpl. Must be called
  // on the UI thread.
  static NotificationEventDispatcherImpl* GetInstance();

  // NotificationEventDispatcher implementation.
  void DispatchNotificationClickEvent(
      BrowserContext* browser_context,
      int64_t persistent_notification_id,
      const GURL& origin,
      int action_index,
      const NotificationDispatchCompleteCallback& dispatch_complete_callback)
      override;
  void DispatchNotificationCloseEvent(
      BrowserContext* browser_context,
      int64_t persistent_notification_id,
      const GURL& origin,
      bool by_user,
      const NotificationDispatchCompleteCallback& dispatch_complete_callback)
      override;

 private:
  NotificationEventDispatcherImpl();
  ~NotificationEventDispatcherImpl() override;

  friend struct base::DefaultSingletonTraits<NotificationEventDispatcherImpl>;

  DISALLOW_COPY_AND_ASSIGN(NotificationEventDispatcherImpl);
};

}  // namespace content

#endif  // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_