| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/audio/sounds.h" | 9 #include "ash/audio/sounds.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/chromeos/login/helper.h" | 39 #include "chrome/browser/chromeos/login/helper.h" |
| 40 #include "chrome/browser/chromeos/login/login_utils.h" | 40 #include "chrome/browser/chromeos/login/login_utils.h" |
| 41 #include "chrome/browser/chromeos/login/login_wizard.h" | 41 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 42 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 42 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
| 43 #include "chrome/browser/chromeos/login/startup_utils.h" | 43 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 44 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 44 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| 45 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" | 45 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" |
| 46 #include "chrome/browser/chromeos/login/ui/oobe_display.h" | 46 #include "chrome/browser/chromeos/login/ui/oobe_display.h" |
| 47 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 47 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 48 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 48 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 49 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 50 #include "chrome/browser/chromeos/login/wizard_controller.h" | 49 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 51 #include "chrome/browser/chromeos/mobile_config.h" | 50 #include "chrome/browser/chromeos/mobile_config.h" |
| 52 #include "chrome/browser/chromeos/net/delay_network_call.h" | 51 #include "chrome/browser/chromeos/net/delay_network_call.h" |
| 53 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" | 52 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" |
| 54 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 53 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 55 #include "chrome/browser/chromeos/system/input_device_settings.h" | 54 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 56 #include "chrome/browser/chromeos/ui/focus_ring_controller.h" | 55 #include "chrome/browser/chromeos/ui/focus_ring_controller.h" |
| 57 #include "chrome/browser/lifetime/application_lifetime.h" | 56 #include "chrome/browser/lifetime/application_lifetime.h" |
| 58 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 57 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 59 #include "chrome/common/chrome_constants.h" | 58 #include "chrome/common/chrome_constants.h" |
| 60 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
| 61 #include "chrome/common/pref_names.h" | 60 #include "chrome/common/pref_names.h" |
| 62 #include "chrome/grit/browser_resources.h" | 61 #include "chrome/grit/browser_resources.h" |
| 63 #include "chromeos/audio/chromeos_sounds.h" | 62 #include "chromeos/audio/chromeos_sounds.h" |
| 64 #include "chromeos/chromeos_constants.h" | 63 #include "chromeos/chromeos_constants.h" |
| 65 #include "chromeos/chromeos_switches.h" | 64 #include "chromeos/chromeos_switches.h" |
| 66 #include "chromeos/dbus/dbus_thread_manager.h" | 65 #include "chromeos/dbus/dbus_thread_manager.h" |
| 67 #include "chromeos/dbus/session_manager_client.h" | 66 #include "chromeos/dbus/session_manager_client.h" |
| 68 #include "chromeos/ime/extension_ime_util.h" | 67 #include "chromeos/ime/extension_ime_util.h" |
| 69 #include "chromeos/ime/input_method_manager.h" | 68 #include "chromeos/ime/input_method_manager.h" |
| 70 #include "chromeos/login/login_state.h" | 69 #include "chromeos/login/login_state.h" |
| 71 #include "chromeos/settings/timezone_settings.h" | 70 #include "chromeos/settings/timezone_settings.h" |
| 72 #include "components/session_manager/core/session_manager.h" | 71 #include "components/session_manager/core/session_manager.h" |
| 72 #include "components/user_manager/user_manager.h" |
| 73 #include "content/public/browser/notification_service.h" | 73 #include "content/public/browser/notification_service.h" |
| 74 #include "content/public/browser/notification_types.h" | 74 #include "content/public/browser/notification_types.h" |
| 75 #include "content/public/browser/render_frame_host.h" | 75 #include "content/public/browser/render_frame_host.h" |
| 76 #include "content/public/browser/web_contents.h" | 76 #include "content/public/browser/web_contents.h" |
| 77 #include "content/public/browser/web_ui.h" | 77 #include "content/public/browser/web_ui.h" |
| 78 #include "media/audio/sounds/sounds_manager.h" | 78 #include "media/audio/sounds/sounds_manager.h" |
| 79 #include "ui/aura/window.h" | 79 #include "ui/aura/window.h" |
| 80 #include "ui/base/resource/resource_bundle.h" | 80 #include "ui/base/resource/resource_bundle.h" |
| 81 #include "ui/base/ui_base_switches_util.h" | 81 #include "ui/base/ui_base_switches_util.h" |
| 82 #include "ui/compositor/layer.h" | 82 #include "ui/compositor/layer.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 ResetKeyboardOverscrollOverride(); | 419 ResetKeyboardOverscrollOverride(); |
| 420 | 420 |
| 421 views::FocusManager::set_arrow_key_traversal_enabled(false); | 421 views::FocusManager::set_arrow_key_traversal_enabled(false); |
| 422 ResetLoginWindowAndView(); | 422 ResetLoginWindowAndView(); |
| 423 | 423 |
| 424 // Let chrome process exit after login/oobe screen if needed. | 424 // Let chrome process exit after login/oobe screen if needed. |
| 425 chrome::DecrementKeepAliveCount(); | 425 chrome::DecrementKeepAliveCount(); |
| 426 | 426 |
| 427 default_host_ = NULL; | 427 default_host_ = NULL; |
| 428 // TODO(tengs): This should be refactored. See crbug.com/314934. | 428 // TODO(tengs): This should be refactored. See crbug.com/314934. |
| 429 if (UserManager::Get()->IsCurrentUserNew()) { | 429 if (user_manager::UserManager::Get()->IsCurrentUserNew()) { |
| 430 // DriveOptInController will delete itself when finished. | 430 // DriveOptInController will delete itself when finished. |
| 431 (new DriveFirstRunController( | 431 (new DriveFirstRunController( |
| 432 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); | 432 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 | 435 |
| 436 //////////////////////////////////////////////////////////////////////////////// | 436 //////////////////////////////////////////////////////////////////////////////// |
| 437 // LoginDisplayHostImpl, LoginDisplayHost implementation: | 437 // LoginDisplayHostImpl, LoginDisplayHost implementation: |
| 438 | 438 |
| 439 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( | 439 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 lock_container->layer()->SetOpacity(1.0); | 579 lock_container->layer()->SetOpacity(1.0); |
| 580 | 580 |
| 581 ash::Shell::GetInstance()-> | 581 ash::Shell::GetInstance()-> |
| 582 desktop_background_controller()->MoveDesktopToLockedContainer(); | 582 desktop_background_controller()->MoveDesktopToLockedContainer(); |
| 583 | 583 |
| 584 sign_in_controller_.reset(); // Only one controller in a time. | 584 sign_in_controller_.reset(); // Only one controller in a time. |
| 585 sign_in_controller_.reset(new chromeos::ExistingUserController(this)); | 585 sign_in_controller_.reset(new chromeos::ExistingUserController(this)); |
| 586 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); | 586 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); |
| 587 SetStatusAreaVisible(true); | 587 SetStatusAreaVisible(true); |
| 588 sign_in_controller_->Init( | 588 sign_in_controller_->Init( |
| 589 chromeos::UserManager::Get()->GetUsersAdmittedForMultiProfile()); | 589 user_manager::UserManager::Get()->GetUsersAdmittedForMultiProfile()); |
| 590 CHECK(webui_login_display_); | 590 CHECK(webui_login_display_); |
| 591 GetOobeUI()->ShowSigninScreen(LoginScreenContext(), | 591 GetOobeUI()->ShowSigninScreen(LoginScreenContext(), |
| 592 webui_login_display_, | 592 webui_login_display_, |
| 593 webui_login_display_); | 593 webui_login_display_); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void LoginDisplayHostImpl::StartSignInScreen( | 596 void LoginDisplayHostImpl::StartSignInScreen( |
| 597 const LoginScreenContext& context) { | 597 const LoginScreenContext& context) { |
| 598 if (login::LoginScrollIntoViewEnabled()) | 598 if (login::LoginScrollIntoViewEnabled()) |
| 599 DisableKeyboardOverscroll(); | 599 DisableKeyboardOverscroll(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 616 if (!login_window_) { | 616 if (!login_window_) { |
| 617 TRACE_EVENT_ASYNC_BEGIN0("ui", "ShowLoginWebUI", kShowLoginWebUIid); | 617 TRACE_EVENT_ASYNC_BEGIN0("ui", "ShowLoginWebUI", kShowLoginWebUIid); |
| 618 TRACE_EVENT_ASYNC_STEP_INTO0( | 618 TRACE_EVENT_ASYNC_STEP_INTO0( |
| 619 "ui", "ShowLoginWebUI", kShowLoginWebUIid, "StartSignInScreen"); | 619 "ui", "ShowLoginWebUI", kShowLoginWebUIid, "StartSignInScreen"); |
| 620 BootTimesLoader::Get()->RecordCurrentStats("login-start-signin-screen"); | 620 BootTimesLoader::Get()->RecordCurrentStats("login-start-signin-screen"); |
| 621 LoadURL(GURL(kLoginURL)); | 621 LoadURL(GURL(kLoginURL)); |
| 622 } | 622 } |
| 623 | 623 |
| 624 DVLOG(1) << "Starting sign in screen"; | 624 DVLOG(1) << "Starting sign in screen"; |
| 625 const user_manager::UserList& users = | 625 const user_manager::UserList& users = |
| 626 chromeos::UserManager::Get()->GetUsers(); | 626 user_manager::UserManager::Get()->GetUsers(); |
| 627 | 627 |
| 628 // Fix for users who updated device and thus never passed register screen. | 628 // Fix for users who updated device and thus never passed register screen. |
| 629 // If we already have users, we assume that it is not a second part of | 629 // If we already have users, we assume that it is not a second part of |
| 630 // OOBE. See http://crosbug.com/6289 | 630 // OOBE. See http://crosbug.com/6289 |
| 631 if (!StartupUtils::IsDeviceRegistered() && !users.empty()) { | 631 if (!StartupUtils::IsDeviceRegistered() && !users.empty()) { |
| 632 VLOG(1) << "Mark device registered because there are remembered users: " | 632 VLOG(1) << "Mark device registered because there are remembered users: " |
| 633 << users.size(); | 633 << users.size(); |
| 634 StartupUtils::MarkDeviceRegistered(base::Closure()); | 634 StartupUtils::MarkDeviceRegistered(base::Closure()); |
| 635 } | 635 } |
| 636 | 636 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 // Browsers created before session start (windows opened by extensions, for | 788 // Browsers created before session start (windows opened by extensions, for |
| 789 // example) are ignored. | 789 // example) are ignored. |
| 790 OnBrowserCreated(); | 790 OnBrowserCreated(); |
| 791 registrar_.Remove(this, | 791 registrar_.Remove(this, |
| 792 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 792 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 793 content::NotificationService::AllSources()); | 793 content::NotificationService::AllSources()); |
| 794 registrar_.Remove(this, | 794 registrar_.Remove(this, |
| 795 chrome::NOTIFICATION_BROWSER_OPENED, | 795 chrome::NOTIFICATION_BROWSER_OPENED, |
| 796 content::NotificationService::AllSources()); | 796 content::NotificationService::AllSources()); |
| 797 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && | 797 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && |
| 798 chromeos::UserManager::Get()->IsCurrentUserNew()) { | 798 user_manager::UserManager::Get()->IsCurrentUserNew()) { |
| 799 // For new user, move desktop to locker container so that windows created | 799 // For new user, move desktop to locker container so that windows created |
| 800 // during the user image picker step are below it. | 800 // during the user image picker step are below it. |
| 801 ash::Shell::GetInstance()-> | 801 ash::Shell::GetInstance()-> |
| 802 desktop_background_controller()->MoveDesktopToLockedContainer(); | 802 desktop_background_controller()->MoveDesktopToLockedContainer(); |
| 803 registrar_.Remove(this, | 803 registrar_.Remove(this, |
| 804 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 804 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 805 content::NotificationService::AllSources()); | 805 content::NotificationService::AllSources()); |
| 806 } | 806 } |
| 807 } | 807 } |
| 808 | 808 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1274 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1275 new locale_util::SwitchLanguageCallback( | 1275 new locale_util::SwitchLanguageCallback( |
| 1276 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1276 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1277 | 1277 |
| 1278 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1278 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1279 locale_util::SwitchLanguage( | 1279 locale_util::SwitchLanguage( |
| 1280 locale, true, true /* login_layouts_only */, callback.Pass()); | 1280 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 } // namespace chromeos | 1283 } // namespace chromeos |
| OLD | NEW |