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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 426063005: Allow recommended locales to be set for public sessions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix buffer overflow in test. Created 6 years, 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/login/signin_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 } 878 }
879 879
880 void SigninScreenHandler::SetPublicSessionDisplayName( 880 void SigninScreenHandler::SetPublicSessionDisplayName(
881 const std::string& user_id, 881 const std::string& user_id,
882 const std::string& display_name) { 882 const std::string& display_name) {
883 CallJS("login.AccountPickerScreen.setPublicSessionDisplayName", 883 CallJS("login.AccountPickerScreen.setPublicSessionDisplayName",
884 user_id, 884 user_id,
885 display_name); 885 display_name);
886 } 886 }
887 887
888 void SigninScreenHandler::SetPublicSessionLocales(
889 const std::string& user_id,
890 scoped_ptr<base::ListValue> locales,
891 const std::string& default_locale,
892 bool multipleRecommendedLocales) {
893 CallJS("login.AccountPickerScreen.setPublicSessionLocales",
894 user_id,
895 *locales,
896 default_locale,
897 multipleRecommendedLocales);
898 }
899
888 void SigninScreenHandler::Observe(int type, 900 void SigninScreenHandler::Observe(int type,
889 const content::NotificationSource& source, 901 const content::NotificationSource& source,
890 const content::NotificationDetails& details) { 902 const content::NotificationDetails& details) {
891 switch (type) { 903 switch (type) {
892 case chrome::NOTIFICATION_AUTH_NEEDED: { 904 case chrome::NOTIFICATION_AUTH_NEEDED: {
893 has_pending_auth_ui_ = true; 905 has_pending_auth_ui_ = true;
894 break; 906 break;
895 } 907 }
896 case chrome::NOTIFICATION_AUTH_SUPPLIED: 908 case chrome::NOTIFICATION_AUTH_SUPPLIED:
897 has_pending_auth_ui_ = false; 909 has_pending_auth_ui_ = false;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 attempt_token), 1335 attempt_token),
1324 Profile::FromWebUI(web_ui())->GetRequestContext())); 1336 Profile::FromWebUI(web_ui())->GetRequestContext()));
1325 } 1337 }
1326 1338
1327 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( 1339 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts(
1328 const std::string& user_id, 1340 const std::string& user_id,
1329 const std::string& locale) { 1341 const std::string& locale) {
1330 GetKeyboardLayoutsForLocale( 1342 GetKeyboardLayoutsForLocale(
1331 base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts, 1343 base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts,
1332 weak_factory_.GetWeakPtr(), 1344 weak_factory_.GetWeakPtr(),
1333 user_id), 1345 user_id,
1346 locale),
1334 locale); 1347 locale);
1335 } 1348 }
1336 1349
1337 void SigninScreenHandler::SendPublicSessionKeyboardLayouts( 1350 void SigninScreenHandler::SendPublicSessionKeyboardLayouts(
1338 const std::string& user_id, 1351 const std::string& user_id,
1352 const std::string& locale,
1339 scoped_ptr<base::ListValue> keyboard_layouts) { 1353 scoped_ptr<base::ListValue> keyboard_layouts) {
1340 web_ui()->CallJavascriptFunction( 1354 CallJS("login.AccountPickerScreen.setPublicSessionKeyboardLayouts",
1341 "login.AccountPickerScreen.setPublicSessionKeyboardLayouts", 1355 user_id,
1342 base::StringValue(user_id), 1356 locale,
1343 *keyboard_layouts); 1357 *keyboard_layouts);
1344 } 1358 }
1345 1359
1346 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id, 1360 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id,
1347 bool diagnostic_mode) { 1361 bool diagnostic_mode) {
1348 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id); 1362 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id);
1349 SigninSpecifics specifics; 1363 SigninSpecifics specifics;
1350 specifics.kiosk_diagnostic_mode = diagnostic_mode; 1364 specifics.kiosk_diagnostic_mode = diagnostic_mode;
1351 if (delegate_) 1365 if (delegate_)
1352 delegate_->Login(context, specifics); 1366 delegate_->Login(context, specifics);
1353 } 1367 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 return gaia_screen_handler_->frame_error(); 1491 return gaia_screen_handler_->frame_error();
1478 } 1492 }
1479 1493
1480 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { 1494 void SigninScreenHandler::OnCapsLockChanged(bool enabled) {
1481 caps_lock_enabled_ = enabled; 1495 caps_lock_enabled_ = enabled;
1482 if (page_is_ready()) 1496 if (page_is_ready())
1483 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); 1497 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_);
1484 } 1498 }
1485 1499
1486 } // namespace chromeos 1500 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698