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

Unified Diff: content/browser/renderer_host/render_view_host.cc

Issue 8135028: Move check whether desktop notifications can be shown to browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host.cc
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index 431d87bab21384535676052a5b8914de2f494868..c797151e5a0e2bfa2c4c4cc55849a80931708c1f 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -1371,14 +1371,12 @@ void RenderViewHost::OnRequestDesktopNotificationPermission(
void RenderViewHost::OnShowDesktopNotification(
const DesktopNotificationHostMsg_Show_Params& params) {
- // Disallow HTML notifications from unwanted schemes. javascript:
- // in particular allows unwanted cross-domain access.
+ // Disallow HTML notifications from javascript: and file: schemes as this
+ // allows unwanted cross-domain access.
GURL url = params.contents_url;
if (params.is_html &&
- !url.SchemeIs(chrome::kHttpScheme) &&
- !url.SchemeIs(chrome::kHttpsScheme) &&
- !url.SchemeIs(chrome::kExtensionScheme) &&
- !url.SchemeIs(chrome::kDataScheme)) {
+ (url.SchemeIs(chrome::kJavaScriptScheme) ||
+ url.SchemeIs(chrome::kFileScheme))) {
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698