OLD | NEW |
1 // Copyright (c) 2009 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_SPELLCHECK_HOST_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECK_HOST_H_ |
6 #define CHROME_BROWSER_SPELLCHECK_HOST_H_ | 6 #define CHROME_BROWSER_SPELLCHECK_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // If |bdict_file_| is missing, we attempt to download it. | 82 // If |bdict_file_| is missing, we attempt to download it. |
83 void DownloadDictionary(); | 83 void DownloadDictionary(); |
84 | 84 |
85 // Write a custom dictionary addition to disk. | 85 // Write a custom dictionary addition to disk. |
86 void WriteWordToCustomDictionary(const std::string& word); | 86 void WriteWordToCustomDictionary(const std::string& word); |
87 | 87 |
88 // URLFetcher::Delegate implementation. Called when we finish downloading the | 88 // URLFetcher::Delegate implementation. Called when we finish downloading the |
89 // spellcheck dictionary; saves the dictionary to |data_|. | 89 // spellcheck dictionary; saves the dictionary to |data_|. |
90 virtual void OnURLFetchComplete(const URLFetcher* source, | 90 virtual void OnURLFetchComplete(const URLFetcher* source, |
91 const GURL& url, | 91 const GURL& url, |
92 const URLRequestStatus& status, | 92 const net::URLRequestStatus& status, |
93 int response_code, | 93 int response_code, |
94 const ResponseCookies& cookies, | 94 const ResponseCookies& cookies, |
95 const std::string& data); | 95 const std::string& data); |
96 | 96 |
97 // Saves |data_| to disk. Run on the file thread. | 97 // Saves |data_| to disk. Run on the file thread. |
98 void SaveDictionaryData(); | 98 void SaveDictionaryData(); |
99 | 99 |
100 // May be NULL. | 100 // May be NULL. |
101 SpellCheckHostObserver* observer_; | 101 SpellCheckHostObserver* observer_; |
102 | 102 |
(...skipping 24 matching lines...) Expand all Loading... |
127 | 127 |
128 // Used for downloading the dictionary file. We don't hold a reference, and | 128 // Used for downloading the dictionary file. We don't hold a reference, and |
129 // it is only valid to use it on the UI thread. | 129 // it is only valid to use it on the UI thread. |
130 URLRequestContextGetter* request_context_getter_; | 130 URLRequestContextGetter* request_context_getter_; |
131 | 131 |
132 // Used for downloading the dictionary file. | 132 // Used for downloading the dictionary file. |
133 scoped_ptr<URLFetcher> fetcher_; | 133 scoped_ptr<URLFetcher> fetcher_; |
134 }; | 134 }; |
135 | 135 |
136 #endif // CHROME_BROWSER_SPELLCHECK_HOST_H_ | 136 #endif // CHROME_BROWSER_SPELLCHECK_HOST_H_ |
OLD | NEW |