blob: 6373a1167a0d0de2d24bdbf76c9a7034e71e27a0 [file] [log] [blame]
[email protected]6ffdb9002011-11-15 00:09:241// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]4bb336302009-10-12 05:44:262// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
6#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
[email protected]4bb336302009-10-12 05:44:268
[email protected]3b845752010-03-17 01:19:069#include <string>
10
11#include "chrome/browser/notifications/notification_delegate.h"
[email protected]4bb336302009-10-12 05:44:2612
[email protected]4bb336302009-10-12 05:44:2613// A NotificationObjectProxy stands in for the JavaScript Notification object
14// which corresponds to a notification toast on the desktop. It can be signaled
15// when various events occur regarding the desktop notification, and the
16// attached JS listeners will be invoked in the renderer or worker process.
[email protected]11f4857282009-11-13 19:56:1717class NotificationObjectProxy
[email protected]3b845752010-03-17 01:19:0618 : public NotificationDelegate {
[email protected]4bb336302009-10-12 05:44:2619 public:
20 // Creates a Proxy object with the necessary callback information.
21 NotificationObjectProxy(int process_id, int route_id,
22 int notification_id, bool worker);
23
[email protected]3b845752010-03-17 01:19:0624 // NotificationDelegate implementation.
[email protected]0d5c08e2011-11-21 16:51:0625 virtual void Display() OVERRIDE;
26 virtual void Error() OVERRIDE;
27 virtual void Close(bool by_user) OVERRIDE;
28 virtual void Click() OVERRIDE;
29 virtual std::string id() const OVERRIDE;
[email protected]b52448bb2009-11-04 21:29:1130
[email protected]8b7135d6aa2009-11-11 17:40:3131 protected:
[email protected]7991a232009-11-06 01:55:4832 friend class base::RefCountedThreadSafe<NotificationObjectProxy>;
33
[email protected]8b7135d6aa2009-11-11 17:40:3134 virtual ~NotificationObjectProxy() {}
[email protected]7991a232009-11-06 01:55:4835
[email protected]8b7135d6aa2009-11-11 17:40:3136 private:
[email protected]4bb336302009-10-12 05:44:2637 // Callback information to find the JS Notification object where it lives.
38 int process_id_;
39 int route_id_;
40 int notification_id_;
41 bool worker_;
42};
43
44#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_