Chromium Code Reviews| 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 system::mouse_settings::SetPrimaryButtonRight( | |
|
achuithb
2012/09/10 18:07:30
Please add a comment here about why this is necess
Dmitry Polukhin
2012/09/11 08:01:00
Done.
| |
| 483 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); | |
| 484 system::touchpad_settings::SetTapToClick( | |
| 485 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); | |
| 480 } | 486 } |
| 481 | 487 |
| 482 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); | 488 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); |
| 483 | 489 |
| 484 // Check whether we need to execute OOBE process. | 490 // Check whether we need to execute OOBE process. |
| 485 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); | 491 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); |
| 486 bool show_login_screen = | 492 bool show_login_screen = |
| 487 (first_screen_name.empty() && oobe_complete) || | 493 (first_screen_name.empty() && oobe_complete) || |
| 488 first_screen_name == chromeos::WizardController::kLoginScreenName; | 494 first_screen_name == chromeos::WizardController::kLoginScreenName; |
| 489 | 495 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 567 VLOG(1) << "Initial time zone: " << timezone_name; | 573 VLOG(1) << "Initial time zone: " << timezone_name; |
| 568 // Apply locale customizations only once to preserve whatever locale | 574 // Apply locale customizations only once to preserve whatever locale |
| 569 // user has changed to during OOBE. | 575 // user has changed to during OOBE. |
| 570 if (!timezone_name.empty()) { | 576 if (!timezone_name.empty()) { |
| 571 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 577 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 572 UTF8ToUTF16(timezone_name)); | 578 UTF8ToUTF16(timezone_name)); |
| 573 } | 579 } |
| 574 } | 580 } |
| 575 | 581 |
| 576 } // namespace chromeos | 582 } // namespace chromeos |
| OLD | NEW |