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:
Marshall Greenblatt
2023-10-04 19:46:45 -04:00
parent d8ea7363f5
commit 29938f9cb0
20 changed files with 338 additions and 80 deletions

View File

@@ -80,8 +80,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool TryCloseBrowser() override;
CefWindowHandle GetWindowHandle() override;
CefWindowHandle GetOpenerWindowHandle() override;
double GetZoomLevel() override;
void SetZoomLevel(double zoomLevel) override;
void Find(const CefString& searchText,
bool forward,
bool matchCase,
@@ -204,6 +202,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
const std::u16string& message,
int32_t line_no,
const std::u16string& source_id) override;
void ContentsZoomChange(bool zoom_in) override;
void BeforeUnloadFired(content::WebContents* source,
bool proceed,
bool* proceed_to_fire_unload) override;