Add the AppDelegate override for restoring from hand-off, and fire the app event.
This commit is contained in:
parent
c20acb0361
commit
3a9a1d35d7
1 changed files with 20 additions and 0 deletions
|
@ -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<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
|
||||
|
|
Loading…
Reference in a new issue