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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/renderer_host/render_view_host.h" 5 #include "content/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1364 }
1365 1365
1366 void RenderViewHost::OnRequestDesktopNotificationPermission( 1366 void RenderViewHost::OnRequestDesktopNotificationPermission(
1367 const GURL& source_origin, int callback_context) { 1367 const GURL& source_origin, int callback_context) {
1368 content::GetContentClient()->browser()->RequestDesktopNotificationPermission( 1368 content::GetContentClient()->browser()->RequestDesktopNotificationPermission(
1369 source_origin, callback_context, process()->id(), routing_id()); 1369 source_origin, callback_context, process()->id(), routing_id());
1370 } 1370 }
1371 1371
1372 void RenderViewHost::OnShowDesktopNotification( 1372 void RenderViewHost::OnShowDesktopNotification(
1373 const DesktopNotificationHostMsg_Show_Params& params) { 1373 const DesktopNotificationHostMsg_Show_Params& params) {
1374 // Disallow HTML notifications from unwanted schemes. javascript: 1374 // Disallow HTML notifications from javascript: and file: schemes as this
1375 // in particular allows unwanted cross-domain access. 1375 // allows unwanted cross-domain access.
1376 GURL url = params.contents_url; 1376 GURL url = params.contents_url;
1377 if (params.is_html && 1377 if (params.is_html &&
1378 !url.SchemeIs(chrome::kHttpScheme) && 1378 (url.SchemeIs(chrome::kJavaScriptScheme) ||
1379 !url.SchemeIs(chrome::kHttpsScheme) && 1379 url.SchemeIs(chrome::kFileScheme))) {
1380 !url.SchemeIs(chrome::kExtensionScheme) &&
1381 !url.SchemeIs(chrome::kDataScheme)) {
1382 return; 1380 return;
1383 } 1381 }
1384 1382
1385 content::GetContentClient()->browser()->ShowDesktopNotification( 1383 content::GetContentClient()->browser()->ShowDesktopNotification(
1386 params, process()->id(), routing_id(), false); 1384 params, process()->id(), routing_id(), false);
1387 } 1385 }
1388 1386
1389 void RenderViewHost::OnCancelDesktopNotification(int notification_id) { 1387 void RenderViewHost::OnCancelDesktopNotification(int notification_id) {
1390 content::GetContentClient()->browser()->CancelDesktopNotification( 1388 content::GetContentClient()->browser()->CancelDesktopNotification(
1391 process()->id(), routing_id(), notification_id); 1389 process()->id(), routing_id(), notification_id);
(...skipping 17 matching lines...) Expand all
1409 void RenderViewHost::OnRunFileChooser( 1407 void RenderViewHost::OnRunFileChooser(
1410 const ViewHostMsg_RunFileChooser_Params& params) { 1408 const ViewHostMsg_RunFileChooser_Params& params) {
1411 delegate_->RunFileChooser(this, params); 1409 delegate_->RunFileChooser(this, params);
1412 } 1410 }
1413 1411
1414 void RenderViewHost::OnWebUISend(const GURL& source_url, 1412 void RenderViewHost::OnWebUISend(const GURL& source_url,
1415 const std::string& name, 1413 const std::string& name,
1416 const base::ListValue& args) { 1414 const base::ListValue& args) {
1417 delegate_->WebUISend(this, source_url, name, args); 1415 delegate_->WebUISend(this, source_url, name, args);
1418 } 1416 }
OLDNEW
« 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