-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chrome: Decide what to do with SetZoomLevel #3284
Comments
|
See issue #2969 for background on the Chrome runtime. |
This would be chome::Zoom (which uses constants for zoom in/out/reset instead of taking a double value). |
We can call the functions from browser_commands.h:
Unfortunately this doesn't align well with the existing SetZoomLevel/GetZoomLevel API. |
It looks like Chrome's ZoomController (used by the browser_commands functions) adds additional functionality on top of the content::HostZoomMap used by Alloy. ZoomController has SetZoomLevel/GetZoomLevel, so we could just call those methods directly. The implementation of PageZoom::Zoom can be a useful reference for how Chrome expects these methods to be used. The interesting detail here is the clamping to preset zoom levels. An API using constants (IDC_ZOOM_PLUS, IDC_ZOOM_NORMAL, IDC_ZOOM_MINUS) may also come with issue #3282. Given how error-prone the SetZoomLevel/GetZoomLevel usage is currently (example), I would be in favor of deprecating/removing these methods in favor of the more explicit API used by browser_comments. To implement the same API for Alloy we would either borrow some of the Chrome implementation or potentially switch from HostZoomMap to ZoomController usage. |
Alloy already creates a ZoomController for extensions, so that should be fine to use here as well. |
For Chrome, it might also be good to expose configuration of ZoomController::SetShowsNotificationBubble (whether the zoom notification bubble can be shown when the zoom level is changed). |
Add a simpler CanZoom/Zoom API as an alternative to the more error-prone SetZoomLevel/GetZoomLevel API. Both APIs are now implemented for both runtimes. With the Chrome runtime a zoom notification bubble will be displayed unless CefBrowserSettings.chrome_zoom_bubble is set to STATE_DISABLED. To test: - Run cefclient and select zoom entries from the Tests menu. - chrome: Run cefclient with `--hide-chrome-bubbles` command-line flag to hide the zoom notification bubble.
Original report by me.
This issue involves the following functionality currently supported by the Alloy runtime:
The text was updated successfully, but these errors were encountered: