summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc')
-rw-r--r--chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
index e13aca7c190..b7ec88c0c17 100644
--- a/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
+++ b/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
@@ -19,12 +19,21 @@
#include "base/task_runner_util.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_restrictions.h"
+#ifndef TOOLKIT_QT
#include "chrome/common/chrome_constants.h"
+#endif
#include "components/spellcheck/browser/spellcheck_host_metrics.h"
#include "components/spellcheck/common/spellcheck_common.h"
+#ifndef TOOLKIT_QT
#include "components/sync/model/sync_change.h"
#include "components/sync/model/sync_error_factory.h"
#include "components/sync/protocol/sync.pb.h"
+#else
+#include "base/stl_util.h"
+namespace chrome {
+ const base::FilePath::CharType kCustomDictionaryFileName[] = FILE_PATH_LITERAL("Custom Dictionary.txt");
+}
+#endif
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
@@ -235,7 +244,9 @@ bool SpellcheckCustomDictionary::AddWord(const std::string& word) {
int result = dictionary_change->Sanitize(GetWords());
Apply(*dictionary_change);
Notify(*dictionary_change);
+#ifndef TOOLKIT_QT
Sync(*dictionary_change);
+#endif
Save(std::move(dictionary_change));
return result == VALID_CHANGE;
}
@@ -247,7 +258,9 @@ bool SpellcheckCustomDictionary::RemoveWord(const std::string& word) {
int result = dictionary_change->Sanitize(GetWords());
Apply(*dictionary_change);
Notify(*dictionary_change);
+#ifndef TOOLKIT_QT
Sync(*dictionary_change);
+#endif
Save(std::move(dictionary_change));
return result == VALID_CHANGE;
}
@@ -273,10 +286,12 @@ bool SpellcheckCustomDictionary::IsLoaded() {
return is_loaded_;
}
+#ifndef TOOLKIT_QT
bool SpellcheckCustomDictionary::IsSyncing() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return !!sync_processor_.get();
}
+#endif
void SpellcheckCustomDictionary::Load() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -288,6 +303,7 @@ void SpellcheckCustomDictionary::Load() {
weak_ptr_factory_.GetWeakPtr()));
}
+#ifndef TOOLKIT_QT
syncer::SyncMergeResult SpellcheckCustomDictionary::MergeDataAndStartSyncing(
syncer::ModelType type,
const syncer::SyncDataList& initial_sync_data,
@@ -382,6 +398,7 @@ syncer::SyncError SpellcheckCustomDictionary::ProcessSyncChanges(
return syncer::SyncError();
}
+#endif
SpellcheckCustomDictionary::LoadFileResult::LoadFileResult()
: is_valid_file(false) {}
@@ -427,7 +444,9 @@ void SpellcheckCustomDictionary::OnLoaded(
dictionary_change.AddWords(result->words);
dictionary_change.Sanitize(GetWords());
Apply(dictionary_change);
+#ifndef TOOLKIT_QT
Sync(dictionary_change);
+#endif
is_loaded_ = true;
for (Observer& observer : observers_)
observer.OnCustomDictionaryLoaded();
@@ -472,6 +491,7 @@ void SpellcheckCustomDictionary::Save(
custom_dictionary_path_));
}
+#ifndef TOOLKIT_QT
syncer::SyncError SpellcheckCustomDictionary::Sync(
const Change& dictionary_change) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -523,6 +543,7 @@ syncer::SyncError SpellcheckCustomDictionary::Sync(
return error;
}
+#endif
void SpellcheckCustomDictionary::Notify(const Change& dictionary_change) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);