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

Side by Side Diff: components/omnibox/browser/history_url_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/history_url_provider.h" 5 #include "components/omnibox/browser/history_url_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 // doing this (we can't just write new data for it to read due to thread 464 // doing this (we can't just write new data for it to read due to thread
465 // safety issues). At that point it's just as fast, and easier, to simply 465 // safety issues). At that point it's just as fast, and easier, to simply
466 // re-run the query from scratch and ignore |minimal_changes|. 466 // re-run the query from scratch and ignore |minimal_changes|.
467 467
468 // Cancel any in-progress query. 468 // Cancel any in-progress query.
469 Stop(false, false); 469 Stop(false, false);
470 470
471 matches_.clear(); 471 matches_.clear();
472 472
473 if (input.from_omnibox_focus() || 473 if (input.from_omnibox_focus() ||
474 (input.type() == metrics::OmniboxInputType::INVALID) || 474 (input.type() == metrics::OmniboxInputType::INVALID))
475 (input.type() == metrics::OmniboxInputType::FORCED_QUERY))
476 return; 475 return;
477 476
478 // Do some fixup on the user input before matching against it, so we provide 477 // Do some fixup on the user input before matching against it, so we provide
479 // good results for local file paths, input with spaces, etc. 478 // good results for local file paths, input with spaces, etc.
480 const FixupReturn fixup_return(FixupUserInput(input)); 479 const FixupReturn fixup_return(FixupUserInput(input));
481 if (!fixup_return.first) 480 if (!fixup_return.first)
482 return; 481 return;
483 url::Parsed parts; 482 url::Parsed parts;
484 url_formatter::SegmentURL(fixup_return.second, &parts); 483 url_formatter::SegmentURL(fixup_return.second, &parts);
485 AutocompleteInput fixed_up_input(input); 484 AutocompleteInput fixed_up_input(input);
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, 1191 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0,
1193 match.contents.length(), ACMatchClassification::URL, 1192 match.contents.length(), ACMatchClassification::URL,
1194 &match.contents_class); 1193 &match.contents_class);
1195 } 1194 }
1196 match.description = info.title(); 1195 match.description = info.title();
1197 match.description_class = 1196 match.description_class =
1198 ClassifyDescription(params.input.text(), match.description); 1197 ClassifyDescription(params.input.text(), match.description);
1199 RecordAdditionalInfoFromUrlRow(info, &match); 1198 RecordAdditionalInfoFromUrlRow(info, &match);
1200 return match; 1199 return match;
1201 } 1200 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/history_quick_provider.cc ('k') | components/omnibox/browser/keyword_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698