diff --git a/atom/browser/mac/atom_application_delegate.mm b/atom/browser/mac/atom_application_delegate.mm index 7662162ab618..33aa47ce2402 100644 --- a/atom/browser/mac/atom_application_delegate.mm +++ b/atom/browser/mac/atom_application_delegate.mm @@ -59,4 +59,24 @@ return flag; } +- (BOOL)application:(NSApplication *)sender +continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { + std::string activity_type(base::SysNSStringToUTF8(userActivity.activityType)); + + std::map user_info; + + NSArray* keys = [userActivity.userInfo allKeys]; + for (NSString* key in keys) + { + NSString* value = [userActivity.userInfo objectForKey:key]; + std::string key_str(base::SysNSStringToUTF8(key)); + std::string value_str(base::SysNSStringToUTF8(value)); + user_info[key_str] = value_str; + } + + atom::Browser* browser = atom::Browser::Get(); + return browser->ContinueUserActivity(activity_type, user_info) ? YES : NO; +} + @end