| 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/ui/webui/options/chromeos/cros_language_options_handler
.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler
.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 return ime_ids_list.release(); | 440 return ime_ids_list.release(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 base::string16 CrosLanguageOptionsHandler::GetProductName() { | 443 base::string16 CrosLanguageOptionsHandler::GetProductName() { |
| 444 return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME); | 444 return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void CrosLanguageOptionsHandler::SetApplicationLocale( | 447 void CrosLanguageOptionsHandler::SetApplicationLocale( |
| 448 const std::string& language_code) { | 448 const std::string& language_code) { |
| 449 Profile* profile = Profile::FromWebUI(web_ui()); | 449 Profile* profile = Profile::FromWebUI(web_ui()); |
| 450 UserManager* user_manager = UserManager::Get(); | 450 UserManager* user_manager = GetUserManager(); |
| 451 | 451 |
| 452 // Only the primary user can change the locale. | 452 // Only the primary user can change the locale. |
| 453 User* user = ProfileHelper::Get()->GetUserByProfile(profile); | 453 User* user = ProfileHelper::Get()->GetUserByProfile(profile); |
| 454 if (user && user->email() == user_manager->GetPrimaryUser()->email()) { | 454 if (user && user->email() == user_manager->GetPrimaryUser()->email()) { |
| 455 profile->ChangeAppLocale(language_code, | 455 profile->ChangeAppLocale(language_code, |
| 456 Profile::APP_LOCALE_CHANGED_VIA_SETTINGS); | 456 Profile::APP_LOCALE_CHANGED_VIA_SETTINGS); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 void CrosLanguageOptionsHandler::RestartCallback(const base::ListValue* args) { | 460 void CrosLanguageOptionsHandler::RestartCallback(const base::ListValue* args) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); | 568 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); |
| 569 const extensions::Extension* extension = | 569 const extensions::Extension* extension = |
| 570 enabled_extensions.GetByID(extension_id); | 570 enabled_extensions.GetByID(extension_id); |
| 571 if (extension) | 571 if (extension) |
| 572 entry->SetString("extensionName", extension->name()); | 572 entry->SetString("extensionName", extension->name()); |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace options | 576 } // namespace options |
| 577 } // namespace chromeos | 577 } // namespace chromeos |
| OLD | NEW |