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

Unified Diff: chrome/browser/ui/webui/options/language_dictionary_overlay_handler.cc

Issue 11434043: Remove duplicate words from custom spelling dictionary on load (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unit test Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/language_dictionary_overlay_handler.cc
diff --git a/chrome/browser/ui/webui/options/language_dictionary_overlay_handler.cc b/chrome/browser/ui/webui/options/language_dictionary_overlay_handler.cc
index d9bb1212783ac5780e3a39ccf7d4f4ee3babffb5..32a5eccc4102513733c0b6ad892d08624c657309 100644
--- a/chrome/browser/ui/webui/options/language_dictionary_overlay_handler.cc
+++ b/chrome/browser/ui/webui/options/language_dictionary_overlay_handler.cc
@@ -15,12 +15,6 @@
namespace options {
-namespace {
-bool StringCompare(const std::string& a, const std::string& b) {
- return a.compare(b) < 0;
-}
-} // namespace
-
LanguageDictionaryOverlayHandler::LanguageDictionaryOverlayHandler()
: overlay_initialized_(false),
dictionary_(NULL) {
@@ -99,10 +93,8 @@ void LanguageDictionaryOverlayHandler::ResetDictionaryWords() {
dictionary_->AddObserver(this);
}
- std::vector<std::string> words = dictionary_->GetWords();
- std::sort(words.begin(), words.end(), StringCompare);
ListValue list_value;
- list_value.AppendStrings(words);
+ list_value.AppendStrings(dictionary_->GetWords());
web_ui()->CallJavascriptFunction("EditDictionaryOverlay.setWordList",
list_value);
}
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698