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

Unified Diff: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc

Issue 152143009: Clarify settings UI in multi-profiles mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable locale change for secondary user Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698