Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / ios / net / url_scheme_util.mm
blobebd77cc2d16c32bc9e08cf3ba3448124d48c731a
1 // Copyright 2014 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 #import "ios/net/url_scheme_util.h"
7 #import <Foundation/Foundation.h>
9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h"
11 #include "url/gurl.h"
13 namespace net {
15 bool UrlSchemeIs(NSURL* url, NSString* scheme) {
16   DCHECK([scheme isEqualToString:[scheme lowercaseString]]);
17   NSString* url_scheme = [url scheme];
18   return (url_scheme != nil) &&
19          [url_scheme caseInsensitiveCompare:scheme] == NSOrderedSame;
22 bool UrlHasDataScheme(NSURL* url) {
23   return UrlSchemeIs(url, base::SysUTF8ToNSString(url::kDataScheme));
26 }  // namespace net