Merge branch 'CB-8863'
This commit is contained in:
commit
8fb2244432
@ -214,14 +214,17 @@
|
||||
|
||||
_previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
|
||||
|
||||
CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
|
||||
__block CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
|
||||
initWithRootViewController:self.inAppBrowserViewController];
|
||||
nav.orientationDelegate = self.inAppBrowserViewController;
|
||||
nav.navigationBarHidden = YES;
|
||||
|
||||
__weak CDVInAppBrowser* weakSelf = self;
|
||||
|
||||
// Run later to avoid the "took a long time" log message.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.inAppBrowserViewController != nil) {
|
||||
[self.viewController presentViewController:nav animated:YES completion:nil];
|
||||
if (weakSelf.inAppBrowserViewController != nil) {
|
||||
[weakSelf.viewController presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -755,12 +758,14 @@
|
||||
[self.navigationDelegate browserExit];
|
||||
}
|
||||
|
||||
__weak UIViewController* weakSelf = self;
|
||||
|
||||
// Run later to avoid the "took a long time" log message.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([self respondsToSelector:@selector(presentingViewController)]) {
|
||||
[[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
if ([weakSelf respondsToSelector:@selector(presentingViewController)]) {
|
||||
[[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
} else {
|
||||
[[self parentViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
[[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -772,10 +777,11 @@
|
||||
if (_userAgentLockToken != 0) {
|
||||
[self.webView loadRequest:request];
|
||||
} else {
|
||||
__weak CDVInAppBrowser* weakSelf = self;
|
||||
[CDVUserAgentUtil acquireLock:^(NSInteger lockToken) {
|
||||
_userAgentLockToken = lockToken;
|
||||
[CDVUserAgentUtil setUserAgent:_userAgent lockToken:lockToken];
|
||||
[self.webView loadRequest:request];
|
||||
[weakSelf.webView loadRequest:request];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user