Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/ui/webui/options/language_options_handler_common.cc

Issue 2177343002: Componentize spellcheck [2]: move common/ files to component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move message generator to component Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ui/webui/options/language_options_handler_common.h" 5 #include "chrome/browser/ui/webui/options/language_options_handler_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 11 matching lines...) Expand all
22 #include "build/build_config.h" 22 #include "build/build_config.h"
23 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/spellchecker/spellcheck_factory.h" 25 #include "chrome/browser/spellchecker/spellcheck_factory.h"
26 #include "chrome/browser/spellchecker/spellcheck_service.h" 26 #include "chrome/browser/spellchecker/spellcheck_service.h"
27 #include "chrome/browser/translate/chrome_translate_client.h" 27 #include "chrome/browser/translate/chrome_translate_client.h"
28 #include "chrome/browser/translate/translate_service.h" 28 #include "chrome/browser/translate/translate_service.h"
29 #include "chrome/browser/ui/browser_list.h" 29 #include "chrome/browser/ui/browser_list.h"
30 #include "chrome/common/chrome_switches.h" 30 #include "chrome/common/chrome_switches.h"
31 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
32 #include "chrome/common/spellcheck_common.h"
33 #include "chrome/grit/chromium_strings.h" 32 #include "chrome/grit/chromium_strings.h"
34 #include "chrome/grit/generated_resources.h" 33 #include "chrome/grit/generated_resources.h"
35 #include "components/prefs/pref_service.h" 34 #include "components/prefs/pref_service.h"
35 #include "components/spellcheck/common/spellcheck_common.h"
36 #include "components/translate/core/browser/translate_download_manager.h" 36 #include "components/translate/core/browser/translate_download_manager.h"
37 #include "components/translate/core/browser/translate_prefs.h" 37 #include "components/translate/core/browser/translate_prefs.h"
38 #include "content/public/browser/user_metrics.h" 38 #include "content/public/browser/user_metrics.h"
39 #include "content/public/browser/web_ui.h" 39 #include "content/public/browser/web_ui.h"
40 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
41 41
42 using base::UserMetricsAction; 42 using base::UserMetricsAction;
43 43
44 namespace options { 44 namespace options {
45 45
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 l10n_util::GetAvailableLocales(); 190 l10n_util::GetAvailableLocales();
191 for (size_t i = 0; i < available_locales.size(); ++i) 191 for (size_t i = 0; i < available_locales.size(); ++i)
192 dictionary->SetBoolean(available_locales[i], true); 192 dictionary->SetBoolean(available_locales[i], true);
193 return dictionary; 193 return dictionary;
194 } 194 }
195 195
196 base::DictionaryValue* 196 base::DictionaryValue*
197 LanguageOptionsHandlerCommon::GetSpellCheckLanguageCodeSet() { 197 LanguageOptionsHandlerCommon::GetSpellCheckLanguageCodeSet() {
198 base::DictionaryValue* dictionary = new base::DictionaryValue(); 198 base::DictionaryValue* dictionary = new base::DictionaryValue();
199 std::vector<std::string> spell_check_languages; 199 std::vector<std::string> spell_check_languages;
200 chrome::spellcheck_common::SpellCheckLanguages(&spell_check_languages); 200 spellcheck::SpellCheckLanguages(&spell_check_languages);
201 for (size_t i = 0; i < spell_check_languages.size(); ++i) { 201 for (size_t i = 0; i < spell_check_languages.size(); ++i) {
202 dictionary->SetBoolean(spell_check_languages[i], true); 202 dictionary->SetBoolean(spell_check_languages[i], true);
203 } 203 }
204 return dictionary; 204 return dictionary;
205 } 205 }
206 206
207 void LanguageOptionsHandlerCommon::LanguageOptionsOpenCallback( 207 void LanguageOptionsHandlerCommon::LanguageOptionsOpenCallback(
208 const base::ListValue* args) { 208 const base::ListValue* args) {
209 content::RecordAction(UserMetricsAction("LanguageOptions_Open")); 209 content::RecordAction(UserMetricsAction("LanguageOptions_Open"));
210 SpellcheckService* service = GetSpellcheckService(); 210 SpellcheckService* service = GetSpellcheckService();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return; 291 return;
292 } 292 }
293 } 293 }
294 } 294 }
295 295
296 SpellcheckService* LanguageOptionsHandlerCommon::GetSpellcheckService() { 296 SpellcheckService* LanguageOptionsHandlerCommon::GetSpellcheckService() {
297 return SpellcheckServiceFactory::GetForContext(Profile::FromWebUI(web_ui())); 297 return SpellcheckServiceFactory::GetForContext(Profile::FromWebUI(web_ui()));
298 } 298 }
299 299
300 } // namespace options 300 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_dictionary_sync_test.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698