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_
10 #include "chrome/browser/notifications/notification_delegate.h"
12 // A NotificationObjectProxy stands in for the JavaScript Notification object
13 // which corresponds to a notification toast on the desktop. It can be signaled
14 // when various events occur regarding the desktop notification, and the
15 // attached JS listeners will be invoked in the renderer or worker process.
16 class NotificationObjectProxy
17 : public NotificationDelegate {
19 // Creates a Proxy object with the necessary callback information.
20 NotificationObjectProxy(int process_id, int route_id,
21 int notification_id, bool worker);
23 // NotificationDelegate implementation.
24 virtual void Display() OVERRIDE;
25 virtual void Error() OVERRIDE;
26 virtual void Close(bool by_user) OVERRIDE;
27 virtual void Click() OVERRIDE;
28 virtual std::string id() const OVERRIDE;
29 virtual int process_id() const OVERRIDE;
30 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE;
33 friend class base::RefCountedThreadSafe<NotificationObjectProxy>;
35 virtual ~NotificationObjectProxy() {}
38 // Callback information to find the JS Notification object where it lives.
46 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_