Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / notifications / notification_object_proxy.h
blobeb25729e4e59f987c3a34abf4655f438a38ce021
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/notifications/notification_delegate.h"
13 namespace content {
14 class DesktopNotificationDelegate;
17 // A NotificationObjectProxy stands in for the JavaScript Notification object
18 // which corresponds to a notification toast on the desktop. It can be signaled
19 // when various events occur regarding the desktop notification, and the
20 // attached JS listeners will be invoked in the renderer or worker process.
21 class NotificationObjectProxy : public NotificationDelegate {
22 public:
23 // Creates a Proxy object with the necessary callback information. The Proxy
24 // will take ownership of |delegate|.
25 NotificationObjectProxy(
26 scoped_ptr<content::DesktopNotificationDelegate> delegate);
28 // NotificationDelegate implementation.
29 void Display() override;
30 void Close(bool by_user) override;
31 void Click() override;
32 std::string id() const override;
34 protected:
35 ~NotificationObjectProxy() override;
37 private:
38 scoped_ptr<content::DesktopNotificationDelegate> delegate_;
39 bool displayed_;
40 std::string id_;
43 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_