OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/geolocation/omnibox_geolocation_config.h" | 5 #import "ios/chrome/browser/geolocation/omnibox_geolocation_config.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/mac/foundation_util.h" | 11 #include "base/mac/foundation_util.h" |
12 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
15 namespace { | 19 namespace { |
16 | 20 |
17 NSString* const kEligibleDomainsKey = @"EligibleDomains"; | 21 NSString* const kEligibleDomainsKey = @"EligibleDomains"; |
18 | 22 |
19 } // namespace | 23 } // namespace |
20 | 24 |
21 @interface OmniboxGeolocationConfig () { | 25 @interface OmniboxGeolocationConfig () { |
22 // Whitelist of domains eligible for Omnibox geolocation. | 26 // Whitelist of domains eligible for Omnibox geolocation. |
23 std::set<std::string> _eligibleDomains; | 27 std::set<std::string> _eligibleDomains; |
24 } | 28 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if ([domain length]) { | 75 if ([domain length]) { |
72 _eligibleDomains.insert( | 76 _eligibleDomains.insert( |
73 base::SysNSStringToUTF8([domain lowercaseString])); | 77 base::SysNSStringToUTF8([domain lowercaseString])); |
74 } | 78 } |
75 } | 79 } |
76 } | 80 } |
77 DCHECK(!_eligibleDomains.empty()); | 81 DCHECK(!_eligibleDomains.empty()); |
78 } | 82 } |
79 | 83 |
80 @end | 84 @end |
OLD | NEW |