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.
5 #ifndef IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_
6 #define IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_
8 #import <Foundation/Foundation.h>
12 // Returns whether |url| is an external file reference.
13 bool UrlIsExternalFileReference(const GURL
& url
);
15 // Returns a URL that launches Chrome.
16 NSURL
* UrlToLaunchChrome();
18 // Returns the URL for the iOS App Icon for Chrome.
19 NSURL
* UrlOfChromeAppIcon(int width
, int height
);
21 // Returns true if the scheme has a chrome scheme.
22 bool UrlHasChromeScheme(const GURL
& url
);
23 bool UrlHasChromeScheme(NSURL
* url
);
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
29 // Class method returning the singleton instance.
30 + (ChromeAppConstants
*)sharedInstance
;
32 // Returns the URL scheme that launches Chrome.
33 - (NSString
*)getBundleURLScheme
;
35 // Returns the URL string to the Chrome application icon.
36 - (NSString
*)getChromeAppIconURLOfWidth
:(int)width height
:(int)height
;
38 // Method to set the scheme to callback Chrome iOS for testing.
39 - (void)setCallbackSchemeForTesting
:(NSString
*)callbackScheme
;
41 // Method to set a different block to provider the App Icon URL.
42 typedef NSString
* (^AppIconURLProvider
)(int, int);
43 - (void)setAppIconURLProviderForTesting
:(AppIconURLProvider
)block
;
47 #endif // IOS_CHROME_BROWSER_CHROME_URL_UTIL_H_