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

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

Issue 1855423003: Interpret '?' and Ctrl-K or Ctrl-E as putting omnibox in keyword search mode for Default Search Pro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add includes for mac tests Created 4 years, 6 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 (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
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
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 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/bookmark_provider.cc ('k') | components/omnibox/browser/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698