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 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" | 5 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/memory_mapped_file.h" | 8 #include "base/files/memory_mapped_file.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 FROM_HERE, | 207 FROM_HERE, |
208 base::Bind(&SaveDictionaryData, | 208 base::Bind(&SaveDictionaryData, |
209 base::Passed(&data), | 209 base::Passed(&data), |
210 dictionary_file_.path), | 210 dictionary_file_.path), |
211 base::Bind(&SpellcheckHunspellDictionary::SaveDictionaryDataComplete, | 211 base::Bind(&SpellcheckHunspellDictionary::SaveDictionaryDataComplete, |
212 weak_ptr_factory_.GetWeakPtr())); | 212 weak_ptr_factory_.GetWeakPtr())); |
213 } | 213 } |
214 | 214 |
215 GURL SpellcheckHunspellDictionary::GetDictionaryURL() { | 215 GURL SpellcheckHunspellDictionary::GetDictionaryURL() { |
216 static const char kDownloadServerUrl[] = | 216 static const char kDownloadServerUrl[] = |
217 "http://cache.pack.google.com/edgedl/chrome/dict/"; | 217 "https://redirector.gvt1.com/edgedl/chrome/dict/"; |
218 std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII(); | 218 std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII(); |
219 | 219 |
220 DCHECK(!bdict_file.empty()); | 220 DCHECK(!bdict_file.empty()); |
221 | 221 |
222 return GURL(std::string(kDownloadServerUrl) + | 222 return GURL(std::string(kDownloadServerUrl) + |
223 base::StringToLowerASCII(bdict_file)); | 223 base::StringToLowerASCII(bdict_file)); |
224 } | 224 } |
225 | 225 |
226 void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) { | 226 void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) { |
227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 void SpellcheckHunspellDictionary::InformListenersOfInitialization() { | 348 void SpellcheckHunspellDictionary::InformListenersOfInitialization() { |
349 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryInitialized()); | 349 FOR_EACH_OBSERVER(Observer, observers_, OnHunspellDictionaryInitialized()); |
350 } | 350 } |
351 | 351 |
352 void SpellcheckHunspellDictionary::InformListenersOfDownloadFailure() { | 352 void SpellcheckHunspellDictionary::InformListenersOfDownloadFailure() { |
353 download_status_ = DOWNLOAD_FAILED; | 353 download_status_ = DOWNLOAD_FAILED; |
354 FOR_EACH_OBSERVER(Observer, | 354 FOR_EACH_OBSERVER(Observer, |
355 observers_, | 355 observers_, |
356 OnHunspellDictionaryDownloadFailure()); | 356 OnHunspellDictionaryDownloadFailure()); |
357 } | 357 } |
OLD | NEW |