mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add new CanZoom/Zoom API (fixes #3284)
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.
This commit is contained in:
@@ -396,17 +396,40 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
virtual CefRefPtr<CefRequestContext> GetRequestContext() = 0;
|
||||
|
||||
///
|
||||
/// Get the current zoom level. The default zoom level is 0.0. This method can
|
||||
/// only be called on the UI thread.
|
||||
/// Returns true if this browser can execute the specified zoom command. This
|
||||
/// method can only be called on the UI thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool CanZoom(cef_zoom_command_t command) = 0;
|
||||
|
||||
///
|
||||
/// Execute a zoom command in this browser. If called on the UI thread the
|
||||
/// change will be applied immediately. Otherwise, the change will be applied
|
||||
/// asynchronously on the UI thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Zoom(cef_zoom_command_t command) = 0;
|
||||
|
||||
///
|
||||
/// Get the default zoom level. This value will be 0.0 by default but can be
|
||||
/// configured with the Chrome runtime. This method can only be called on the
|
||||
/// UI thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual double GetDefaultZoomLevel() = 0;
|
||||
|
||||
///
|
||||
/// Get the current zoom level. This method can only be called on the UI
|
||||
/// thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual double GetZoomLevel() = 0;
|
||||
|
||||
///
|
||||
/// Change the zoom level to the specified value. Specify 0.0 to reset the
|
||||
/// zoom level. If called on the UI thread the change will be applied
|
||||
/// immediately. Otherwise, the change will be applied asynchronously on the
|
||||
/// UI thread.
|
||||
/// zoom level to the default. If called on the UI thread the change will be
|
||||
/// applied immediately. Otherwise, the change will be applied asynchronously
|
||||
/// on the UI thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetZoomLevel(double zoomLevel) = 0;
|
||||
|
Reference in New Issue
Block a user