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

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

Issue 1964273002: Add FrameHost mojo service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2bc3dff310431f23d5ff7a9ae3039420f3990e5d..1ede0de1aa818b3242d2f0e711990de4b278896a 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -37,6 +37,7 @@
#include "content/browser/frame_host/render_frame_proxy_host.h"
#include "content/browser/frame_host/render_widget_host_view_child_frame.h"
#include "content/browser/geolocation/geolocation_service_context.h"
+#include "content/browser/host_zoom_map_impl.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/permissions/permission_service_context.h"
#include "content/browser/permissions/permission_service_impl.h"
@@ -70,6 +71,7 @@
#include "content/public/browser/permission_type.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/stream_handle.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/browser_side_navigation_policy.h"
@@ -208,6 +210,7 @@ RenderFrameHostImpl::RenderFrameHostImpl(SiteInstance* site_instance,
bool hidden)
: render_view_host_(render_view_host),
delegate_(delegate),
+ frame_host_binding_(this),
site_instance_(static_cast<SiteInstanceImpl*>(site_instance)),
process_(site_instance->GetProcess()),
cross_process_frame_connector_(NULL),
@@ -1987,6 +1990,9 @@ void RenderFrameHostImpl::RegisterMojoServices() {
}
#endif
+ GetServiceRegistry()->AddService<mojom::FrameHost>(base::Bind(
+ &RenderFrameHostImpl::BindFrameHostService, base::Unretained(this)));
+
GetContentClient()->browser()->RegisterRenderFrameMojoServices(
GetServiceRegistry(), this);
}
@@ -2569,6 +2575,21 @@ int RenderFrameHostImpl::GetProxyCount() {
return frame_tree_node_->render_manager()->GetProxyCount();
}
+void RenderFrameHostImpl::GetHostZoomLevel(
+ const GURL& url,
+ const GetHostZoomLevelCallback& callback) {
+ RenderProcessHost* render_process_host =
+ RenderProcessHost::FromID(GetProcess()->GetID());
+ double zoom_level = 0.0;
+ if (render_process_host) {
+ const HostZoomMapImpl* host_zoom_map = static_cast<const HostZoomMapImpl*>(
+ render_process_host->GetStoragePartition()->GetHostZoomMap());
+ zoom_level = host_zoom_map->GetZoomLevelForView(url, GetProcess()->GetID(),
+ routing_id_);
+ }
+ callback.Run(zoom_level);
+}
+
#if defined(OS_MACOSX)
void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) {
@@ -2797,6 +2818,14 @@ void RenderFrameHostImpl::AXContentTreeDataToAXTreeData(
dst->focused_tree_id = focused_frame->GetAXTreeID();
}
+void RenderFrameHostImpl::BindFrameHostService(
+ mojom::FrameHostRequest request) {
+ frame_host_binding_.Bind(std::move(request));
+ frame_host_binding_.set_connection_error_handler(
+ base::Bind(&mojo::Binding<mojom::FrameHost>::Unbind,
+ base::Unretained(&frame_host_binding_)));
+}
+
void RenderFrameHostImpl::CreateWebBluetoothService(
blink::mojom::WebBluetoothServiceRequest request) {
DCHECK(!web_bluetooth_service_);
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698