OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 FilePath GetFirstChoiceFilePath(const std::string& language) { | 28 FilePath GetFirstChoiceFilePath(const std::string& language) { |
29 FilePath dict_dir; | 29 FilePath dict_dir; |
30 PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir); | 30 PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir); |
31 return SpellCheckCommon::GetVersionedFileName(language, dict_dir); | 31 return SpellCheckCommon::GetVersionedFileName(language, dict_dir); |
32 } | 32 } |
33 | 33 |
34 #if defined(OS_WIN) | |
Evan Martin
2010/09/21 18:52:20
this one too
| |
34 FilePath GetFallbackFilePath(const FilePath& first_choice) { | 35 FilePath GetFallbackFilePath(const FilePath& first_choice) { |
35 FilePath dict_dir; | 36 FilePath dict_dir; |
36 PathService::Get(chrome::DIR_USER_DATA, &dict_dir); | 37 PathService::Get(chrome::DIR_USER_DATA, &dict_dir); |
37 return dict_dir.Append(first_choice.BaseName()); | 38 return dict_dir.Append(first_choice.BaseName()); |
38 } | 39 } |
40 #endif | |
39 | 41 |
40 } // namespace | 42 } // namespace |
41 | 43 |
42 // Constructed on UI thread. | 44 // Constructed on UI thread. |
43 SpellCheckHost::SpellCheckHost(SpellCheckHostObserver* observer, | 45 SpellCheckHost::SpellCheckHost(SpellCheckHostObserver* observer, |
44 const std::string& language, | 46 const std::string& language, |
45 URLRequestContextGetter* request_context_getter) | 47 URLRequestContextGetter* request_context_getter) |
46 : observer_(observer), | 48 : observer_(observer), |
47 language_(language), | 49 language_(language), |
48 file_(base::kInvalidPlatformFileValue), | 50 file_(base::kInvalidPlatformFileValue), |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, | 301 ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, |
300 NewRunnableMethod(this, | 302 NewRunnableMethod(this, |
301 &SpellCheckHost::InformObserverOfInitialization)); | 303 &SpellCheckHost::InformObserverOfInitialization)); |
302 return; | 304 return; |
303 } | 305 } |
304 } | 306 } |
305 | 307 |
306 data_.clear(); | 308 data_.clear(); |
307 Initialize(); | 309 Initialize(); |
308 } | 310 } |
OLD | NEW |