Merge pull request #1980 from magicae/set-audio-mute
webContents: add setAudioMuted to webContents
This commit is contained in:
commit
bf9af4d45b
5 changed files with 34 additions and 0 deletions
|
@ -580,6 +580,14 @@ void WebContents::UnregisterServiceWorker(
|
|||
callback);
|
||||
}
|
||||
|
||||
void WebContents::SetAudioMuted(bool muted) {
|
||||
web_contents()->SetAudioMuted(muted);
|
||||
}
|
||||
|
||||
bool WebContents::IsAudioMuted() {
|
||||
return web_contents()->IsAudioMuted();
|
||||
}
|
||||
|
||||
void WebContents::Undo() {
|
||||
web_contents()->Undo();
|
||||
}
|
||||
|
@ -731,6 +739,8 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
|
|||
.SetMethod("isDevToolsOpened", &WebContents::IsDevToolsOpened)
|
||||
.SetMethod("toggleDevTools", &WebContents::ToggleDevTools)
|
||||
.SetMethod("inspectElement", &WebContents::InspectElement)
|
||||
.SetMethod("setAudioMuted", &WebContents::SetAudioMuted)
|
||||
.SetMethod("isAudioMuted", &WebContents::IsAudioMuted)
|
||||
.SetMethod("undo", &WebContents::Undo)
|
||||
.SetMethod("redo", &WebContents::Redo)
|
||||
.SetMethod("cut", &WebContents::Cut)
|
||||
|
|
|
@ -87,6 +87,8 @@ class WebContents : public mate::EventEmitter,
|
|||
void InspectServiceWorker();
|
||||
void HasServiceWorker(const base::Callback<void(bool)>&);
|
||||
void UnregisterServiceWorker(const base::Callback<void(bool)>&);
|
||||
void SetAudioMuted(bool muted);
|
||||
bool IsAudioMuted();
|
||||
|
||||
// Editing commands.
|
||||
void Undo();
|
||||
|
|
|
@ -275,6 +275,8 @@ registerWebViewElement = ->
|
|||
"closeDevTools"
|
||||
"isDevToolsOpened"
|
||||
"inspectElement"
|
||||
"setAudioMuted"
|
||||
"isAudioMuted"
|
||||
"undo"
|
||||
"redo"
|
||||
"cut"
|
||||
|
|
|
@ -877,6 +877,16 @@ Injects CSS into this page.
|
|||
|
||||
Evaluates `code` in page.
|
||||
|
||||
### WebContents.setAudioMuted(muted)
|
||||
|
||||
+ `muted` Boolean
|
||||
|
||||
Set the page muted.
|
||||
|
||||
### WebContents.isAudioMuted()
|
||||
|
||||
Returns whether this page has been muted.
|
||||
|
||||
### WebContents.undo()
|
||||
|
||||
Executes editing command `undo` in page.
|
||||
|
|
|
@ -250,6 +250,16 @@ Starts inspecting element at position (`x`, `y`) of guest page.
|
|||
|
||||
Opens the devtools for the service worker context present in the guest page.
|
||||
|
||||
### `<webview>`.setAudioMuted(muted)
|
||||
|
||||
+ `muted` Boolean
|
||||
|
||||
Set guest page muted.
|
||||
|
||||
### `<webview>`.isAudioMuted()
|
||||
|
||||
Returns whether guest page has been muted.
|
||||
|
||||
### `<webview>`.undo()
|
||||
|
||||
Executes editing command `undo` in page.
|
||||
|
|
Loading…
Reference in a new issue