OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/renderer/notification_provider.h" | 5 #include "chrome/renderer/notification_provider.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 IPC_MESSAGE_HANDLER(ViewMsg_PostErrorToNotificationObject, OnError); | 81 IPC_MESSAGE_HANDLER(ViewMsg_PostErrorToNotificationObject, OnError); |
82 IPC_MESSAGE_HANDLER(ViewMsg_PostCloseToNotificationObject, OnClose); | 82 IPC_MESSAGE_HANDLER(ViewMsg_PostCloseToNotificationObject, OnClose); |
83 IPC_MESSAGE_HANDLER(ViewMsg_PermissionRequestDone, | 83 IPC_MESSAGE_HANDLER(ViewMsg_PermissionRequestDone, |
84 OnPermissionRequestComplete); | 84 OnPermissionRequestComplete); |
85 IPC_MESSAGE_UNHANDLED(handled = false) | 85 IPC_MESSAGE_UNHANDLED(handled = false) |
86 IPC_END_MESSAGE_MAP() | 86 IPC_END_MESSAGE_MAP() |
87 return handled; | 87 return handled; |
88 } | 88 } |
89 | 89 |
90 void NotificationProvider::OnNavigate() { | 90 void NotificationProvider::OnNavigate() { |
91 // manager_.Clear(); | 91 manager_.Clear(); |
92 } | 92 } |
93 | 93 |
94 bool NotificationProvider::ShowHTML(const WebNotification& notification, | 94 bool NotificationProvider::ShowHTML(const WebNotification& notification, |
95 int id) { | 95 int id) { |
96 // Disallow HTML notifications from non-HTTP schemes. | 96 // Disallow HTML notifications from non-HTTP schemes. |
97 GURL url = notification.url(); | 97 GURL url = notification.url(); |
98 if (!url.SchemeIs(chrome::kHttpScheme) && | 98 if (!url.SchemeIs(chrome::kHttpScheme) && |
99 !url.SchemeIs(chrome::kHttpsScheme) && | 99 !url.SchemeIs(chrome::kHttpsScheme) && |
100 !url.SchemeIs(chrome::kExtensionScheme)) | 100 !url.SchemeIs(chrome::kExtensionScheme)) |
101 return false; | 101 return false; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void NotificationProvider::OnPermissionRequestComplete(int id) { | 147 void NotificationProvider::OnPermissionRequestComplete(int id) { |
148 WebNotificationPermissionCallback* callback = manager_.GetCallback(id); | 148 WebNotificationPermissionCallback* callback = manager_.GetCallback(id); |
149 DCHECK(callback); | 149 DCHECK(callback); |
150 callback->permissionRequestComplete(); | 150 callback->permissionRequestComplete(); |
151 manager_.OnPermissionRequestComplete(id); | 151 manager_.OnPermissionRequestComplete(id); |
152 } | 152 } |
153 | 153 |
154 bool NotificationProvider::Send(IPC::Message* message) { | 154 bool NotificationProvider::Send(IPC::Message* message) { |
155 return RenderThread::current()->Send(message); | 155 return RenderThread::current()->Send(message); |
156 } | 156 } |
OLD | NEW |