BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / ios / web / interstitials / html_web_interstitial_impl.h
blob8e469a95b4aa6d4512648fb5d19293a7a06447d3
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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_
6 #define IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_
8 #import <UIKit/UIKit.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ios/web/interstitials/web_interstitial_impl.h"
14 @protocol CRWSimpleWebViewController;
15 @protocol CRWSimpleWebViewControllerDelegate;
17 namespace web {
19 class HtmlWebInterstitialDelegate;
20 class HtmlWebInterstitialImpl;
22 // A concrete subclass of WebInterstitialImpl that is used to display
23 // interstitials created via HTML.
24 class HtmlWebInterstitialImpl : public WebInterstitialImpl {
25 public:
26 HtmlWebInterstitialImpl(WebStateImpl* web_state,
27 const GURL& url,
28 scoped_ptr<HtmlWebInterstitialDelegate> delegate);
29 ~HtmlWebInterstitialImpl() override;
31 // Called by |web_view_controller_delegate_| when |web_view_controller_|
32 // receives a JavaScript command.
33 void CommandReceivedFromWebView(NSString* command);
35 // WebInterstitialImpl implementation:
36 CRWContentView* GetContentView() const override;
38 protected:
39 // WebInterstitialImpl implementation:
40 void PrepareForDisplay() override;
41 WebInterstitialDelegate* GetDelegate() const override;
42 void EvaluateJavaScript(NSString* script,
43 JavaScriptCompletion completionHandler) override;
45 private:
46 // The HTML interstitial delegate.
47 scoped_ptr<HtmlWebInterstitialDelegate> delegate_;
48 // The |web_view_controller_|'s delegate. Used to forward JavaScript commands
49 // resulting from user interaction with the interstitial content.
50 base::scoped_nsprotocol<id<CRWSimpleWebViewControllerDelegate>>
51 web_view_controller_delegate_;
52 // The CRWSimpleWebViewController that contains the web view used to show the
53 // content. View needs to be resized by the caller.
54 base::scoped_nsprotocol<id<CRWSimpleWebViewController>> web_view_controller_;
55 // The CRWContentView used to display |web_view_controller_|'s view.
56 base::scoped_nsobject<CRWContentView> content_view_;
59 } // namespace web
61 #endif // IOS_WEB_INTERSTITIALS_HTML_WEB_INTERSTITIAL_IMPL_H_