| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/app/spotlight/spotlight_util.h" | 5 #import "ios/chrome/app/spotlight/spotlight_util.h" |
| 6 | 6 |
| 7 #import <CoreSpotlight/CoreSpotlight.h> | 7 #import <CoreSpotlight/CoreSpotlight.h> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| 11 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 11 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 12 #include "ios/public/provider/chrome/browser/spotlight/spotlight_provider.h" | 12 #include "ios/public/provider/chrome/browser/spotlight/spotlight_provider.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 // This enum is used for Histogram. Items should not be removed or reordered and | 20 // This enum is used for Histogram. Items should not be removed or reordered and |
| 17 // this enum should be kept synced with histograms.xml. | 21 // this enum should be kept synced with histograms.xml. |
| 18 // The three states correspond to: | 22 // The three states correspond to: |
| 19 // - SPOTLIGHT_UNSUPPORTED: Framework CoreSpotlight is not found and | 23 // - SPOTLIGHT_UNSUPPORTED: Framework CoreSpotlight is not found and |
| 20 // [CSSearchableIndex class] returns nil. | 24 // [CSSearchableIndex class] returns nil. |
| 21 // - SPOTLIGHT_UNAVAILABLE: Framework is loaded but [CSSearchableIndex | 25 // - SPOTLIGHT_UNAVAILABLE: Framework is loaded but [CSSearchableIndex |
| 22 // isIndexingAvailable] return NO. Note: It is unclear if this state is | 26 // isIndexingAvailable] return NO. Note: It is unclear if this state is |
| 23 // reachable (I could not find configuration where CoreSpotlight was loaded but | 27 // reachable (I could not find configuration where CoreSpotlight was loaded but |
| 24 // [CSSearchableIndex isIndexingAvailable] returned NO. | 28 // [CSSearchableIndex isIndexingAvailable] returned NO. |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 211 } |
| 208 } | 212 } |
| 209 completion(nil); | 213 completion(nil); |
| 210 | 214 |
| 211 }]; | 215 }]; |
| 212 | 216 |
| 213 [query start]; | 217 [query start]; |
| 214 } | 218 } |
| 215 | 219 |
| 216 } // namespace spotlight | 220 } // namespace spotlight |
| OLD | NEW |