janke99 / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 0 forks source link

Port Custom Zoom Handling to CEF3 #1314

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I would like the functionality introduced by Issue 733 
(https://code.google.com/p/chromiumembedded/issues/detail?id=733) to be ported 
to CEF3. I have attached the patch files that make changes to provide this 
functionality.

Original issue reported on code.google.com by Hylinn.T...@gmail.com on 13 Jun 2014 at 5:08

Attachments:

GoogleCodeExporter commented 9 years ago
I don't think your patches are correct. The intended use case is to call 
CefZoomHandler instead of using the default HostZoomMap implementation when a 
new URL is loaded in the top-level frame. It looks like your patches do two 
things:

1. Modify CefBrowserHostImpl::SetZoomLevel so that it uses a new 
ViewMsg_SetUnhandledZoomLevel message that does not result in a call to 
RenderViewImpl::zoomLevelChanged. Why is this necessary?

2. Call CefZoomHandler::GetZoomSetting from CefBrowserHostImpl::GetZoomLevel. 
What is the purpose of this when CefBrowserHostImpl::GetZoomLevel is not called 
from the Content API?

Original comment by magreenb...@gmail.com on 13 Jun 2014 at 5:44

GoogleCodeExporter commented 9 years ago
1. The ViewMsg_SetUnhandledZoomLevel is only used if the client provides a zoom 
handler and the handler's OnZoomSet returns true. This is meant to be a way to 
avoid zoomLevelChanged being called and updating the HostZoomMap. The intended 
use case for a custom zoom handler is to provide a way to handle zooming in a 
manner not tied to the host URL while leaving the current non-custom behavior 
and interface intact.

2. It felt necessary to implement custom handling in both setting and getting 
of the zoom level. At least in cefclient, zooming is done be calling ModifyZoom 
in cefclient_win.cpp which makes calls to both CefBrowserHostImpl::GetZoomLevel 
and CefBrowserHostImpl::SetZoomLevel.

Original comment by Hylinn.T...@gmail.com on 13 Jun 2014 at 9:20

GoogleCodeExporter commented 9 years ago
In the CEF1 implementation CefZoomHandler::OnGetZoomLevel is called whenever 
the browser needs to determine the zoom factor for a newly loaded URL (before 
the URL is actually rendered). In CEF1 this is independent of the client 
application calling SetZoomLevel/GetZoomLevel. Your patches as currently 
written don't provide this functionality.

Original comment by magreenb...@gmail.com on 13 Jun 2014 at 9:30

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/1314

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:32