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

Side by Side Diff: chrome/browser/notifications/notification_object_proxy.h

Issue 208068: Desktop Notifications UI (for windows) (Closed)
Patch Set: Created 11 years, 3 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 (c) 2009 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 CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
7
8 #include "base/ref_counted.h"
9
10 class MessageLoop;
11 namespace IPC {
12 class Message;
13 }
14
15 // A NotificationObjectProxy stands in for the JavaScript Notification object
16 // which corresponds to an actual desktop notification. It can be signaled
17 // when various events occur regarding the desktop notification, and the
18 // attached JS listeners will be invoked in the renderer or worker process.
19 //
20 // This class should be accessed only on the UI thread.
21 class NotificationObjectProxy :
22 public base::RefCounted<NotificationObjectProxy> {
23 public:
24 // Creates a Proxy object with the necessary callback information.
25 NotificationObjectProxy(int process_id, int route_id,
26 int notification_id_, bool worker);
27
28 // To be called when the desktop notification is actually shown.
29 void display();
30
31 // To be called when the desktop notification cannot be shown due to an
32 // error.
33 void error();
34
35 // To be called when the desktop notification is closed. If closed by a
36 // user explicitly (as opposed to timeout), |by_user| should be true.
37 void close(bool by_user);
38
39 private:
40 // Called on UI thread to schedule a message for sending.
41 void DeliverMessage(IPC::Message* message);
42
43 // Called via Task on IO thread to actually send a message to a notification.
44 void Send(IPC::Message* message);
45
46 // Callback information to find the JS Notification object where it lives.
47 int process_id_;
48 int route_id_;
49 int notification_id_;
50 bool worker_;
51 };
52
53 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification.h ('k') | chrome/browser/notifications/notification_object_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698