| 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/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/chromeos/login/login_wizard.h" | 36 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 37 #include "chrome/browser/chromeos/login/oobe_display.h" | 37 #include "chrome/browser/chromeos/login/oobe_display.h" |
| 38 #include "chrome/browser/chromeos/login/startup_utils.h" | 38 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 39 #include "chrome/browser/chromeos/login/user_manager.h" | 39 #include "chrome/browser/chromeos/login/user_manager.h" |
| 40 #include "chrome/browser/chromeos/login/webui_login_display.h" | 40 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 41 #include "chrome/browser/chromeos/login/webui_login_view.h" | 41 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 42 #include "chrome/browser/chromeos/login/wizard_controller.h" | 42 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 43 #include "chrome/browser/chromeos/mobile_config.h" | 43 #include "chrome/browser/chromeos/mobile_config.h" |
| 44 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" | 44 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" |
| 45 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 45 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 46 #include "chrome/browser/chromeos/system/input_device_settings.h" | |
| 47 #include "chrome/browser/chromeos/system/statistics_provider.h" | 46 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 48 #include "chrome/browser/chromeos/system/timezone_settings.h" | 47 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 49 #include "chrome/browser/lifetime/application_lifetime.h" | 48 #include "chrome/browser/lifetime/application_lifetime.h" |
| 50 #include "chrome/browser/managed_mode/managed_mode.h" | 49 #include "chrome/browser/managed_mode/managed_mode.h" |
| 51 #include "chrome/browser/policy/browser_policy_connector.h" | 50 #include "chrome/browser/policy/browser_policy_connector.h" |
| 52 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 51 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 53 #include "chrome/common/chrome_constants.h" | 52 #include "chrome/common/chrome_constants.h" |
| 54 #include "chrome/common/chrome_notification_types.h" | 53 #include "chrome/common/chrome_notification_types.h" |
| 55 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
| 56 #include "chromeos/chromeos_constants.h" | 55 #include "chromeos/chromeos_constants.h" |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 // If the preferred keyboard for the login screen has been saved, use it. | 802 // If the preferred keyboard for the login screen has been saved, use it. |
| 804 PrefService* prefs = g_browser_process->local_state(); | 803 PrefService* prefs = g_browser_process->local_state(); |
| 805 std::string initial_input_method_id = | 804 std::string initial_input_method_id = |
| 806 prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout); | 805 prefs->GetString(chromeos::language_prefs::kPreferredKeyboardLayout); |
| 807 if (initial_input_method_id.empty()) { | 806 if (initial_input_method_id.empty()) { |
| 808 // If kPreferredKeyboardLayout is not specified, use the hardware layout. | 807 // If kPreferredKeyboardLayout is not specified, use the hardware layout. |
| 809 initial_input_method_id = | 808 initial_input_method_id = |
| 810 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); | 809 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); |
| 811 } | 810 } |
| 812 manager->EnableLayouts(locale, initial_input_method_id); | 811 manager->EnableLayouts(locale, initial_input_method_id); |
| 813 | |
| 814 // Apply owner preferences for tap-to-click and mouse buttons swap for | |
| 815 // login screen. | |
| 816 system::mouse_settings::SetPrimaryButtonRight( | |
| 817 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); | |
| 818 system::touchpad_settings::SetTapToClick( | |
| 819 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); | |
| 820 } | 812 } |
| 821 | 813 |
| 822 ui::SetNaturalScroll(CommandLine::ForCurrentProcess()->HasSwitch( | 814 ui::SetNaturalScroll(CommandLine::ForCurrentProcess()->HasSwitch( |
| 823 switches::kNaturalScrollDefault)); | 815 switches::kNaturalScrollDefault)); |
| 824 | 816 |
| 825 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); | 817 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); |
| 826 | 818 |
| 827 // Check whether we need to execute OOBE process. | 819 // Check whether we need to execute OOBE process. |
| 828 bool oobe_complete = chromeos::StartupUtils::IsOobeCompleted(); | 820 bool oobe_complete = chromeos::StartupUtils::IsOobeCompleted(); |
| 829 if (!oobe_complete) { | 821 if (!oobe_complete) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 VLOG(1) << "Initial time zone: " << timezone_name; | 911 VLOG(1) << "Initial time zone: " << timezone_name; |
| 920 // Apply locale customizations only once to preserve whatever locale | 912 // Apply locale customizations only once to preserve whatever locale |
| 921 // user has changed to during OOBE. | 913 // user has changed to during OOBE. |
| 922 if (!timezone_name.empty()) { | 914 if (!timezone_name.empty()) { |
| 923 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 915 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 924 UTF8ToUTF16(timezone_name)); | 916 UTF8ToUTF16(timezone_name)); |
| 925 } | 917 } |
| 926 } | 918 } |
| 927 | 919 |
| 928 } // namespace chromeos | 920 } // namespace chromeos |
| OLD | NEW |