Add 'ready-for-update-on-quit' event for auto-updater.

This commit is contained in:
Cheng Zhao 2013-06-03 21:51:46 +08:00
parent f435ed8667
commit a1dc4b88be
6 changed files with 51 additions and 3 deletions

View file

@ -56,6 +56,20 @@ void CallNSInvocation(ScopedNSInvocation invocation) {
return YES;
}
- (void)updater:(SUUpdater*)updater
willInstallUpdateOnQuit:(SUAppcastItem*)update
immediateInstallationInvocation:(NSInvocation*)invocation {
AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate();
if (!delegate)
return;
std::string version(base::SysNSStringToUTF8([update versionString]));
ScopedNSInvocation invocation_ptr([invocation retain]);
delegate->ReadyForUpdateOnQuit(
version,
base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass())));
}
@end
namespace auto_updater {