Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / ios / web / public / interstitials / web_interstitial.h
blobda8ae68bc2093c27a75ea15d2dd104676ee87bb3
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_H_
6 #define IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_H_
8 class GURL;
10 namespace gfx {
11 class Size;
14 namespace web {
16 class WebInterstitialDelegate;
17 class WebState;
19 // This class is used for showing interstitial pages, pages that show some
20 // informative message asking for user validation before reaching the target
21 // page. (Navigating to a page served over bad HTTPS or a page containing
22 // malware are typical cases where an interstitial is required.)
24 // WebInterstitial instances take care of deleting themselves when closed by the
25 // WebState or through a navigation.
26 class WebInterstitial {
27 public:
28 // Creates an interstitial page to show in |web_state|. Takes ownership of
29 // |delegate|. Reloading the interstitial page will result in a new navigation
30 // to |url|.
31 static WebInterstitial* Create(WebState* web_state,
32 const GURL& url,
33 scoped_ptr<WebInterstitialDelegate> delegate);
35 // Retrieves the WebInterstitial if any associated with the specified
36 // |web_state|.
37 static WebInterstitial* GetWebInterstitial(WebState* web_state);
39 virtual ~WebInterstitial() {}
41 // Shows the interstitial page in the WebState.
42 virtual void Show() = 0;
44 // Hides the interstitial page.
45 virtual void Hide() = 0;
47 // Reverts to the page showing before the interstitial.
48 // Delegates should call this method when the user has chosen NOT to proceed
49 // to the target URL.
50 // Warning: 'this' has been deleted when this method returns.
51 virtual void DontProceed() = 0;
53 // Delegates should call this method when the user has chosen to proceed to
54 // the target URL.
55 // Warning: 'this' has been deleted when this method returns.
56 virtual void Proceed() = 0;
58 // Sizes the view showing the actual interstitial page contents.
59 virtual void SetSize(const gfx::Size& size) = 0;
62 } // namespace web
64 #endif // IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_H_