OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ui/webui/options/multilanguage_options_browsertest.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/command_line.h" | |
10 #include "build/build_config.h" | |
11 #include "chrome/browser/ui/browser_window.h" | |
12 #include "chrome/common/chrome_switches.h" | |
13 #include "chrome/common/pref_names.h" | |
14 #include "components/prefs/pref_service.h" | |
15 #include "components/spellcheck/browser/pref_names.h" | |
16 | |
17 MultilanguageOptionsBrowserTest::MultilanguageOptionsBrowserTest() { | |
18 } | |
19 | |
20 MultilanguageOptionsBrowserTest::~MultilanguageOptionsBrowserTest() { | |
21 } | |
22 | |
23 void MultilanguageOptionsBrowserTest::ClearSpellcheckDictionaries() { | |
24 SetDictionariesPref(base::ListValue()); | |
25 } | |
26 | |
27 void MultilanguageOptionsBrowserTest::SetUpOnMainThread() { | |
28 WebUIBrowserTest::SetUpOnMainThread(); | |
29 #if defined(OS_CHROMEOS) | |
30 std::string setting_name = prefs::kLanguagePreferredLanguages; | |
31 #else | |
32 std::string setting_name = prefs::kAcceptLanguages; | |
33 #endif | |
34 | |
35 PrefService* pref_service = browser()->profile()->GetPrefs(); | |
36 pref_service->SetString(setting_name, "fr,es,de,en"); | |
37 base::ListValue dictionaries; | |
38 dictionaries.AppendString("fr"); | |
39 SetDictionariesPref(dictionaries); | |
40 pref_service->SetString(spellcheck::prefs::kSpellCheckDictionary, | |
41 std::string()); | |
42 } | |
43 | |
44 void MultilanguageOptionsBrowserTest::SetDictionariesPref( | |
45 const base::ListValue& value) { | |
46 browser()->profile()->GetPrefs()->Set( | |
47 spellcheck::prefs::kSpellCheckDictionaries, value); | |
48 } | |
OLD | NEW |