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 #ifndef IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_ | 5 #ifndef IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_ |
6 #define IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_ | 6 #define IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_ |
7 | 7 |
8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 21 matching lines...) Expand all Loading... |
32 // receives a JavaScript command. | 32 // receives a JavaScript command. |
33 void CommandReceivedFromWebView(NSString* command); | 33 void CommandReceivedFromWebView(NSString* command); |
34 | 34 |
35 // WebInterstitialImpl implementation: | 35 // WebInterstitialImpl implementation: |
36 CRWContentView* GetContentView() const override; | 36 CRWContentView* GetContentView() const override; |
37 | 37 |
38 protected: | 38 protected: |
39 // WebInterstitialImpl implementation: | 39 // WebInterstitialImpl implementation: |
40 void PrepareForDisplay() override; | 40 void PrepareForDisplay() override; |
41 WebInterstitialDelegate* GetDelegate() const override; | 41 WebInterstitialDelegate* GetDelegate() const override; |
42 void EvaluateJavaScript(NSString* script, | |
43 JavaScriptCompletion completionHandler) override; | |
44 void ExecuteJavaScript(NSString* script, | 42 void ExecuteJavaScript(NSString* script, |
45 JavaScriptResultBlock completion_handler) override; | 43 JavaScriptResultBlock completion_handler) override; |
46 | 44 |
47 private: | 45 private: |
48 // The HTML interstitial delegate. | 46 // The HTML interstitial delegate. |
49 std::unique_ptr<HtmlWebInterstitialDelegate> delegate_; | 47 std::unique_ptr<HtmlWebInterstitialDelegate> delegate_; |
50 // The |web_view_|'s delegate. Used to forward JavaScript commands | 48 // The |web_view_|'s delegate. Used to forward JavaScript commands |
51 // resulting from user interaction with the interstitial content. | 49 // resulting from user interaction with the interstitial content. |
52 base::scoped_nsprotocol<id<WKNavigationDelegate>> web_view_delegate_; | 50 base::scoped_nsprotocol<id<WKNavigationDelegate>> web_view_delegate_; |
53 // The web view used to show the content. View needs to be resized by the | 51 // The web view used to show the content. View needs to be resized by the |
54 // caller. | 52 // caller. |
55 base::scoped_nsobject<WKWebView> web_view_; | 53 base::scoped_nsobject<WKWebView> web_view_; |
56 // The CRWContentView used to display |web_view_controller_|'s view. | 54 // The CRWContentView used to display |web_view_controller_|'s view. |
57 base::scoped_nsobject<CRWContentView> content_view_; | 55 base::scoped_nsobject<CRWContentView> content_view_; |
58 }; | 56 }; |
59 | 57 |
60 } // namespace web | 58 } // namespace web |
61 | 59 |
62 #endif // IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_ | 60 #endif // IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_ |
OLD | NEW |