Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: components/omnibox/browser/test_scheme_classifier.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 <stddef.h>
6
7 #include "base/macros.h"
5 #include "components/metrics/proto/omnibox_input_type.pb.h" 8 #include "components/metrics/proto/omnibox_input_type.pb.h"
6 #include "components/omnibox/browser/test_scheme_classifier.h" 9 #include "components/omnibox/browser/test_scheme_classifier.h"
7 #include "net/url_request/url_request.h" 10 #include "net/url_request/url_request.h"
8 #include "url/url_constants.h" 11 #include "url/url_constants.h"
9 12
10 TestSchemeClassifier::TestSchemeClassifier() {} 13 TestSchemeClassifier::TestSchemeClassifier() {}
11 14
12 TestSchemeClassifier::~TestSchemeClassifier() {} 15 TestSchemeClassifier::~TestSchemeClassifier() {}
13 16
14 metrics::OmniboxInputType::Type TestSchemeClassifier::GetInputTypeForScheme( 17 metrics::OmniboxInputType::Type TestSchemeClassifier::GetInputTypeForScheme(
15 const std::string& scheme) const { 18 const std::string& scheme) const {
16 // This doesn't check the preference but check some chrome-ish schemes. 19 // This doesn't check the preference but check some chrome-ish schemes.
17 const char* kKnownURLSchemes[] = { 20 const char* kKnownURLSchemes[] = {
18 url::kFileScheme, url::kAboutScheme, url::kFtpScheme, url::kBlobScheme, 21 url::kFileScheme, url::kAboutScheme, url::kFtpScheme, url::kBlobScheme,
19 url::kFileSystemScheme, "view-source", "javascript", "chrome", "chrome-ui", 22 url::kFileSystemScheme, "view-source", "javascript", "chrome", "chrome-ui",
20 }; 23 };
21 for (size_t i = 0; i < arraysize(kKnownURLSchemes); ++i) { 24 for (size_t i = 0; i < arraysize(kKnownURLSchemes); ++i) {
22 if (scheme == kKnownURLSchemes[i]) 25 if (scheme == kKnownURLSchemes[i])
23 return metrics::OmniboxInputType::URL; 26 return metrics::OmniboxInputType::URL;
24 } 27 }
25 if (net::URLRequest::IsHandledProtocol(scheme)) 28 if (net::URLRequest::IsHandledProtocol(scheme))
26 return metrics::OmniboxInputType::URL; 29 return metrics::OmniboxInputType::URL;
27 30
28 return metrics::OmniboxInputType::INVALID; 31 return metrics::OmniboxInputType::INVALID;
29 } 32 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/suggestion_answer.cc ('k') | components/omnibox/browser/url_index_private_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698