NaCl: Increase validation cache size.
[chromium-blink-merge.git] / components / omnibox / test_scheme_classifier.cc
blob1ea504c978210214f2e295a45e0a819a8572fa8e
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 #include "components/metrics/proto/omnibox_input_type.pb.h"
6 #include "components/omnibox/test_scheme_classifier.h"
7 #include "net/url_request/url_request.h"
8 #include "url/url_constants.h"
10 TestSchemeClassifier::TestSchemeClassifier() {}
12 TestSchemeClassifier::~TestSchemeClassifier() {}
14 metrics::OmniboxInputType::Type TestSchemeClassifier::GetInputTypeForScheme(
15 const std::string& scheme) const {
16 // This doesn't check the preference but check some chrome-ish schemes.
17 const char* kKnownURLSchemes[] = {
18 url::kFileScheme, url::kAboutScheme, url::kFtpScheme, url::kBlobScheme,
19 url::kFileSystemScheme, "view-source", "javascript", "chrome", "chrome-ui",
21 for (size_t i = 0; i < arraysize(kKnownURLSchemes); ++i) {
22 if (scheme == kKnownURLSchemes[i])
23 return metrics::OmniboxInputType::URL;
25 if (net::URLRequest::IsHandledProtocol(scheme))
26 return metrics::OmniboxInputType::URL;
28 return metrics::OmniboxInputType::INVALID;