| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 } | 2196 } |
| 2197 | 2197 |
| 2198 void RenderViewHostImpl::OnRequestDesktopNotificationPermission( | 2198 void RenderViewHostImpl::OnRequestDesktopNotificationPermission( |
| 2199 const GURL& source_origin, int callback_context) { | 2199 const GURL& source_origin, int callback_context) { |
| 2200 GetContentClient()->browser()->RequestDesktopNotificationPermission( | 2200 GetContentClient()->browser()->RequestDesktopNotificationPermission( |
| 2201 source_origin, callback_context, GetProcess()->GetID(), GetRoutingID()); | 2201 source_origin, callback_context, GetProcess()->GetID(), GetRoutingID()); |
| 2202 } | 2202 } |
| 2203 | 2203 |
| 2204 void RenderViewHostImpl::OnShowDesktopNotification( | 2204 void RenderViewHostImpl::OnShowDesktopNotification( |
| 2205 const ShowDesktopNotificationHostMsgParams& params) { | 2205 const ShowDesktopNotificationHostMsgParams& params) { |
| 2206 // Disallow HTML notifications from javascript: and file: schemes as this | |
| 2207 // allows unwanted cross-domain access. | |
| 2208 GURL url = params.contents_url; | |
| 2209 if (params.is_html && | |
| 2210 (url.SchemeIs(kJavaScriptScheme) || | |
| 2211 url.SchemeIs(chrome::kFileScheme))) { | |
| 2212 return; | |
| 2213 } | |
| 2214 | |
| 2215 GetContentClient()->browser()->ShowDesktopNotification( | 2206 GetContentClient()->browser()->ShowDesktopNotification( |
| 2216 params, GetProcess()->GetID(), GetRoutingID(), false); | 2207 params, GetProcess()->GetID(), GetRoutingID(), false); |
| 2217 } | 2208 } |
| 2218 | 2209 |
| 2219 void RenderViewHostImpl::OnCancelDesktopNotification(int notification_id) { | 2210 void RenderViewHostImpl::OnCancelDesktopNotification(int notification_id) { |
| 2220 GetContentClient()->browser()->CancelDesktopNotification( | 2211 GetContentClient()->browser()->CancelDesktopNotification( |
| 2221 GetProcess()->GetID(), GetRoutingID(), notification_id); | 2212 GetProcess()->GetID(), GetRoutingID(), notification_id); |
| 2222 } | 2213 } |
| 2223 | 2214 |
| 2224 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { | 2215 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2300 void RenderViewHostImpl::AttachToFrameTree() { | 2291 void RenderViewHostImpl::AttachToFrameTree() { |
| 2301 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2292 FrameTree* frame_tree = delegate_->GetFrameTree(); |
| 2302 | 2293 |
| 2303 frame_tree->SwapMainFrame(main_render_frame_host_.get()); | 2294 frame_tree->SwapMainFrame(main_render_frame_host_.get()); |
| 2304 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2295 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
| 2305 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2296 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
| 2306 } | 2297 } |
| 2307 } | 2298 } |
| 2308 | 2299 |
| 2309 } // namespace content | 2300 } // namespace content |
| OLD | NEW |