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

Side by Side Diff: chrome/renderer/notification_provider.h

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/mock_render_thread.cc ('k') | chrome/renderer/plugin_channel_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_NOTIFICATION_PROVIDER_H_ 5 #ifndef CHROME_RENDERER_NOTIFICATION_PROVIDER_H_
6 #define CHROME_RENDERER_NOTIFICATION_PROVIDER_H_ 6 #define CHROME_RENDERER_NOTIFICATION_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/common/desktop_notifications/active_notification_tracker.h" 9 #include "chrome/common/desktop_notifications/active_notification_tracker.h"
10 #include "ipc/ipc_channel.h" 10 #include "ipc/ipc_channel.h"
11 #include "third_party/WebKit/WebKit/chromium/public/WebNotification.h" 11 #include "third_party/WebKit/WebKit/chromium/public/WebNotification.h"
12 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" 12 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h"
13 13
14 class RenderView; 14 class RenderView;
15 namespace WebKit { 15 namespace WebKit {
16 class WebNotificationPermissionCallback; 16 class WebNotificationPermissionCallback;
17 } 17 }
18 18
19 // NotificationProvider class is owned by the RenderView. Only 19 // NotificationProvider class is owned by the RenderView. Only
20 // to be used on the UI thread. 20 // to be used on the UI thread.
21 class NotificationProvider : public WebKit::WebNotificationPresenter { 21 class NotificationProvider : public WebKit::WebNotificationPresenter,
22 public IPC::Channel::Listener {
22 public: 23 public:
23 explicit NotificationProvider(RenderView* view); 24 explicit NotificationProvider(RenderView* view);
24 virtual ~NotificationProvider(); 25 virtual ~NotificationProvider();
25 26
26 // WebKit::WebNotificationPresenter interface. 27 // WebKit::WebNotificationPresenter interface.
27 virtual bool show(const WebKit::WebNotification& proxy); 28 virtual bool show(const WebKit::WebNotification& proxy);
28 virtual void cancel(const WebKit::WebNotification& proxy); 29 virtual void cancel(const WebKit::WebNotification& proxy);
29 virtual void objectDestroyed(const WebKit::WebNotification& proxy); 30 virtual void objectDestroyed(const WebKit::WebNotification& proxy);
30 virtual WebKit::WebNotificationPresenter::Permission checkPermission( 31 virtual WebKit::WebNotificationPresenter::Permission checkPermission(
31 const WebKit::WebURL& url); 32 const WebKit::WebURL& url);
32 virtual void requestPermission(const WebKit::WebSecurityOrigin& origin, 33 virtual void requestPermission(const WebKit::WebSecurityOrigin& origin,
33 WebKit::WebNotificationPermissionCallback* callback); 34 WebKit::WebNotificationPermissionCallback* callback);
34 35
35 // IPC message handler called from RenderView. 36 // IPC::Channel::Listener implementation.
36 bool OnMessageReceived(const IPC::Message& message); 37 bool OnMessageReceived(const IPC::Message& message);
37 38
38 // Called when the RenderView navigates. 39 // Called when the RenderView navigates.
39 void OnNavigate(); 40 void OnNavigate();
40 41
41 private: 42 private:
42 // Internal methods used to show notifications. 43 // Internal methods used to show notifications.
43 bool ShowHTML(const WebKit::WebNotification& notification, int id); 44 bool ShowHTML(const WebKit::WebNotification& notification, int id);
44 bool ShowText(const WebKit::WebNotification& notification, int id); 45 bool ShowText(const WebKit::WebNotification& notification, int id);
45 46
(...skipping 11 matching lines...) Expand all
57 RenderView* view_; 58 RenderView* view_;
58 59
59 // A tracker object which manages the active notifications and the IDs 60 // A tracker object which manages the active notifications and the IDs
60 // that are used to refer to them over IPC. 61 // that are used to refer to them over IPC.
61 ActiveNotificationTracker manager_; 62 ActiveNotificationTracker manager_;
62 63
63 DISALLOW_COPY_AND_ASSIGN(NotificationProvider); 64 DISALLOW_COPY_AND_ASSIGN(NotificationProvider);
64 }; 65 };
65 66
66 #endif // CHROME_RENDERER_NOTIFICATION_PROVIDER_H_ 67 #endif // CHROME_RENDERER_NOTIFICATION_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/mock_render_thread.cc ('k') | chrome/renderer/plugin_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698