diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-27 17:43:05 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-27 17:43:05 +0000 |
commit | 71572873eb78084971b4d1bdd6560f876dc2fada (patch) | |
tree | 3994daae4ff120ef2cb40ce2cc21bd927e1ce77d /chrome/browser/instant/instant_loader.cc | |
parent | 8ac4d049881d29f20676f702404902e96b254e09 (diff) | |
download | chromium_src-71572873eb78084971b4d1bdd6560f876dc2fada.zip chromium_src-71572873eb78084971b4d1bdd6560f876dc2fada.tar.gz chromium_src-71572873eb78084971b4d1bdd6560f876dc2fada.tar.bz2 |
Lands http://codereview.chromium.org/4154003/show for Timo.
BUG=59679
TEST=see bug
Review URL: http://codereview.chromium.org/4206001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant/instant_loader.cc')
-rw-r--r-- | chrome/browser/instant/instant_loader.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index 3c561b3..8313453 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -7,6 +7,7 @@ #include <algorithm> #include <utility> +#include "app/l10n_util.h" #include "base/command_line.h" #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" @@ -566,8 +567,12 @@ void InstantLoader::Update(TabContents* tab_contents, return; } SendUserInputScript(preview_contents_.get(), user_text_); - if (complete_suggested_text_.size() > user_text_.size() && - !complete_suggested_text_.compare(0, user_text_.size(), user_text_)) { + string16 complete_suggested_text_lower = l10n_util::ToLower( + complete_suggested_text_); + string16 user_text_lower = l10n_util::ToLower(user_text_); + if (complete_suggested_text_lower.size() > user_text_lower.size() && + !complete_suggested_text_lower.compare(0, user_text_lower.size(), + user_text_lower)) { *suggested_text = complete_suggested_text_.substr(user_text_.size()); } } else { @@ -678,8 +683,12 @@ void InstantLoader::SetCompleteSuggestedText( if (complete_suggested_text == complete_suggested_text_) return; - if (user_text_.compare(0, user_text_.size(), complete_suggested_text, - 0, user_text_.size())) { + string16 user_text_lower = l10n_util::ToLower(user_text_); + string16 complete_suggested_text_lower = l10n_util::ToLower( + complete_suggested_text); + if (user_text_lower.compare(0, user_text_lower.size(), + complete_suggested_text_lower, + 0, user_text_lower.size())) { // The user text no longer contains the suggested text, ignore it. complete_suggested_text_.clear(); delegate_->SetSuggestedTextFor(this, string16()); |