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

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

Issue 412583002: Prevent public session users from changing locale via settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 5 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
« no previous file with comments | « chrome/browser/resources/options/language_options.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 afd1ab1445a2d5bd0684dd0a9aac9d032386c332..96bee5cbfc7f32e08eaf1641ee140d3cef1d60fb 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
@@ -25,6 +25,7 @@
#include "chromeos/ime/component_extension_ime_manager.h"
#include "chromeos/ime/extension_ime_util.h"
#include "chromeos/ime/input_method_manager.h"
+#include "components/user_manager/user_type.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
@@ -199,9 +200,11 @@ void CrosLanguageOptionsHandler::SetApplicationLocale(
Profile* profile = Profile::FromWebUI(web_ui());
UserManager* user_manager = UserManager::Get();
- // Only the primary user can change the locale.
+ // Secondary users and public session users cannot change the locale.
user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile);
- if (user && user->email() == user_manager->GetPrimaryUser()->email()) {
+ if (user &&
+ user->email() == user_manager->GetPrimaryUser()->email() &&
+ user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT) {
profile->ChangeAppLocale(language_code,
Profile::APP_LOCALE_CHANGED_VIA_SETTINGS);
}
« no previous file with comments | « chrome/browser/resources/options/language_options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698