OLD | NEW |
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/chromeos/login/base_login_display_host.h" | 5 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/chromeos/language_preferences.h" | 21 #include "chrome/browser/chromeos/language_preferences.h" |
22 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 22 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
23 #include "chrome/browser/chromeos/login/helper.h" | 23 #include "chrome/browser/chromeos/login/helper.h" |
24 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 24 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
25 #include "chrome/browser/chromeos/login/login_utils.h" | 25 #include "chrome/browser/chromeos/login/login_utils.h" |
26 #include "chrome/browser/chromeos/login/login_wizard.h" | 26 #include "chrome/browser/chromeos/login/login_wizard.h" |
27 #include "chrome/browser/chromeos/login/user_manager.h" | 27 #include "chrome/browser/chromeos/login/user_manager.h" |
28 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 28 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
29 #include "chrome/browser/chromeos/login/wizard_controller.h" | 29 #include "chrome/browser/chromeos/login/wizard_controller.h" |
30 #include "chrome/browser/chromeos/mobile_config.h" | 30 #include "chrome/browser/chromeos/mobile_config.h" |
| 31 #include "chrome/browser/chromeos/system/input_device_settings.h" |
31 #include "chrome/browser/chromeos/system/timezone_settings.h" | 32 #include "chrome/browser/chromeos/system/timezone_settings.h" |
32 #include "chrome/browser/policy/auto_enrollment_client.h" | 33 #include "chrome/browser/policy/auto_enrollment_client.h" |
33 #include "chrome/browser/policy/browser_policy_connector.h" | 34 #include "chrome/browser/policy/browser_policy_connector.h" |
34 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
35 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
36 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
38 #include "chromeos/dbus/dbus_thread_manager.h" | 39 #include "chromeos/dbus/dbus_thread_manager.h" |
39 #include "chromeos/dbus/session_manager_client.h" | 40 #include "chromeos/dbus/session_manager_client.h" |
40 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 VLOG(1) << "Showing OOBE screen: " << first_screen_name; | 462 VLOG(1) << "Showing OOBE screen: " << first_screen_name; |
462 | 463 |
463 chromeos::input_method::InputMethodManager* manager = | 464 chromeos::input_method::InputMethodManager* manager = |
464 chromeos::input_method::InputMethodManager::GetInstance(); | 465 chromeos::input_method::InputMethodManager::GetInstance(); |
465 | 466 |
466 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty | 467 // Set up keyboards. For example, when |locale| is "en-US", enable US qwerty |
467 // and US dvorak keyboard layouts. | 468 // and US dvorak keyboard layouts. |
468 if (g_browser_process && g_browser_process->local_state()) { | 469 if (g_browser_process && g_browser_process->local_state()) { |
469 const std::string locale = g_browser_process->GetApplicationLocale(); | 470 const std::string locale = g_browser_process->GetApplicationLocale(); |
470 // If the preferred keyboard for the login screen has been saved, use it. | 471 // If the preferred keyboard for the login screen has been saved, use it. |
| 472 PrefService* prefs = g_browser_process->local_state(); |
471 std::string initial_input_method_id = | 473 std::string initial_input_method_id = |
472 g_browser_process->local_state()->GetString( | 474 prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout); |
473 chromeos::language_prefs::kPreferredKeyboardLayout); | |
474 if (initial_input_method_id.empty()) { | 475 if (initial_input_method_id.empty()) { |
475 // If kPreferredKeyboardLayout is not specified, use the hardware layout. | 476 // If kPreferredKeyboardLayout is not specified, use the hardware layout. |
476 initial_input_method_id = | 477 initial_input_method_id = |
477 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); | 478 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); |
478 } | 479 } |
479 manager->EnableLayouts(locale, initial_input_method_id); | 480 manager->EnableLayouts(locale, initial_input_method_id); |
| 481 |
| 482 // Apply owner preferences for tap-to-click and mouse buttons swap for |
| 483 // login screen. |
| 484 system::mouse_settings::SetPrimaryButtonRight( |
| 485 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); |
| 486 system::touchpad_settings::SetTapToClick( |
| 487 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); |
480 } | 488 } |
481 | 489 |
482 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); | 490 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); |
483 | 491 |
484 // Check whether we need to execute OOBE process. | 492 // Check whether we need to execute OOBE process. |
485 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); | 493 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); |
486 bool show_login_screen = | 494 bool show_login_screen = |
487 (first_screen_name.empty() && oobe_complete) || | 495 (first_screen_name.empty() && oobe_complete) || |
488 first_screen_name == chromeos::WizardController::kLoginScreenName; | 496 first_screen_name == chromeos::WizardController::kLoginScreenName; |
489 | 497 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 VLOG(1) << "Initial time zone: " << timezone_name; | 575 VLOG(1) << "Initial time zone: " << timezone_name; |
568 // Apply locale customizations only once to preserve whatever locale | 576 // Apply locale customizations only once to preserve whatever locale |
569 // user has changed to during OOBE. | 577 // user has changed to during OOBE. |
570 if (!timezone_name.empty()) { | 578 if (!timezone_name.empty()) { |
571 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 579 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
572 UTF8ToUTF16(timezone_name)); | 580 UTF8ToUTF16(timezone_name)); |
573 } | 581 } |
574 } | 582 } |
575 | 583 |
576 } // namespace chromeos | 584 } // namespace chromeos |
OLD | NEW |