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

Unified Diff: ios/web/public/browser_url_rewriter.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/net/certificate_policy_cache.cc ('k') | ios/web/public/cert_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/browser_url_rewriter.h
diff --git a/ios/web/public/browser_url_rewriter.h b/ios/web/public/browser_url_rewriter.h
new file mode 100644
index 0000000000000000000000000000000000000000..57388546a4783249f50ea21be4c463fabb6e2dc7
--- /dev/null
+++ b/ios/web/public/browser_url_rewriter.h
@@ -0,0 +1,42 @@
+// 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_BROWSER_URL_REWRITER_H_
+#define IOS_WEB_PUBLIC_BROWSER_URL_REWRITER_H_
+
+class GURL;
+
+namespace web {
+
+class BrowserState;
+
+// Some special browser-level URLs (like "about:version") are handled before
+// actually being loaded by the web view, allowing the embedder to optionally
+// convert them to app-specific URLs that to be handled using
+// CRWNativeContentProviders.
+class BrowserURLRewriter {
+ public:
+ // The type of functions that can process a URL. URLRewriters return true if
+ // |url| is ready to be loaded and added to the NavigationManager. They can
+ // optionally modify |url| regardless of whether they return true or false.
+ typedef bool (*URLRewriter)(GURL* url, BrowserState* browser_state);
+
+ // Returns the singleton instance.
+ static BrowserURLRewriter* GetInstance();
+
+ // RewriteURLIfNecessary gives all registered URLRewriters a shot at
+ // processing the given URL, and modifies it in place.
+ virtual void RewriteURLIfNecessary(GURL* url,
+ BrowserState* browser_state) = 0;
+
+ // Adds |rewriter| to the list of URL rewriters. |rewriter| must not be null.
+ virtual void AddURLRewriter(URLRewriter rewriter) = 0;
+
+ protected:
+ virtual ~BrowserURLRewriter() {}
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_BROWSER_URL_REWRITER_H_
« no previous file with comments | « ios/web/net/certificate_policy_cache.cc ('k') | ios/web/public/cert_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698