OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_HOST_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ |
6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ | 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void DownloadDictionary(); | 94 void DownloadDictionary(); |
95 | 95 |
96 // Loads a custom dictionary from disk. | 96 // Loads a custom dictionary from disk. |
97 void LoadCustomDictionary(CustomWordList* custom_words); | 97 void LoadCustomDictionary(CustomWordList* custom_words); |
98 | 98 |
99 // Write a custom dictionary addition to disk. | 99 // Write a custom dictionary addition to disk. |
100 void WriteWordToCustomDictionary(const std::string& word); | 100 void WriteWordToCustomDictionary(const std::string& word); |
101 | 101 |
102 // Returns a metrics counter associated with this object, | 102 // Returns a metrics counter associated with this object, |
103 // or null when metrics recording is disabled. | 103 // or null when metrics recording is disabled. |
104 virtual SpellCheckHostMetrics* GetMetrics() const; | 104 virtual SpellCheckHostMetrics* GetMetrics() const OVERRIDE; |
105 | 105 |
106 // Returns true if the dictionary is ready to use. | 106 // Returns true if the dictionary is ready to use. |
107 virtual bool IsReady() const; | 107 virtual bool IsReady() const OVERRIDE; |
108 | 108 |
109 // content::URLFetcherDelegate implementation. Called when we finish | 109 // content::URLFetcherDelegate implementation. Called when we finish |
110 // downloading the spellcheck dictionary; saves the dictionary to |data_|. | 110 // downloading the spellcheck dictionary; saves the dictionary to |data_|. |
111 virtual void OnURLFetchComplete(const content::URLFetcher* source); | 111 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; |
112 | 112 |
113 // NotificationProfile implementation. | 113 // NotificationProfile implementation. |
114 virtual void Observe(int type, | 114 virtual void Observe(int type, |
115 const content::NotificationSource& source, | 115 const content::NotificationSource& source, |
116 const content::NotificationDetails& details); | 116 const content::NotificationDetails& details) OVERRIDE; |
117 | 117 |
118 // Saves |data_| to disk. Run on the file thread. | 118 // Saves |data_| to disk. Run on the file thread. |
119 void SaveDictionaryData(); | 119 void SaveDictionaryData(); |
120 void SaveDictionaryDataComplete(); | 120 void SaveDictionaryDataComplete(); |
121 | 121 |
122 // Verifies the specified BDict file exists and it is sane. This function | 122 // Verifies the specified BDict file exists and it is sane. This function |
123 // should be called before opening the file so we can delete it and download a | 123 // should be called before opening the file so we can delete it and download a |
124 // new dictionary if it is corrupted. | 124 // new dictionary if it is corrupted. |
125 bool VerifyBDict(const FilePath& path) const; | 125 bool VerifyBDict(const FilePath& path) const; |
126 | 126 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 SpellCheckHostMetrics* metrics_; | 166 SpellCheckHostMetrics* metrics_; |
167 | 167 |
168 base::WeakPtrFactory<SpellCheckHostImpl> weak_ptr_factory_; | 168 base::WeakPtrFactory<SpellCheckHostImpl> weak_ptr_factory_; |
169 | 169 |
170 scoped_ptr<CustomWordList> custom_words_; | 170 scoped_ptr<CustomWordList> custom_words_; |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(SpellCheckHostImpl); | 172 DISALLOW_COPY_AND_ASSIGN(SpellCheckHostImpl); |
173 }; | 173 }; |
174 | 174 |
175 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ | 175 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ |
OLD | NEW |