| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // Returns a metrics counter associated with this object, | 98 // Returns a metrics counter associated with this object, |
| 99 // or null when metrics recording is disabled. | 99 // or null when metrics recording is disabled. |
| 100 virtual SpellCheckHostMetrics* GetMetrics() const; | 100 virtual SpellCheckHostMetrics* GetMetrics() const; |
| 101 | 101 |
| 102 // Returns true if the dictionary is ready to use. | 102 // Returns true if the dictionary is ready to use. |
| 103 virtual bool IsReady() const; | 103 virtual bool IsReady() const; |
| 104 | 104 |
| 105 // content::URLFetcherDelegate implementation. Called when we finish | 105 // content::URLFetcherDelegate implementation. Called when we finish |
| 106 // downloading the spellcheck dictionary; saves the dictionary to |data_|. | 106 // downloading the spellcheck dictionary; saves the dictionary to |data_|. |
| 107 virtual void OnURLFetchComplete(const URLFetcher* source); | 107 virtual void OnURLFetchComplete(const content::URLFetcher* source); |
| 108 | 108 |
| 109 // NotificationProfile implementation. | 109 // NotificationProfile implementation. |
| 110 virtual void Observe(int type, | 110 virtual void Observe(int type, |
| 111 const content::NotificationSource& source, | 111 const content::NotificationSource& source, |
| 112 const content::NotificationDetails& details); | 112 const content::NotificationDetails& details); |
| 113 | 113 |
| 114 // Saves |data_| to disk. Run on the file thread. | 114 // Saves |data_| to disk. Run on the file thread. |
| 115 void SaveDictionaryData(); | 115 void SaveDictionaryData(); |
| 116 | 116 |
| 117 // Verifies the specified BDict file exists and it is sane. This function | 117 // Verifies the specified BDict file exists and it is sane. This function |
| (...skipping 24 matching lines...) Expand all Loading... |
| 142 bool use_platform_spellchecker_; | 142 bool use_platform_spellchecker_; |
| 143 | 143 |
| 144 // Data received from the dictionary download. | 144 // Data received from the dictionary download. |
| 145 std::string data_; | 145 std::string data_; |
| 146 | 146 |
| 147 // Used for downloading the dictionary file. We don't hold a reference, and | 147 // Used for downloading the dictionary file. We don't hold a reference, and |
| 148 // it is only valid to use it on the UI thread. | 148 // it is only valid to use it on the UI thread. |
| 149 net::URLRequestContextGetter* request_context_getter_; | 149 net::URLRequestContextGetter* request_context_getter_; |
| 150 | 150 |
| 151 // Used for downloading the dictionary file. | 151 // Used for downloading the dictionary file. |
| 152 scoped_ptr<URLFetcher> fetcher_; | 152 scoped_ptr<content::URLFetcher> fetcher_; |
| 153 | 153 |
| 154 content::NotificationRegistrar registrar_; | 154 content::NotificationRegistrar registrar_; |
| 155 | 155 |
| 156 // An optional metrics counter given by the constructor. | 156 // An optional metrics counter given by the constructor. |
| 157 SpellCheckHostMetrics* metrics_; | 157 SpellCheckHostMetrics* metrics_; |
| 158 | 158 |
| 159 DISALLOW_COPY_AND_ASSIGN(SpellCheckHostImpl); | 159 DISALLOW_COPY_AND_ASSIGN(SpellCheckHostImpl); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ | 162 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_ |
| OLD | NEW |