OLD | NEW |
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/interstitials/html_web_interstitial_impl.h" | 5 #import "ios/web/interstitials/html_web_interstitial_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
11 #include "ios/web/interstitials/web_interstitial_facade_delegate.h" | 11 #include "ios/web/interstitials/web_interstitial_facade_delegate.h" |
12 #include "ios/web/public/interstitials/web_interstitial_delegate.h" | 12 #include "ios/web/public/interstitials/web_interstitial_delegate.h" |
13 #include "ios/web/public/web_state/ui/crw_web_view_content_view.h" | 13 #include "ios/web/public/web_state/ui/crw_web_view_content_view.h" |
14 #import "ios/web/public/web_view_creation_util.h" | 14 #import "ios/web/public/web_view_creation_util.h" |
15 #import "ios/web/web_state/ui/web_view_js_utils.h" | 15 #import "ios/web/web_state/ui/web_view_js_utils.h" |
16 #include "ios/web/web_state/web_state_impl.h" | 16 #include "ios/web/web_state/web_state_impl.h" |
17 #import "net/base/mac/url_conversions.h" | 17 #import "net/base/mac/url_conversions.h" |
18 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
19 | 19 |
| 20 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 21 #error "This file requires ARC support." |
| 22 #endif |
| 23 |
20 // The delegate of the web view that is used to display the HTML content. | 24 // The delegate of the web view that is used to display the HTML content. |
21 // It intercepts JavaScript-triggered commands and forwards them | 25 // It intercepts JavaScript-triggered commands and forwards them |
22 // to the interstitial. | 26 // to the interstitial. |
23 @interface CRWWebInterstitialImplWKWebViewDelegate | 27 @interface CRWWebInterstitialImplWKWebViewDelegate |
24 : NSObject<WKNavigationDelegate> | 28 : NSObject<WKNavigationDelegate> |
25 // Initializes a CRWWebInterstitialImplWKWebViewDelegate which will | 29 // Initializes a CRWWebInterstitialImplWKWebViewDelegate which will |
26 // forward JavaScript commands from its WKWebView to |interstitial|. | 30 // forward JavaScript commands from its WKWebView to |interstitial|. |
27 - (instancetype)initWithInterstitial: | 31 - (instancetype)initWithInterstitial: |
28 (web::HtmlWebInterstitialImpl*)interstitial; | 32 (web::HtmlWebInterstitialImpl*)interstitial; |
29 @end | 33 @end |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return delegate_.get(); | 129 return delegate_.get(); |
126 } | 130 } |
127 | 131 |
128 void HtmlWebInterstitialImpl::EvaluateJavaScript( | 132 void HtmlWebInterstitialImpl::EvaluateJavaScript( |
129 NSString* script, | 133 NSString* script, |
130 JavaScriptCompletion completionHandler) { | 134 JavaScriptCompletion completionHandler) { |
131 web::EvaluateJavaScript(web_view_, script, completionHandler); | 135 web::EvaluateJavaScript(web_view_, script, completionHandler); |
132 } | 136 } |
133 | 137 |
134 } // namespace web | 138 } // namespace web |
OLD | NEW |