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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 base::SPLIT_WANT_NONEMPTY)); | 125 base::SPLIT_WANT_NONEMPTY)); |
126 prefs_->Set(spellcheck::prefs::kSpellCheckDictionaries, dictionaries_value); | 126 prefs_->Set(spellcheck::prefs::kSpellCheckDictionaries, dictionaries_value); |
127 } | 127 } |
128 | 128 |
129 std::string GetMultilingualDictionaries() { | 129 std::string GetMultilingualDictionaries() { |
130 const base::ListValue* list_value = | 130 const base::ListValue* list_value = |
131 prefs_->GetList(spellcheck::prefs::kSpellCheckDictionaries); | 131 prefs_->GetList(spellcheck::prefs::kSpellCheckDictionaries); |
132 std::vector<std::string> dictionaries; | 132 std::vector<std::string> dictionaries; |
133 for (const auto& item_value : *list_value) { | 133 for (const auto& item_value : *list_value) { |
134 std::string dictionary; | 134 std::string dictionary; |
135 EXPECT_TRUE(item_value->GetAsString(&dictionary)); | 135 EXPECT_TRUE(item_value.GetAsString(&dictionary)); |
136 dictionaries.push_back(dictionary); | 136 dictionaries.push_back(dictionary); |
137 } | 137 } |
138 return base::JoinString(dictionaries, ","); | 138 return base::JoinString(dictionaries, ","); |
139 } | 139 } |
140 | 140 |
141 void SetAcceptLanguages(const std::string& accept_languages) { | 141 void SetAcceptLanguages(const std::string& accept_languages) { |
142 ScopedPreferenceChange scope(&renderer_->sink()); | 142 ScopedPreferenceChange scope(&renderer_->sink()); |
143 prefs_->SetString(prefs::kAcceptLanguages, accept_languages); | 143 prefs_->SetString(prefs::kAcceptLanguages, accept_languages); |
144 } | 144 } |
145 | 145 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 std::string pref; | 392 std::string pref; |
393 ASSERT_TRUE(GetPrefs() | 393 ASSERT_TRUE(GetPrefs() |
394 ->GetList(spellcheck::prefs::kSpellCheckDictionaries) | 394 ->GetList(spellcheck::prefs::kSpellCheckDictionaries) |
395 ->GetString(0, &pref)); | 395 ->GetString(0, &pref)); |
396 EXPECT_EQ("en-US", pref); | 396 EXPECT_EQ("en-US", pref); |
397 ASSERT_TRUE(GetPrefs() | 397 ASSERT_TRUE(GetPrefs() |
398 ->GetList(spellcheck::prefs::kSpellCheckDictionaries) | 398 ->GetList(spellcheck::prefs::kSpellCheckDictionaries) |
399 ->GetString(1, &pref)); | 399 ->GetString(1, &pref)); |
400 EXPECT_EQ("fr", pref); | 400 EXPECT_EQ("fr", pref); |
401 } | 401 } |
OLD | NEW |