Add the AppDelegate override for restoring from hand-off, and fire the app event.

This commit is contained in:
Charlie Hess 2016-04-29 17:37:01 -07:00
parent c20acb0361
commit 3a9a1d35d7

View file

@ -59,4 +59,24 @@
return flag; return flag;
} }
- (BOOL)application:(NSApplication *)sender
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler {
std::string activity_type(base::SysNSStringToUTF8(userActivity.activityType));
std::map<std::string, std::string> 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 @end