| 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 #include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h" | 5 #include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "ios/chrome/browser/chrome_url_util.h" | 9 #include "ios/chrome/browser/chrome_url_util.h" |
| 10 #include "url/url_util.h" | 10 #include "url/url_util.h" |
| 11 | 11 |
| 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 #error "This file requires ARC support." |
| 14 #endif |
| 15 |
| 12 AutocompleteSchemeClassifierImpl::AutocompleteSchemeClassifierImpl() {} | 16 AutocompleteSchemeClassifierImpl::AutocompleteSchemeClassifierImpl() {} |
| 13 | 17 |
| 14 AutocompleteSchemeClassifierImpl::~AutocompleteSchemeClassifierImpl() {} | 18 AutocompleteSchemeClassifierImpl::~AutocompleteSchemeClassifierImpl() {} |
| 15 | 19 |
| 16 metrics::OmniboxInputType::Type | 20 metrics::OmniboxInputType::Type |
| 17 AutocompleteSchemeClassifierImpl::GetInputTypeForScheme( | 21 AutocompleteSchemeClassifierImpl::GetInputTypeForScheme( |
| 18 const std::string& scheme) const { | 22 const std::string& scheme) const { |
| 19 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 23 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
| 20 if (base::IsStringASCII(scheme) && | 24 if (base::IsStringASCII(scheme) && |
| 21 (IsHandledProtocol(scheme) || (scheme == url::kJavaScriptScheme))) { | 25 (IsHandledProtocol(scheme) || (scheme == url::kJavaScriptScheme))) { |
| 22 return metrics::OmniboxInputType::URL; | 26 return metrics::OmniboxInputType::URL; |
| 23 } | 27 } |
| 24 | 28 |
| 25 // iOS does not support registration of external schemes. | 29 // iOS does not support registration of external schemes. |
| 26 return metrics::OmniboxInputType::INVALID; | 30 return metrics::OmniboxInputType::INVALID; |
| 27 } | 31 } |
| OLD | NEW |