| Index: chrome/browser/autocomplete/shortcuts_provider.cc
|
| diff --git a/chrome/browser/autocomplete/shortcuts_provider.cc b/chrome/browser/autocomplete/shortcuts_provider.cc
|
| index 8ead62e723d8dad0cccf6424efd8abfcb4feb7df..5f54dd97d72cb8ded68993a9b66866f405baffc1 100644
|
| --- a/chrome/browser/autocomplete/shortcuts_provider.cc
|
| +++ b/chrome/browser/autocomplete/shortcuts_provider.cc
|
| @@ -15,6 +15,7 @@
|
| #include "base/metrics/histogram.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "base/strings/string_number_conversions.h"
|
| +#include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/time/time.h"
|
| @@ -143,6 +144,8 @@ void ShortcutsProvider::GetMatches(const AutocompleteInput& input) {
|
| TemplateURLService* template_url_service =
|
| TemplateURLServiceFactory::GetForProfile(profile_);
|
| const base::string16 fixed_up_input(FixupUserInput(input).second);
|
| + std::vector<base::string16> words;
|
| + base::SplitString(input.text(), ' ', &words);
|
| for (ShortcutsBackend::ShortcutMap::const_iterator it =
|
| FindFirstMatch(term_string, backend.get());
|
| it != backend->shortcuts_map().end() &&
|
| @@ -151,8 +154,9 @@ void ShortcutsProvider::GetMatches(const AutocompleteInput& input) {
|
| int relevance = CalculateScore(term_string, it->second, max_relevance);
|
| if (relevance) {
|
| matches_.push_back(ShortcutToACMatch(it->second, relevance, input,
|
| - fixed_up_input));
|
| - matches_.back().ComputeStrippedDestinationURL(template_url_service);
|
| + fixed_up_input, words));
|
| + matches_.back().ComputeStrippedDestinationURL(words,
|
| + template_url_service);
|
| }
|
| }
|
| // Remove duplicates. Duplicates don't need to be preserved in the matches
|
| @@ -183,7 +187,8 @@ AutocompleteMatch ShortcutsProvider::ShortcutToACMatch(
|
| const ShortcutsDatabase::Shortcut& shortcut,
|
| int relevance,
|
| const AutocompleteInput& input,
|
| - const base::string16& fixed_up_input_text) {
|
| + const base::string16& fixed_up_input_text,
|
| + const std::vector<base::string16>& words) {
|
| DCHECK(!input.text().empty());
|
| AutocompleteMatch match;
|
| match.provider = this;
|
| @@ -236,7 +241,7 @@ AutocompleteMatch ShortcutsProvider::ShortcutToACMatch(
|
| }
|
| }
|
| match.EnsureUWYTIsAllowedToBeDefault(
|
| - input.canonicalized_url(),
|
| + input.canonicalized_url(), words,
|
| TemplateURLServiceFactory::GetForProfile(profile_));
|
|
|
| // Try to mark pieces of the contents and description as matches if they
|
|
|