QUIC - cleanup changes to sync chromium tree with internal source.
[chromium-blink-merge.git] / ios / web / public / interstitials / web_interstitial_delegate.h
blob3f1df495ddd1f73e17a3cfc75d9320f8e3f1ef24
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_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_DELEGATE_H_
6 #define IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_DELEGATE_H_
8 #include <string>
10 #if defined(__OBJC__)
11 @class UIColor;
12 @class UIView;
13 #else
14 class UIColor;
15 class UIView;
16 #endif // __OBJC__
18 namespace web {
20 // Superclass for delegates that provide data to a WebInterstitial. After the
21 // WebInterstitial is shown, it takes ownership of its delegate.
22 class WebInterstitialDelegate {
23 public:
24 virtual ~WebInterstitialDelegate() {}
26 // Called when the interstitial is proceeded or cancelled. Note that this may
27 // be called directly even if the embedder didn't call Proceed or DontProceed
28 // on WebInterstitial, since navigations etc may cancel them.
29 virtual void OnProceed() {}
30 virtual void OnDontProceed() {}
33 // Provides HTML to an HTMLWebInterstitialImpl.
34 class HtmlWebInterstitialDelegate : public WebInterstitialDelegate {
35 public:
36 // Returns the HTML that should be displayed in the page.
37 virtual std::string GetHtmlContents() const = 0;
39 // Invoked when a WebInterstitial receives a command via JavaScript.
40 virtual void CommandReceived(const std::string& command) {}
43 // Provides a native content view to NativeWebInterstitialImpls.
44 class NativeWebInterstitialDelegate : public WebInterstitialDelegate {
45 public:
46 // Returns the content view for native interstitials.
47 virtual UIView* GetContentView() = 0;
49 // The desired background color for the interstitial's scroll view.
50 virtual UIColor* GetScrollViewBackgroundColor() const = 0;
53 } // namespace web
55 #endif // IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_DELEGATE_H_