summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-09 21:26:42 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-09 21:26:42 +0000
commite0b231d3878b5351b1e643a2d746b733e3a5e13d (patch)
tree8c4ee545feb929fe2898d3424e335e81ce7d5daf /chrome/browser/search_engines
parent2c6b521e275b8145e2546fb12404aceaed60cbcb (diff)
downloadchromium_src-e0b231d3878b5351b1e643a2d746b733e3a5e13d.zip
chromium_src-e0b231d3878b5351b1e643a2d746b733e3a5e13d.tar.gz
chromium_src-e0b231d3878b5351b1e643a2d746b733e3a5e13d.tar.bz2
Makes autocompleting previous search terms work on word boundaries.
BUG=80057 TEST=covered by unit tests, but see bugs for details. R=pkasting@chromium.org Review URL: http://codereview.chromium.org/6893140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r--chrome/browser/search_engines/template_url_model.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc
index 75886a3..e251da6 100644
--- a/chrome/browser/search_engines/template_url_model.cc
+++ b/chrome/browser/search_engines/template_url_model.cc
@@ -10,6 +10,7 @@
#include "base/stl_util-inl.h"
#include "base/string_number_conversions.h"
#include "base/string_split.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/google/google_url_tracker.h"
@@ -155,6 +156,7 @@ string16 TemplateURLModel::GenerateKeyword(const GURL& url,
string16 TemplateURLModel::CleanUserInputKeyword(const string16& keyword) {
// Remove the scheme.
string16 result(base::i18n::ToLower(keyword));
+ TrimWhitespace(result, TRIM_ALL, &result);
url_parse::Component scheme_component;
if (url_parse::ExtractScheme(UTF16ToUTF8(keyword).c_str(),
static_cast<int>(keyword.length()),