Add header declarations in auto_updater

This commit is contained in:
Shelley Vohr 2017-07-26 18:10:09 -07:00
parent 8cf00fece6
commit 919d7fa22e
2 changed files with 4 additions and 2 deletions

View file

@ -22,6 +22,8 @@ class Delegate {
// An error happened. // An error happened.
virtual void OnError(const std::string& error) {} virtual void OnError(const std::string& error) {}
virtual void OnError(const std::string& error, const int code, const std::string& domain) {}
// Checking to see if there is an update // Checking to see if there is an update
virtual void OnCheckingForUpdate() {} virtual void OnCheckingForUpdate() {}

View file

@ -115,7 +115,7 @@ void AutoUpdater::CheckForUpdates() {
[failureString appendString:@" "]; [failureString appendString:@" "];
[failureString appendString:error.localizedRecoverySuggestion]; [failureString appendString:error.localizedRecoverySuggestion];
} }
delegate->OnError(base::SysNSStringToUTF8(failureString)); delegate->OnError(base::SysNSStringToUTF8(failureString), error.code, base::SysNSStringToUTF8(error.domain));
}]; }];
} }
@ -124,7 +124,7 @@ void AutoUpdater::QuitAndInstall() {
if (g_update_available) { if (g_update_available) {
[[g_updater relaunchToInstallUpdate] subscribeError:^(NSError* error) { [[g_updater relaunchToInstallUpdate] subscribeError:^(NSError* error) {
if (delegate) if (delegate)
delegate->OnError(base::SysNSStringToUTF8(error.localizedDescription)); delegate->OnError(base::SysNSStringToUTF8(error.localizedDescription), error.code, base::SysNSStringToUTF8(error.domain));
}]; }];
} else { } else {
if (delegate) if (delegate)