Skip to content
Permalink
Browse files

feat: add webContents 'zoom-changed' event

  • Loading branch information...
miniak committed Apr 10, 2019
1 parent e7c4892 commit 87f170d8f7acb65144def6312240bca11895df3e
@@ -630,6 +630,10 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
return content::KeyboardEventProcessingResult::NOT_HANDLED;
}

void WebContents::ContentsZoomChange(bool zoom_in) {
Emit("zoom-changed", zoom_in);
}

void WebContents::EnterFullscreenModeForTab(
content::WebContents* source,
const GURL& origin,
@@ -370,6 +370,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
void ContentsZoomChange(bool zoom_in) override;
void EnterFullscreenModeForTab(
content::WebContents* source,
const GURL& origin,
@@ -369,6 +369,14 @@ Emitted when the window enters a full-screen state triggered by HTML API.

Emitted when the window leaves a full-screen state triggered by HTML API.

#### Event: 'zoom-changed'

Returns:
* `event` Event
* `zoomedIn` Boolean - true if the user is trying to zoom in, false if the user is trying to zoom out

Emitted when the user is requesting to change the zoom level using the mouse wheel.

#### Event: 'devtools-opened'

Emitted when DevTools is opened.

0 comments on commit 87f170d

Please sign in to comment.
You can’t perform that action at this time.