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

Unified Diff: chrome/browser/desktop_notification_handler.cc

Issue 6874038: Remove the last Chrome dependencies from renderer, and enforce no more includes through DEPS. I ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/desktop_notification_handler.cc
===================================================================
--- chrome/browser/desktop_notification_handler.cc (revision 81920)
+++ chrome/browser/desktop_notification_handler.cc (working copy)
@@ -7,6 +7,7 @@
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
@@ -37,6 +38,16 @@
void DesktopNotificationHandler::OnShow(
const DesktopNotificationHostMsg_Show_Params& params) {
+ // Disallow HTML notifications from unwanted schemes. javascript:
+ // in particular allows unwanted cross-domain access.
+ GURL url = params.contents_url;
+ if (!url.SchemeIs(chrome::kHttpScheme) &&
+ !url.SchemeIs(chrome::kHttpsScheme) &&
+ !url.SchemeIs(chrome::kExtensionScheme) &&
+ !url.SchemeIs(chrome::kDataScheme)) {
+ return;
+ }
+
RenderProcessHost* process = render_view_host()->process();
DesktopNotificationService* service =
DesktopNotificationServiceFactory::GetForProfile(process->profile());

Powered by Google App Engine
This is Rietveld 408576698