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_NATIVE_WEB_INTERSTITIAL_IMPL_H_
6 #define IOS_WEB_INTERSTITIALS_NATIVE_WEB_INTERSTITIAL_IMPL_H_
8 #include "ios/web/interstitials/web_interstitial_impl.h"
10 #include "base/ios/weak_nsobject.h"
11 #include "base/mac/scoped_nsobject.h"
15 class NativeWebInterstitialDelegate
;
17 // A concrete subclass of WebInterstitialImpl that is used to display
18 // interstitials created via native views.
19 class NativeWebInterstitialImpl
: public WebInterstitialImpl
{
21 NativeWebInterstitialImpl(WebStateImpl
* web_state
,
23 scoped_ptr
<NativeWebInterstitialDelegate
> delegate
);
24 ~NativeWebInterstitialImpl() override
;
26 // WebInterstitialImpl implementation:
27 CRWContentView
* GetContentView() const override
;
30 // WebInterstitialImpl implementation:
31 void PrepareForDisplay() override
;
32 WebInterstitialDelegate
* GetDelegate() const override
;
33 void EvaluateJavaScript(NSString
* script
,
34 JavaScriptCompletion completionHandler
) override
;
37 // The native interstitial delegate.
38 scoped_ptr
<NativeWebInterstitialDelegate
> delegate_
;
39 // The transient content view containing interstitial content.
40 base::scoped_nsobject
<CRWContentView
> content_view_
;
45 #endif // IOS_WEB_INTERSTITIALS_NATIVE_WEB_INTERSTITIAL_IMPL_H_