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

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

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 base::string16 CrosLanguageOptionsHandler::GetProductName() { 193 base::string16 CrosLanguageOptionsHandler::GetProductName() {
194 return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME); 194 return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME);
195 } 195 }
196 196
197 void CrosLanguageOptionsHandler::SetApplicationLocale( 197 void CrosLanguageOptionsHandler::SetApplicationLocale(
198 const std::string& language_code) { 198 const std::string& language_code) {
199 Profile* profile = Profile::FromWebUI(web_ui()); 199 Profile* profile = Profile::FromWebUI(web_ui());
200 UserManager* user_manager = UserManager::Get(); 200 UserManager* user_manager = UserManager::Get();
201 201
202 // Only the primary user can change the locale. 202 // Only the primary user can change the locale.
203 User* user = ProfileHelper::Get()->GetUserByProfile(profile); 203 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile);
204 if (user && user->email() == user_manager->GetPrimaryUser()->email()) { 204 if (user && user->email() == user_manager->GetPrimaryUser()->email()) {
205 profile->ChangeAppLocale(language_code, 205 profile->ChangeAppLocale(language_code,
206 Profile::APP_LOCALE_CHANGED_VIA_SETTINGS); 206 Profile::APP_LOCALE_CHANGED_VIA_SETTINGS);
207 } 207 }
208 } 208 }
209 209
210 void CrosLanguageOptionsHandler::RestartCallback(const base::ListValue* args) { 210 void CrosLanguageOptionsHandler::RestartCallback(const base::ListValue* args) {
211 content::RecordAction(UserMetricsAction("LanguageOptions_SignOut")); 211 content::RecordAction(UserMetricsAction("LanguageOptions_SignOut"));
212 chrome::AttemptUserExit(); 212 chrome::AttemptUserExit();
213 } 213 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); 318 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id);
319 const extensions::Extension* extension = 319 const extensions::Extension* extension =
320 enabled_extensions.GetByID(extension_id); 320 enabled_extensions.GetByID(extension_id);
321 if (extension) 321 if (extension)
322 entry->SetString("extensionName", extension->name()); 322 entry->SetString("extensionName", extension->name());
323 } 323 }
324 } 324 }
325 325
326 } // namespace options 326 } // namespace options
327 } // namespace chromeos 327 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698