| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 void SpellcheckService::LoadHunspellDictionaries() { | 219 void SpellcheckService::LoadHunspellDictionaries() { |
| 220 hunspell_dictionaries_.clear(); | 220 hunspell_dictionaries_.clear(); |
| 221 | 221 |
| 222 PrefService* prefs = user_prefs::UserPrefs::Get(context_); | 222 PrefService* prefs = user_prefs::UserPrefs::Get(context_); |
| 223 DCHECK(prefs); | 223 DCHECK(prefs); |
| 224 | 224 |
| 225 const base::ListValue* dictionary_values = | 225 const base::ListValue* dictionary_values = |
| 226 prefs->GetList(prefs::kSpellCheckDictionaries); | 226 prefs->GetList(prefs::kSpellCheckDictionaries); |
| 227 | 227 |
| 228 for (const base::Value* dictionary_value : *dictionary_values) { | 228 for (const auto& dictionary_value : *dictionary_values) { |
| 229 std::string dictionary; | 229 std::string dictionary; |
| 230 dictionary_value->GetAsString(&dictionary); | 230 dictionary_value->GetAsString(&dictionary); |
| 231 hunspell_dictionaries_.push_back(new SpellcheckHunspellDictionary( | 231 hunspell_dictionaries_.push_back(new SpellcheckHunspellDictionary( |
| 232 dictionary, | 232 dictionary, |
| 233 content::BrowserContext::GetDefaultStoragePartition(context_)-> | 233 content::BrowserContext::GetDefaultStoragePartition(context_)-> |
| 234 GetURLRequestContext(), | 234 GetURLRequestContext(), |
| 235 this)); | 235 this)); |
| 236 hunspell_dictionaries_.back()->AddObserver(this); | 236 hunspell_dictionaries_.back()->AddObserver(this); |
| 237 hunspell_dictionaries_.back()->Load(); | 237 hunspell_dictionaries_.back()->Load(); |
| 238 } | 238 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 chrome::spellcheck_common::GetISOLanguageCountryCodeFromLocale( | 378 chrome::spellcheck_common::GetISOLanguageCountryCodeFromLocale( |
| 379 feedback_language, &language_code, &country_code); | 379 feedback_language, &language_code, &country_code); |
| 380 feedback_sender_->OnLanguageCountryChange(language_code, country_code); | 380 feedback_sender_->OnLanguageCountryChange(language_code, country_code); |
| 381 if (SpellingServiceClient::IsAvailable( | 381 if (SpellingServiceClient::IsAvailable( |
| 382 context_, SpellingServiceClient::SPELLCHECK)) { | 382 context_, SpellingServiceClient::SPELLCHECK)) { |
| 383 feedback_sender_->StartFeedbackCollection(); | 383 feedback_sender_->StartFeedbackCollection(); |
| 384 } else { | 384 } else { |
| 385 feedback_sender_->StopFeedbackCollection(); | 385 feedback_sender_->StopFeedbackCollection(); |
| 386 } | 386 } |
| 387 } | 387 } |
| OLD | NEW |