mirror of
https://github.com/electron/electron.git
synced 2026-01-26 15:58:07 -05:00
Merge pull request #6313 from MarshallOfSound/silent-notification-when-muted
Override the Notification API constructor to create silent notificatons when the webContents is muted
This commit is contained in:
@@ -303,6 +303,13 @@ void AtomBrowserClient::WebNotificationAllowed(
|
||||
permission_helper->RequestWebNotificationPermission(callback);
|
||||
}
|
||||
|
||||
bool AtomBrowserClient::WebContentsAudioMuted(
|
||||
int render_process_id) {
|
||||
content::WebContents* web_contents =
|
||||
WebContentsPreferences::GetWebContentsFromProcessID(render_process_id);
|
||||
return web_contents->IsAudioMuted();
|
||||
}
|
||||
|
||||
void AtomBrowserClient::RenderProcessHostDestroyed(
|
||||
content::RenderProcessHost* host) {
|
||||
int process_id = host->GetID();
|
||||
|
||||
@@ -101,6 +101,8 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||
void WebNotificationAllowed(
|
||||
int render_process_id,
|
||||
const base::Callback<void(bool)>& callback) override;
|
||||
bool WebContentsAudioMuted(
|
||||
int render_process_id) override;
|
||||
|
||||
// content::RenderProcessHostObserver:
|
||||
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
|
||||
|
||||
Reference in New Issue
Block a user