| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_CUSTOM_DICTIONARY_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_CUSTOM_DICTIONARY_H_ |
| 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_CUSTOM_DICTIONARY_H_ | 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_CUSTOM_DICTIONARY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Removes |observer| to stop notifications of dictionary events and changes. | 99 // Removes |observer| to stop notifications of dictionary events and changes. |
| 100 void RemoveObserver(Observer* observer); | 100 void RemoveObserver(Observer* observer); |
| 101 | 101 |
| 102 // Returns true if the dictionary has been loaded. Otherwise returns false. | 102 // Returns true if the dictionary has been loaded. Otherwise returns false. |
| 103 bool IsLoaded(); | 103 bool IsLoaded(); |
| 104 | 104 |
| 105 // Returns true if the dictionary is being synced. Otherwise returns false. | 105 // Returns true if the dictionary is being synced. Otherwise returns false. |
| 106 bool IsSyncing(); | 106 bool IsSyncing(); |
| 107 | 107 |
| 108 // Overridden from SpellcheckDictionary: | 108 // Overridden from SpellcheckDictionary: |
| 109 virtual void Load() OVERRIDE; | 109 virtual void Load() override; |
| 110 | 110 |
| 111 // Overridden from syncer::SyncableService: | 111 // Overridden from syncer::SyncableService: |
| 112 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( | 112 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( |
| 113 syncer::ModelType type, | 113 syncer::ModelType type, |
| 114 const syncer::SyncDataList& initial_sync_data, | 114 const syncer::SyncDataList& initial_sync_data, |
| 115 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 115 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 116 scoped_ptr<syncer::SyncErrorFactory> sync_error_handler) OVERRIDE; | 116 scoped_ptr<syncer::SyncErrorFactory> sync_error_handler) override; |
| 117 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; | 117 virtual void StopSyncing(syncer::ModelType type) override; |
| 118 virtual syncer::SyncDataList GetAllSyncData( | 118 virtual syncer::SyncDataList GetAllSyncData( |
| 119 syncer::ModelType type) const OVERRIDE; | 119 syncer::ModelType type) const override; |
| 120 virtual syncer::SyncError ProcessSyncChanges( | 120 virtual syncer::SyncError ProcessSyncChanges( |
| 121 const tracked_objects::Location& from_here, | 121 const tracked_objects::Location& from_here, |
| 122 const syncer::SyncChangeList& change_list) OVERRIDE; | 122 const syncer::SyncChangeList& change_list) override; |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 friend class DictionarySyncIntegrationTestHelper; | 125 friend class DictionarySyncIntegrationTestHelper; |
| 126 friend class SpellcheckCustomDictionaryTest; | 126 friend class SpellcheckCustomDictionaryTest; |
| 127 | 127 |
| 128 // Returns the list of words in the custom spellcheck dictionary at |path|. | 128 // Returns the list of words in the custom spellcheck dictionary at |path|. |
| 129 // Makes sure that the custom dictionary file does not have duplicates and | 129 // Makes sure that the custom dictionary file does not have duplicates and |
| 130 // contains only valid words. | 130 // contains only valid words. |
| 131 static chrome::spellcheck_common::WordList LoadDictionaryFile( | 131 static chrome::spellcheck_common::WordList LoadDictionaryFile( |
| 132 const base::FilePath& path); | 132 const base::FilePath& path); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // True if the dictionary has been loaded. Otherwise false. | 178 // True if the dictionary has been loaded. Otherwise false. |
| 179 bool is_loaded_; | 179 bool is_loaded_; |
| 180 | 180 |
| 181 // Used to create weak pointers for an instance of this class. | 181 // Used to create weak pointers for an instance of this class. |
| 182 base::WeakPtrFactory<SpellcheckCustomDictionary> weak_ptr_factory_; | 182 base::WeakPtrFactory<SpellcheckCustomDictionary> weak_ptr_factory_; |
| 183 | 183 |
| 184 DISALLOW_COPY_AND_ASSIGN(SpellcheckCustomDictionary); | 184 DISALLOW_COPY_AND_ASSIGN(SpellcheckCustomDictionary); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_CUSTOM_DICTIONARY_H_ | 187 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_CUSTOM_DICTIONARY_H_ |
| OLD | NEW |