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
3 // found in the LICENSE file.
5 #include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h"
7 #include "base/logging.h"
8 #include "base/strings/string_util.h"
9 #include "ios/chrome/browser/chrome_url_util.h"
10 #include "net/base/net_util.h"
11 #include "url/url_util.h"
13 AutocompleteSchemeClassifierImpl::AutocompleteSchemeClassifierImpl() {}
15 AutocompleteSchemeClassifierImpl::~AutocompleteSchemeClassifierImpl() {}
17 metrics::OmniboxInputType::Type
18 AutocompleteSchemeClassifierImpl::GetInputTypeForScheme(
19 const std::string& scheme) const {
20 DCHECK_EQ(scheme, base::ToLowerASCII(scheme));
21 if (base::IsStringASCII(scheme) &&
22 (IsHandledProtocol(scheme) || (scheme == url::kJavaScriptScheme))) {
23 return metrics::OmniboxInputType::URL;
26 // iOS does not support registration of external schemes.
27 return metrics::OmniboxInputType::INVALID;