Merge pull request #5477 from danhp/download-bounce

Add API: app.dock.downloadFinished(filePath)
This commit is contained in:
Cheng Zhao 2016-05-11 09:41:08 +09:00
commit ed70a11ff8
5 changed files with 18 additions and 0 deletions

View file

@ -158,6 +158,12 @@ void Browser::DockSetBadgeText(const std::string& label) {
[tile setBadgeLabel:base::SysUTF8ToNSString(label)];
}
void Browser::DockDownloadFinished(const std::string& filePath) {
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"com.apple.DownloadFileFinished"
object: base::SysUTF8ToNSString(filePath)];
}
std::string Browser::DockGetBadgeText() {
NSDockTile *tile = [[AtomApplication sharedApplication] dockTile];
return base::SysNSStringToUTF8([tile badgeLabel]);