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

Side by Side Diff: content/browser/host_zoom_level_impl.cc

Issue 1964273002: Add FrameHost mojo service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android-2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/host_zoom_level_impl.h"
6
7 #include "content/browser/host_zoom_map_impl.h"
8 #include "content/public/browser/browser_context.h"
9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "mojo/public/cpp/bindings/interface_request.h"
11
12 namespace content {
13
14 HostZoomLevelImpl::HostZoomLevelImpl(BrowserContext* context,
15 int render_process_id,
16 mojom::HostZoomLevelRequest request)
17 : binding_(this, std::move(request)),
18 context_(context),
19 render_process_id_(render_process_id) {}
20
21 HostZoomLevelImpl::~HostZoomLevelImpl() {}
22
23 // static
24 void HostZoomLevelImpl::Create(content::BrowserContext* context,
25 int render_process_id,
26 mojom::HostZoomLevelRequest request) {
27 new HostZoomLevelImpl(context, render_process_id, std::move(request));
28 }
29
30 void HostZoomLevelImpl::GetZoomLevel(const GURL& url,
31 int32_t render_view_id,
32 const GetZoomLevelCallback& callback) {
33 const HostZoomMapImpl* host_zoom_map = static_cast<const HostZoomMapImpl*>(
34 HostZoomMap::GetDefaultForBrowserContext(context_));
35 double zoom_level = host_zoom_map->GetZoomLevelForView(
36 url, render_process_id_, render_view_id);
37 callback.Run(std::move(url), zoom_level);
38 }
39
40 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698