OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/chrome_url_util.h" | 5 #import "ios/chrome/browser/chrome_url_util.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_block.h" | 10 #include "base/mac/scoped_block.h" |
11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
14 #include "ios/chrome/browser/chrome_url_constants.h" | 14 #include "ios/chrome/browser/chrome_url_constants.h" |
15 #import "ios/net/url_scheme_util.h" | 15 #import "ios/net/url_scheme_util.h" |
16 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 16 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 bool UrlIsExternalFileReference(const GURL& url) { | 19 bool UrlIsExternalFileReference(const GURL& url) { |
20 return url.SchemeIs(ios::GetChromeBrowserProvider()->GetChromeUIScheme()) && | 20 return url.SchemeIs(ios::GetChromeBrowserProvider()->GetChromeUIScheme()) && |
21 LowerCaseEqualsASCII(url.host(), kChromeUIExternalFileHost); | 21 base::LowerCaseEqualsASCII(url.host(), kChromeUIExternalFileHost); |
22 } | 22 } |
23 | 23 |
24 NSURL* UrlToLaunchChrome() { | 24 NSURL* UrlToLaunchChrome() { |
25 // Determines the target URL scheme that will launch Chrome. | 25 // Determines the target URL scheme that will launch Chrome. |
26 NSString* scheme = [[ChromeAppConstants sharedInstance] getBundleURLScheme]; | 26 NSString* scheme = [[ChromeAppConstants sharedInstance] getBundleURLScheme]; |
27 return [NSURL URLWithString:[NSString stringWithFormat:@"%@://", scheme]]; | 27 return [NSURL URLWithString:[NSString stringWithFormat:@"%@://", scheme]]; |
28 } | 28 } |
29 | 29 |
30 NSURL* UrlOfChromeAppIcon(int width, int height) { | 30 NSURL* UrlOfChromeAppIcon(int width, int height) { |
31 NSString* url = | 31 NSString* url = |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 - (void)setCallbackSchemeForTesting:(NSString*)scheme { | 94 - (void)setCallbackSchemeForTesting:(NSString*)scheme { |
95 _callbackScheme.reset([scheme copy]); | 95 _callbackScheme.reset([scheme copy]); |
96 } | 96 } |
97 | 97 |
98 - (void)setAppIconURLProviderForTesting:(AppIconURLProvider)block { | 98 - (void)setAppIconURLProviderForTesting:(AppIconURLProvider)block { |
99 _appIconURLProvider.reset(block, base::scoped_policy::RETAIN); | 99 _appIconURLProvider.reset(block, base::scoped_policy::RETAIN); |
100 } | 100 } |
101 | 101 |
102 @end | 102 @end |
OLD | NEW |