Fire a show
event when a notification is shown
This commit is contained in:
parent
0893253188
commit
1328c85eef
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#import "browser/browser_client.h"
|
#import "browser/browser_client.h"
|
||||||
|
|
||||||
#import "base/strings/sys_string_conversions.h"
|
#import "base/strings/sys_string_conversions.h"
|
||||||
|
#import "content/public/browser/render_view_host.h"
|
||||||
#import "content/public/common/show_desktop_notification_params.h"
|
#import "content/public/common/show_desktop_notification_params.h"
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
@ -18,6 +19,12 @@ void BrowserClient::ShowDesktopNotification(
|
||||||
|
|
||||||
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
|
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
|
||||||
[notification release];
|
[notification release];
|
||||||
|
|
||||||
|
auto host = content::RenderViewHost::FromID(render_process_id, render_view_id);
|
||||||
|
if (!host)
|
||||||
|
return;
|
||||||
|
|
||||||
|
host->DesktopNotificationPostDisplay(params.notification_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue