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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1726323002: Have Permission{Manager,Service} use Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify and test Origin.empty_. Created 4 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "content/public/browser/stream_handle.h" 70 #include "content/public/browser/stream_handle.h"
71 #include "content/public/browser/user_metrics.h" 71 #include "content/public/browser/user_metrics.h"
72 #include "content/public/common/browser_side_navigation_policy.h" 72 #include "content/public/common/browser_side_navigation_policy.h"
73 #include "content/public/common/content_constants.h" 73 #include "content/public/common/content_constants.h"
74 #include "content/public/common/isolated_world_ids.h" 74 #include "content/public/common/isolated_world_ids.h"
75 #include "content/public/common/url_constants.h" 75 #include "content/public/common/url_constants.h"
76 #include "content/public/common/url_utils.h" 76 #include "content/public/common/url_utils.h"
77 #include "ui/accessibility/ax_tree.h" 77 #include "ui/accessibility/ax_tree.h"
78 #include "ui/accessibility/ax_tree_update.h" 78 #include "ui/accessibility/ax_tree_update.h"
79 #include "url/gurl.h" 79 #include "url/gurl.h"
80 #include "url/origin.h"
80 81
81 #if defined(OS_ANDROID) 82 #if defined(OS_ANDROID)
82 #include "content/browser/mojo/service_registrar_android.h" 83 #include "content/browser/mojo/service_registrar_android.h"
83 #endif 84 #endif
84 85
85 #if defined(OS_MACOSX) 86 #if defined(OS_MACOSX)
86 #include "content/browser/frame_host/popup_menu_helper_mac.h" 87 #include "content/browser/frame_host/popup_menu_helper_mac.h"
87 #endif 88 #endif
88 89
89 #if defined(ENABLE_WEBVR) 90 #if defined(ENABLE_WEBVR)
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 routing_id_, common_params, start_params, request_params)); 2507 routing_id_, common_params, start_params, request_params));
2507 } 2508 }
2508 2509
2509 void RenderFrameHostImpl::DidUseGeolocationPermission() { 2510 void RenderFrameHostImpl::DidUseGeolocationPermission() {
2510 PermissionManager* permission_manager = 2511 PermissionManager* permission_manager =
2511 GetSiteInstance()->GetBrowserContext()->GetPermissionManager(); 2512 GetSiteInstance()->GetBrowserContext()->GetPermissionManager();
2512 if (!permission_manager) 2513 if (!permission_manager)
2513 return; 2514 return;
2514 2515
2515 permission_manager->RegisterPermissionUsage( 2516 permission_manager->RegisterPermissionUsage(
2516 PermissionType::GEOLOCATION, 2517 PermissionType::GEOLOCATION, url::Origin(last_committed_url()),
2517 last_committed_url().GetOrigin(), 2518 url::Origin(frame_tree_node()
2518 frame_tree_node()->frame_tree()->GetMainFrame() 2519 ->frame_tree()
2519 ->last_committed_url().GetOrigin()); 2520 ->GetMainFrame()
2521 ->last_committed_url()));
2520 } 2522 }
2521 2523
2522 void RenderFrameHostImpl::UpdatePermissionsForNavigation( 2524 void RenderFrameHostImpl::UpdatePermissionsForNavigation(
2523 const CommonNavigationParams& common_params, 2525 const CommonNavigationParams& common_params,
2524 const RequestNavigationParams& request_params) { 2526 const RequestNavigationParams& request_params) {
2525 // Browser plugin guests are not allowed to navigate outside web-safe schemes, 2527 // Browser plugin guests are not allowed to navigate outside web-safe schemes,
2526 // so do not grant them the ability to request additional URLs. 2528 // so do not grant them the ability to request additional URLs.
2527 if (!GetProcess()->IsForGuestsOnly()) { 2529 if (!GetProcess()->IsForGuestsOnly()) {
2528 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL( 2530 ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL(
2529 GetProcess()->GetID(), common_params.url); 2531 GetProcess()->GetID(), common_params.url);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 *dst = src; 2633 *dst = src;
2632 2634
2633 if (src.routing_id != -1) 2635 if (src.routing_id != -1)
2634 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2636 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2635 2637
2636 if (src.parent_routing_id != -1) 2638 if (src.parent_routing_id != -1)
2637 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2639 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2638 } 2640 }
2639 2641
2640 } // namespace content 2642 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698