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_service.h" | 5 #include "chrome/browser/spellchecker/spellcheck_service.h" |
6 | 6 |
7 #include "base/platform_file.h" | 7 #include "base/platform_file.h" |
| 8 #include "base/prefs/pref_service.h" |
8 #include "base/prefs/public/pref_member.h" | 9 #include "base/prefs/public/pref_member.h" |
9 #include "base/string_split.h" | 10 #include "base/string_split.h" |
10 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
11 #include "chrome/browser/prefs/pref_service.h" | |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 13 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
14 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 14 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
15 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" | 15 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" |
16 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" | 16 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
18 #include "chrome/common/spellcheck_messages.h" | 18 #include "chrome/common/spellcheck_messages.h" |
19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
21 #include "content/public/browser/notification_types.h" | 21 #include "content/public/browser/notification_types.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void SpellcheckService::OnSpellCheckDictionaryChanged() { | 267 void SpellcheckService::OnSpellCheckDictionaryChanged() { |
268 if (hunspell_dictionary_.get()) | 268 if (hunspell_dictionary_.get()) |
269 hunspell_dictionary_->RemoveObserver(this); | 269 hunspell_dictionary_->RemoveObserver(this); |
270 hunspell_dictionary_.reset(new SpellcheckHunspellDictionary( | 270 hunspell_dictionary_.reset(new SpellcheckHunspellDictionary( |
271 profile_->GetPrefs()->GetString(prefs::kSpellCheckDictionary), | 271 profile_->GetPrefs()->GetString(prefs::kSpellCheckDictionary), |
272 profile_->GetRequestContext(), | 272 profile_->GetRequestContext(), |
273 this)); | 273 this)); |
274 hunspell_dictionary_->AddObserver(this); | 274 hunspell_dictionary_->AddObserver(this); |
275 hunspell_dictionary_->Load(); | 275 hunspell_dictionary_->Load(); |
276 } | 276 } |
OLD | NEW |