OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/omnibox/browser/builtin_provider.h" | 5 #include "components/omnibox/browser/builtin_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 : AutocompleteProvider(AutocompleteProvider::TYPE_BUILTIN), | 22 : AutocompleteProvider(AutocompleteProvider::TYPE_BUILTIN), |
23 client_(client) { | 23 client_(client) { |
24 builtins_ = client_->GetBuiltinURLs(); | 24 builtins_ = client_->GetBuiltinURLs(); |
25 } | 25 } |
26 | 26 |
27 void BuiltinProvider::Start(const AutocompleteInput& input, | 27 void BuiltinProvider::Start(const AutocompleteInput& input, |
28 bool minimal_changes) { | 28 bool minimal_changes) { |
29 matches_.clear(); | 29 matches_.clear(); |
30 if (input.from_omnibox_focus() || | 30 if (input.from_omnibox_focus() || |
31 (input.type() == metrics::OmniboxInputType::INVALID) || | 31 (input.type() == metrics::OmniboxInputType::INVALID) || |
32 (input.type() == metrics::OmniboxInputType::FORCED_QUERY) || | |
33 (input.type() == metrics::OmniboxInputType::QUERY)) | 32 (input.type() == metrics::OmniboxInputType::QUERY)) |
34 return; | 33 return; |
35 | 34 |
36 const size_t kAboutSchemeLength = strlen(url::kAboutScheme); | 35 const size_t kAboutSchemeLength = strlen(url::kAboutScheme); |
37 const base::string16 kAbout = | 36 const base::string16 kAbout = |
38 base::ASCIIToUTF16(url::kAboutScheme) + | 37 base::ASCIIToUTF16(url::kAboutScheme) + |
39 base::ASCIIToUTF16(url::kStandardSchemeSeparator); | 38 base::ASCIIToUTF16(url::kStandardSchemeSeparator); |
40 const base::string16 embedderAbout = | 39 const base::string16 embedderAbout = |
41 base::UTF8ToUTF16(client_->GetEmbedderRepresentationOfAboutScheme()) + | 40 base::UTF8ToUTF16(client_->GetEmbedderRepresentationOfAboutScheme()) + |
42 base::ASCIIToUTF16(url::kStandardSchemeSeparator); | 41 base::ASCIIToUTF16(url::kStandardSchemeSeparator); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 const ACMatchClassifications& styles) { | 139 const ACMatchClassifications& styles) { |
141 AutocompleteMatch match(this, kRelevance, false, | 140 AutocompleteMatch match(this, kRelevance, false, |
142 AutocompleteMatchType::NAVSUGGEST); | 141 AutocompleteMatchType::NAVSUGGEST); |
143 match.fill_into_edit = match_string; | 142 match.fill_into_edit = match_string; |
144 match.inline_autocompletion = inline_completion; | 143 match.inline_autocompletion = inline_completion; |
145 match.destination_url = GURL(match_string); | 144 match.destination_url = GURL(match_string); |
146 match.contents = match_string; | 145 match.contents = match_string; |
147 match.contents_class = styles; | 146 match.contents_class = styles; |
148 matches_.push_back(match); | 147 matches_.push_back(match); |
149 } | 148 } |
OLD | NEW |