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:
commit
b0faa62f76
2 changed files with 9 additions and 0 deletions
|
@ -303,6 +303,13 @@ void AtomBrowserClient::WebNotificationAllowed(
|
||||||
permission_helper->RequestWebNotificationPermission(callback);
|
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(
|
void AtomBrowserClient::RenderProcessHostDestroyed(
|
||||||
content::RenderProcessHost* host) {
|
content::RenderProcessHost* host) {
|
||||||
int process_id = host->GetID();
|
int process_id = host->GetID();
|
||||||
|
|
|
@ -101,6 +101,8 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
void WebNotificationAllowed(
|
void WebNotificationAllowed(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
const base::Callback<void(bool)>& callback) override;
|
const base::Callback<void(bool)>& callback) override;
|
||||||
|
bool WebContentsAudioMuted(
|
||||||
|
int render_process_id) override;
|
||||||
|
|
||||||
// content::RenderProcessHostObserver:
|
// content::RenderProcessHostObserver:
|
||||||
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
|
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
|
||||||
|
|
Loading…
Reference in a new issue