OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/extensions/api/language_settings_private/language_setti
ngs_private_api.h" | 5 #include "chrome/browser/extensions/api/language_settings_private/language_setti
ngs_private_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 : chrome_details_(this) { | 433 : chrome_details_(this) { |
434 } | 434 } |
435 | 435 |
436 LanguageSettingsPrivateGetTranslateTargetLanguageFunction:: | 436 LanguageSettingsPrivateGetTranslateTargetLanguageFunction:: |
437 ~LanguageSettingsPrivateGetTranslateTargetLanguageFunction() { | 437 ~LanguageSettingsPrivateGetTranslateTargetLanguageFunction() { |
438 } | 438 } |
439 | 439 |
440 ExtensionFunction::ResponseAction | 440 ExtensionFunction::ResponseAction |
441 LanguageSettingsPrivateGetTranslateTargetLanguageFunction::Run() { | 441 LanguageSettingsPrivateGetTranslateTargetLanguageFunction::Run() { |
442 return RespondNow(OneArgument( | 442 return RespondNow(OneArgument( |
443 base::MakeUnique<base::StringValue>(TranslateService::GetTargetLanguage( | 443 base::MakeUnique<base::Value>(TranslateService::GetTargetLanguage( |
444 chrome_details_.GetProfile()->GetPrefs())))); | 444 chrome_details_.GetProfile()->GetPrefs())))); |
445 } | 445 } |
446 | 446 |
447 #if defined(OS_CHROMEOS) | 447 #if defined(OS_CHROMEOS) |
448 // Populates the vector of input methods using information in the list of | 448 // Populates the vector of input methods using information in the list of |
449 // descriptors. Used for languageSettingsPrivate.getInputMethodLists(). | 449 // descriptors. Used for languageSettingsPrivate.getInputMethodLists(). |
450 void PopulateInputMethodListFromDescriptors( | 450 void PopulateInputMethodListFromDescriptors( |
451 const InputMethodDescriptors& descriptors, | 451 const InputMethodDescriptors& descriptors, |
452 std::vector<language_settings_private::InputMethod>* input_methods) { | 452 std::vector<language_settings_private::InputMethod>* input_methods) { |
453 InputMethodManager* manager = InputMethodManager::Get(); | 453 InputMethodManager* manager = InputMethodManager::Get(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 input_method_list.end(), input_method_id); | 606 input_method_list.end(), input_method_id); |
607 if (pos != input_method_list.end()) { | 607 if (pos != input_method_list.end()) { |
608 input_method_list.erase(pos); | 608 input_method_list.erase(pos); |
609 prefs->SetString(pref_name, base::JoinString(input_method_list, ",")); | 609 prefs->SetString(pref_name, base::JoinString(input_method_list, ",")); |
610 } | 610 } |
611 #endif | 611 #endif |
612 return RespondNow(NoArguments()); | 612 return RespondNow(NoArguments()); |
613 } | 613 } |
614 | 614 |
615 } // namespace extensions | 615 } // namespace extensions |
OLD | NEW |