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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1011953003: Refactor Permissions related method out of ContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission_type_enum_class
Patch Set: fix cros Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 0a6c18a637ebbdae5d2447a4b80b2c991ced0f64..80bb605d5ae6ba2c40f13c9a46020f95f856ed1b 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -53,6 +53,7 @@
#include "content/public/browser/browser_plugin_guest_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/permission_manager.h"
#include "content/public/browser/permission_type.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -1942,12 +1943,16 @@ void RenderFrameHostImpl::CancelSuspendedNavigations() {
}
void RenderFrameHostImpl::DidUseGeolocationPermission() {
- RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
- GetContentClient()->browser()->RegisterPermissionUsage(
+ PermissionManager* permission_manager =
+ GetSiteInstance()->GetBrowserContext()->GetPermissionManager();
+ if (!permission_manager)
+ return;
+
+ permission_manager->RegisterPermissionUsage(
PermissionType::GEOLOCATION,
- delegate_->GetAsWebContents(),
GetLastCommittedURL().GetOrigin(),
- top_frame->GetLastCommittedURL().GetOrigin());
+ frame_tree_node()->frame_tree()->GetMainFrame()
+ ->GetLastCommittedURL().GetOrigin());
}
} // namespace content
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/browser/media/cdm/browser_cdm_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698