Update V8 to version 4.6.61.
[chromium-blink-merge.git] / ios / web / interstitials / native_web_interstitial_impl.h
blob5957ea930e910240dfc904eb136ace30c7fb96b2
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"
13 namespace web {
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 {
20 public:
21 NativeWebInterstitialImpl(WebStateImpl* web_state,
22 const GURL& url,
23 scoped_ptr<NativeWebInterstitialDelegate> delegate);
24 ~NativeWebInterstitialImpl() override;
26 // WebInterstitialImpl implementation:
27 CRWContentView* GetContentView() const override;
29 protected:
30 // WebInterstitialImpl implementation:
31 void PrepareForDisplay() override;
32 WebInterstitialDelegate* GetDelegate() const override;
33 void EvaluateJavaScript(NSString* script,
34 JavaScriptCompletion completionHandler) override;
36 private:
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_;
43 } // namespace web
45 #endif // IOS_WEB_INTERSTITIALS_NATIVE_WEB_INTERSTITIAL_IMPL_H_