| Index: chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
|
| diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
|
| index 3a06283d748605bf08b2df6186dbd9ef87d3dd00..984a275338c64046ef9362042d5c613d33c6a861 100644
|
| --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
|
| +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
|
| @@ -14,9 +14,8 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| -#include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
|
| -#include "chrome/common/chrome_constants.h"
|
| -#include "chrome/common/spellcheck_common.h"
|
| +#include "components/spellcheck/browser/spellcheck_host_metrics.h"
|
| +#include "components/spellcheck/common/spellcheck_common.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "sync/api/sync_change.h"
|
| #include "sync/api/sync_error_factory.h"
|
| @@ -83,7 +82,7 @@ bool IsValidWord(const std::string& word) {
|
| std::string tmp;
|
| return !word.empty() &&
|
| word.size() <=
|
| - chrome::spellcheck_common::MAX_CUSTOM_DICTIONARY_WORD_BYTES &&
|
| + spellcheck_common::MAX_CUSTOM_DICTIONARY_WORD_BYTES &&
|
| base::IsStringUTF8(word) &&
|
| base::TRIM_NONE ==
|
| base::TrimWhitespaceASCII(word, base::TRIM_ALL, &tmp);
|
| @@ -178,6 +177,9 @@ int SanitizeWordsToRemove(const std::set<std::string>& existing,
|
|
|
| } // namespace
|
|
|
| +const base::FilePath::CharType SpellcheckCustomDictionary::kCustomDictionaryFileName[] =
|
| + FILE_PATH_LITERAL("Custom Dictionary.txt");
|
| +
|
| SpellcheckCustomDictionary::Change::Change() {
|
| }
|
|
|
| @@ -210,7 +212,7 @@ int SpellcheckCustomDictionary::Change::Sanitize(
|
| SpellcheckCustomDictionary::SpellcheckCustomDictionary(
|
| const base::FilePath& dictionary_directory_name)
|
| : custom_dictionary_path_(
|
| - dictionary_directory_name.Append(chrome::kCustomDictionaryFileName)),
|
| + dictionary_directory_name.Append(kCustomDictionaryFileName)),
|
| is_loaded_(false),
|
| weak_ptr_factory_(this) {
|
| }
|
| @@ -336,7 +338,7 @@ syncer::SyncDataList SpellcheckCustomDictionary::GetAllSyncData(
|
| syncer::SyncDataList data;
|
| size_t i = 0;
|
| for (const auto& word : words_) {
|
| - if (i++ >= chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS)
|
| + if (i++ >= spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS)
|
| break;
|
| sync_pb::EntitySpecifics specifics;
|
| specifics.mutable_dictionary()->set_word(word);
|
| @@ -479,7 +481,7 @@ syncer::SyncError SpellcheckCustomDictionary::Sync(
|
| int max_upload_size = std::max(
|
| 0,
|
| static_cast<int>(
|
| - chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS) -
|
| + spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS) -
|
| server_size);
|
| int upload_size = std::min(
|
| static_cast<int>(dictionary_change.to_add().size()),
|
| @@ -514,7 +516,7 @@ syncer::SyncError SpellcheckCustomDictionary::Sync(
|
|
|
| // Turn off syncing of this dictionary if the server already has the maximum
|
| // number of words.
|
| - if (words_.size() > chrome::spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS)
|
| + if (words_.size() > spellcheck_common::MAX_SYNCABLE_DICTIONARY_WORDS)
|
| StopSyncing(syncer::DICTIONARY);
|
|
|
| return error;
|
|
|