Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: ios/web/web_state/ui/wk_web_view_configuration_provider.mm

Issue 2076753002: Enable WKWebView phone number detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" 5 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #import <WebKit/WebKit.h> 8 #import <WebKit/WebKit.h>
9 9
10 #include "base/ios/ios_util.h" 10 #include "base/ios/ios_util.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 WKWebViewConfiguration* 56 WKWebViewConfiguration*
57 WKWebViewConfigurationProvider::GetWebViewConfiguration() { 57 WKWebViewConfigurationProvider::GetWebViewConfiguration() {
58 DCHECK([NSThread isMainThread]); 58 DCHECK([NSThread isMainThread]);
59 if (!configuration_) { 59 if (!configuration_) {
60 configuration_.reset([[WKWebViewConfiguration alloc] init]); 60 configuration_.reset([[WKWebViewConfiguration alloc] init]);
61 if (is_off_the_record_ && base::ios::IsRunningOnIOS9OrLater()) { 61 if (is_off_the_record_ && base::ios::IsRunningOnIOS9OrLater()) {
62 // WKWebsiteDataStore is iOS9 only. 62 // WKWebsiteDataStore is iOS9 only.
63 [configuration_ 63 [configuration_
64 setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]]; 64 setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]];
65 } 65 }
66 if (base::ios::IsRunningOnOrLater(10, 0, 0)) {
Eugene But (OOO till 7-30) 2016/06/16 21:39:59 Could you please add IsRunningOnIOS10OrLater to ba
michaeldo 2016/06/16 22:03:21 Done.
67 [configuration_ setDataDetectorTypes:WKDataDetectorTypePhoneNumber];
Eugene But (OOO till 7-30) 2016/06/16 21:39:59 This will not compile with iOS9 SDK, so you should
michaeldo 2016/06/16 22:03:21 Done.
68 }
66 // setJavaScriptCanOpenWindowsAutomatically is required to support popups. 69 // setJavaScriptCanOpenWindowsAutomatically is required to support popups.
67 [[configuration_ preferences] setJavaScriptCanOpenWindowsAutomatically:YES]; 70 [[configuration_ preferences] setJavaScriptCanOpenWindowsAutomatically:YES];
68 [[configuration_ userContentController] 71 [[configuration_ userContentController]
69 addUserScript:InternalGetEarlyPageScript()]; 72 addUserScript:InternalGetEarlyPageScript()];
70 } 73 }
71 // Prevent callers from changing the internals of configuration. 74 // Prevent callers from changing the internals of configuration.
72 return [[configuration_ copy] autorelease]; 75 return [[configuration_ copy] autorelease];
73 } 76 }
74 77
75 CRWWKScriptMessageRouter* 78 CRWWKScriptMessageRouter*
(...skipping 18 matching lines...) Expand all
94 configuration_.reset(); 97 configuration_.reset();
95 router_.reset(); 98 router_.reset();
96 // Make sure that no one retains configuration, router, processPool. 99 // Make sure that no one retains configuration, router, processPool.
97 DCHECK(!weak_configuration); 100 DCHECK(!weak_configuration);
98 DCHECK(!weak_router); 101 DCHECK(!weak_router);
99 // TODO(crbug.com/522672): Enable this DCHECK. 102 // TODO(crbug.com/522672): Enable this DCHECK.
100 // DCHECK(!weak_process_pool); 103 // DCHECK(!weak_process_pool);
101 } 104 }
102 105
103 } // namespace web 106 } // namespace web
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698