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

Unified Diff: ios/chrome/browser/chrome_url_util.h

Issue 1139383002: [iOS] Upstream URL utilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address rohitrao comments Created 5 years, 7 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 | « no previous file | ios/chrome/browser/chrome_url_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/chrome_url_util.h
diff --git a/ios/chrome/browser/chrome_url_util.h b/ios/chrome/browser/chrome_url_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..c84284f7bff9e02ee63ad7117eed355ae8069746
--- /dev/null
+++ b/ios/chrome/browser/chrome_url_util.h
@@ -0,0 +1,47 @@
+// Copyright 2012 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_CHROME_BROWSER_CHROME_URL_UTIL_H_
+#define IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_
+
+#import <Foundation/Foundation.h>
+
+class GURL;
+
+// Returns whether |url| is an external file reference.
+bool UrlIsExternalFileReference(const GURL& url);
+
+// Returns a URL that launches Chrome.
+NSURL* UrlToLaunchChrome();
+
+// Returns the URL for the iOS App Icon for Chrome.
+NSURL* UrlOfChromeAppIcon(int width, int height);
+
+// Returns true if the scheme has a chrome scheme.
+bool UrlHasChromeScheme(const GURL& url);
+bool UrlHasChromeScheme(NSURL* url);
+
+// Singleton object that generates constants for Chrome iOS applications.
+// Behavior of this object can be overridden by unit tests.
+@interface ChromeAppConstants : NSObject
+
+// Class method returning the singleton instance.
++ (ChromeAppConstants*)sharedInstance;
+
+// Returns the URL scheme that launches Chrome.
+- (NSString*)getBundleURLScheme;
+
+// Returns the URL string to the Chrome application icon.
+- (NSString*)getChromeAppIconURLOfWidth:(int)width height:(int)height;
+
+// Method to set the scheme to callback Chrome iOS for testing.
+- (void)setCallbackSchemeForTesting:(NSString*)callbackScheme;
+
+// Method to set a different block to provider the App Icon URL.
+typedef NSString* (^AppIconURLProvider)(int, int);
+- (void)setAppIconURLProviderForTesting:(AppIconURLProvider)block;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_
« no previous file with comments | « no previous file | ios/chrome/browser/chrome_url_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698