Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: ios/web/public/interstitials/web_interstitial.h

Issue 986743003: Upstream (most of) ios/web/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace comment Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/public/favicon_url.cc ('k') | ios/web/public/interstitials/web_interstitial_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/interstitials/web_interstitial.h
diff --git a/ios/web/public/interstitials/web_interstitial.h b/ios/web/public/interstitials/web_interstitial.h
new file mode 100644
index 0000000000000000000000000000000000000000..da8ae68bc2093c27a75ea15d2dd104676ee87bb3
--- /dev/null
+++ b/ios/web/public/interstitials/web_interstitial.h
@@ -0,0 +1,64 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_H_
+#define IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_H_
+
+class GURL;
+
+namespace gfx {
+class Size;
+}
+
+namespace web {
+
+class WebInterstitialDelegate;
+class WebState;
+
+// This class is used for showing interstitial pages, pages that show some
+// informative message asking for user validation before reaching the target
+// page. (Navigating to a page served over bad HTTPS or a page containing
+// malware are typical cases where an interstitial is required.)
+//
+// WebInterstitial instances take care of deleting themselves when closed by the
+// WebState or through a navigation.
+class WebInterstitial {
+ public:
+ // Creates an interstitial page to show in |web_state|. Takes ownership of
+ // |delegate|. Reloading the interstitial page will result in a new navigation
+ // to |url|.
+ static WebInterstitial* Create(WebState* web_state,
+ const GURL& url,
+ scoped_ptr<WebInterstitialDelegate> delegate);
+
+ // Retrieves the WebInterstitial if any associated with the specified
+ // |web_state|.
+ static WebInterstitial* GetWebInterstitial(WebState* web_state);
+
+ virtual ~WebInterstitial() {}
+
+ // Shows the interstitial page in the WebState.
+ virtual void Show() = 0;
+
+ // Hides the interstitial page.
+ virtual void Hide() = 0;
+
+ // Reverts to the page showing before the interstitial.
+ // Delegates should call this method when the user has chosen NOT to proceed
+ // to the target URL.
+ // Warning: 'this' has been deleted when this method returns.
+ virtual void DontProceed() = 0;
+
+ // Delegates should call this method when the user has chosen to proceed to
+ // the target URL.
+ // Warning: 'this' has been deleted when this method returns.
+ virtual void Proceed() = 0;
+
+ // Sizes the view showing the actual interstitial page contents.
+ virtual void SetSize(const gfx::Size& size) = 0;
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_INTERSTITIALS_WEB_INTERSTITIAL_H_
« no previous file with comments | « ios/web/public/favicon_url.cc ('k') | ios/web/public/interstitials/web_interstitial_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698