OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 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. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_ |
| 6 #define IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 class GURL; |
| 11 |
| 12 // Returns whether |url| is an external file reference. |
| 13 bool UrlIsExternalFileReference(const GURL& url); |
| 14 |
| 15 // Returns a URL that launches Chrome. |
| 16 NSURL* UrlToLaunchChrome(); |
| 17 |
| 18 // Returns the URL for the iOS App Icon for Chrome. |
| 19 NSURL* UrlOfChromeAppIcon(int width, int height); |
| 20 |
| 21 // Returns true if the scheme has a chrome scheme. |
| 22 bool UrlHasChromeScheme(const GURL& url); |
| 23 bool UrlHasChromeScheme(NSURL* url); |
| 24 |
| 25 // Singleton object that generates constants for Chrome iOS applications. |
| 26 // Behavior of this object can be overridden by unit tests. |
| 27 @interface ChromeAppConstants : NSObject |
| 28 |
| 29 // Class method returning the singleton instance. |
| 30 + (ChromeAppConstants*)sharedInstance; |
| 31 |
| 32 // Returns the URL scheme that launches Chrome. |
| 33 - (NSString*)getBundleURLScheme; |
| 34 |
| 35 // Returns the URL string to the Chrome application icon. |
| 36 - (NSString*)getChromeAppIconURLOfWidth:(int)width height:(int)height; |
| 37 |
| 38 // Method to set the scheme to callback Chrome iOS for testing. |
| 39 - (void)setCallbackSchemeForTesting:(NSString*)callbackScheme; |
| 40 |
| 41 // Method to set a different block to provider the App Icon URL. |
| 42 typedef NSString* (^AppIconURLProvider)(int, int); |
| 43 - (void)setAppIconURLProviderForTesting:(AppIconURLProvider)block; |
| 44 |
| 45 @end |
| 46 |
| 47 #endif // IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_ |
OLD | NEW |