OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/spellcheck_host.h" | 5 #include "chrome/browser/spellcheck_host.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 | 226 |
227 if (!request_context_getter_) { | 227 if (!request_context_getter_) { |
228 InitializeOnFileThread(); | 228 InitializeOnFileThread(); |
229 return; | 229 return; |
230 } | 230 } |
231 | 231 |
232 // Determine URL of file to download. | 232 // Determine URL of file to download. |
233 static const char kDownloadServerUrl[] = | 233 static const char kDownloadServerUrl[] = |
234 "http://cache.pack.google.com/edgedl/chrome/dict/"; | 234 "http://cache.pack.google.com/edgedl/chrome/dict/"; |
235 GURL url = GURL(std::string(kDownloadServerUrl) + | 235 GURL url = GURL(std::string(kDownloadServerUrl) + |
236 StringToLowerASCII(WideToUTF8( | 236 StringToLowerASCII(UTF16ToUTF8( |
237 bdict_file_path_.BaseName().ToWStringHack()))); | 237 bdict_file_path_.BaseName().LossyDisplayName()))); |
Avi (use Gerrit)
2011/02/01 22:46:25
Whoa. LossyDisplayName is for display, not as a ge
| |
238 fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this)); | 238 fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this)); |
239 fetcher_->set_request_context(request_context_getter_); | 239 fetcher_->set_request_context(request_context_getter_); |
240 tried_to_download_ = true; | 240 tried_to_download_ = true; |
241 fetcher_->Start(); | 241 fetcher_->Start(); |
242 request_context_getter_ = NULL; | 242 request_context_getter_ = NULL; |
243 } | 243 } |
244 | 244 |
245 void SpellCheckHost::WriteWordToCustomDictionary(const std::string& word) { | 245 void SpellCheckHost::WriteWordToCustomDictionary(const std::string& word) { |
246 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 246 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
247 | 247 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 320 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
321 NewRunnableMethod(this, | 321 NewRunnableMethod(this, |
322 &SpellCheckHost::InformObserverOfInitialization)); | 322 &SpellCheckHost::InformObserverOfInitialization)); |
323 return; | 323 return; |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 data_.clear(); | 327 data_.clear(); |
328 Initialize(); | 328 Initialize(); |
329 } | 329 } |
OLD | NEW |