Commit cf7070de authored by pkl's avatar pkl Committed by Commit bot

Removed uses of IsRunningOnIOS9OrLater in crw_web_ or wk_web_view_

BUG=633626

Review-Url: https://codereview.chromium.org/2436903002
Cr-Commit-Position: refs/heads/master@{#427108}
parent 4b5321f2
......@@ -7,7 +7,6 @@
#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
#include "base/ios/ios_util.h"
#include "base/logging.h"
#import "base/mac/scoped_nsobject.h"
#include "ios/web/public/test/test_browser_state.h"
......@@ -37,12 +36,10 @@ WKWebView* CreateMockWKWebViewWithStubbedJSEvalFunction(
namespace web {
void SimulateWKWebViewCrash(WKWebView* webView) {
if (base::ios::IsRunningOnIOS9OrLater()) {
SEL selector = @selector(webViewWebContentProcessDidTerminate:);
if ([webView.navigationDelegate respondsToSelector:selector]) {
[webView.navigationDelegate performSelector:selector withObject:webView];
}
}
[webView performSelector:@selector(_processDidExit)];
}
......
......@@ -4,7 +4,6 @@
#import "ios/web/web_state/crw_web_view_proxy_impl.h"
#include "base/ios/ios_util.h"
#include "base/mac/scoped_nsobject.h"
#import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h"
#import "ios/web/public/web_state/ui/crw_content_view.h"
......@@ -169,16 +168,12 @@ UIView* GetFirstResponderSubview(UIView* view) {
return firstResponder.inputAccessoryView;
}
#if defined(__IPHONE_9_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
- (UITextInputAssistantItem*)inputAssistantItem {
DCHECK(base::ios::IsRunningOnIOS9OrLater())
<< "Cannot retrieve inputAssistantItem on iOS versions earlier than 9.";
if (!_contentView)
return nil;
UIView* firstResponder = GetFirstResponderSubview(_contentView);
return firstResponder.inputAssistantItem;
}
#endif
- (BOOL)becomeFirstResponder {
return [_contentView becomeFirstResponder];
......
......@@ -5038,10 +5038,9 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
- (void)webView:(WKWebView*)webView
didStartProvisionalNavigation:(WKNavigation*)navigation {
GURL webViewURL = net::GURLWithNSURL(webView.URL);
if (webViewURL.is_empty() && base::ios::IsRunningOnIOS9OrLater()) {
if (webViewURL.is_empty()) {
// May happen on iOS9, however in didCommitNavigation: callback the URL
// will be "about:blank". TODO(eugenebut): File radar for this issue
// (crbug.com/523549).
// will be "about:blank".
webViewURL = GURL(url::kAboutBlankURL);
}
......
......@@ -58,8 +58,7 @@ WKWebViewConfigurationProvider::GetWebViewConfiguration() {
DCHECK([NSThread isMainThread]);
if (!configuration_) {
configuration_.reset([[WKWebViewConfiguration alloc] init]);
if (is_off_the_record_ && base::ios::IsRunningOnIOS9OrLater()) {
// WKWebsiteDataStore is iOS9 only.
if (is_off_the_record_) {
[configuration_
setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment