Index: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
index 192cbe872f70c92094a9c5638bee08b5d47eee5c..9b5eb09ee65b86a00966befc27658b7dd380bb8b 100644 |
--- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
+++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
@@ -20,6 +20,7 @@ |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/chromeos/customization_document.h" |
#include "chrome/browser/chromeos/input_method/input_method_util.h" |
+#include "chrome/browser/chromeos/login/user_manager.h" |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/extensions/extension_tab_util.h" |
#include "chrome/browser/lifetime/application_lifetime.h" |
@@ -389,8 +390,15 @@ base::string16 CrosLanguageOptionsHandler::GetProductName() { |
void CrosLanguageOptionsHandler::SetApplicationLocale( |
const std::string& language_code) { |
- Profile::FromWebUI(web_ui())->ChangeAppLocale( |
- language_code, Profile::APP_LOCALE_CHANGED_VIA_SETTINGS); |
+ Profile* profile = Profile::FromWebUI(web_ui()); |
+ UserManager* user_manager = UserManager::Get(); |
+ |
+ // Only the primary user can change the locale. |
+ if (user_manager->GetUserByProfile(profile) == |
Dmitry Polukhin
2014/02/12 18:58:45
I would compare emails here instead of comparing p
michaelpg
2014/02/12 20:29:58
Done.
|
+ user_manager->GetPrimaryUser()) { |
+ profile->ChangeAppLocale(language_code, |
+ Profile::APP_LOCALE_CHANGED_VIA_SETTINGS); |
+ } |
} |
void CrosLanguageOptionsHandler::RestartCallback(const base::ListValue* args) { |