Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / ios / web / interstitials / native_web_interstitial_impl.h
blob87179d89e9ca642af413669662f61c673dbb239f
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 // WebInterstitial implementation:
27 void SetSize(const gfx::Size& size) override;
29 // WebInterstitialImpl implementation:
30 UIView* GetView() const override;
31 UIScrollView* GetScrollView() const override;
33 protected:
34 // WebInterstitialImpl implementation:
35 void PrepareForDisplay() override;
36 WebInterstitialDelegate* GetDelegate() const override;
37 void EvaluateJavaScript(NSString* script,
38 JavaScriptCompletion completionHandler) override;
40 private:
41 // The native interstitial delegate.
42 scoped_ptr<NativeWebInterstitialDelegate> delegate_;
43 // The top-level view containing the scroll view.
44 base::scoped_nsobject<UIView> container_view_;
45 // The scroll view used to display |content_view_|.
46 base::scoped_nsobject<UIScrollView> scroll_view_;
47 // The content view provided by |delegate_|.
48 base::WeakNSObject<UIView> content_view_;
51 } // namespace web
53 #endif // IOS_WEB_INTERSTITIALS_NATIVE_WEB_INTERSTITIAL_IMPL_H_