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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 CrasAudioHandler::Get()->RemoveAudioObserver(this); | 404 CrasAudioHandler::Get()->RemoveAudioObserver(this); |
405 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { | 405 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { |
406 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); | 406 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); |
407 is_observing_keyboard_ = false; | 407 is_observing_keyboard_ = false; |
408 } | 408 } |
409 | 409 |
410 ash::Shell::GetInstance()->delegate()-> | 410 ash::Shell::GetInstance()->delegate()-> |
411 RemoveVirtualKeyboardStateObserver(this); | 411 RemoveVirtualKeyboardStateObserver(this); |
412 ash::Shell::GetScreen()->RemoveObserver(this); | 412 ash::Shell::GetScreen()->RemoveObserver(this); |
413 | 413 |
| 414 if (login_view_ && login_window_) |
| 415 login_window_->RemoveRemovalsObserver(this); |
| 416 |
414 if (login::LoginScrollIntoViewEnabled()) | 417 if (login::LoginScrollIntoViewEnabled()) |
415 ResetKeyboardOverscrollOverride(); | 418 ResetKeyboardOverscrollOverride(); |
416 | 419 |
417 views::FocusManager::set_arrow_key_traversal_enabled(false); | 420 views::FocusManager::set_arrow_key_traversal_enabled(false); |
418 ResetLoginWindowAndView(); | 421 ResetLoginWindowAndView(); |
419 | 422 |
420 // Let chrome process exit after login/oobe screen if needed. | 423 // Let chrome process exit after login/oobe screen if needed. |
421 chrome::DecrementKeepAliveCount(); | 424 chrome::DecrementKeepAliveCount(); |
422 | 425 |
423 default_host_ = NULL; | 426 default_host_ = NULL; |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 } | 901 } |
899 | 902 |
900 if (GetOobeUI()) { | 903 if (GetOobeUI()) { |
901 const gfx::Size& size = ash::Shell::GetScreen()->GetPrimaryDisplay().size(); | 904 const gfx::Size& size = ash::Shell::GetScreen()->GetPrimaryDisplay().size(); |
902 GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(), | 905 GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(), |
903 size.height()); | 906 size.height()); |
904 } | 907 } |
905 } | 908 } |
906 | 909 |
907 //////////////////////////////////////////////////////////////////////////////// | 910 //////////////////////////////////////////////////////////////////////////////// |
| 911 // LoginDisplayHostImpl, views::WidgetRemovalsObserver implementation: |
| 912 void LoginDisplayHostImpl::OnWillRemoveView(views::Widget* widget, |
| 913 views::View* view) { |
| 914 if (view != static_cast<views::View*>(login_view_)) |
| 915 return; |
| 916 login_view_ = NULL; |
| 917 widget->RemoveRemovalsObserver(this); |
| 918 } |
| 919 |
| 920 //////////////////////////////////////////////////////////////////////////////// |
908 // LoginDisplayHostImpl, private | 921 // LoginDisplayHostImpl, private |
909 | 922 |
910 void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) { | 923 void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) { |
911 if (shutting_down_) | 924 if (shutting_down_) |
912 return; | 925 return; |
913 | 926 |
914 shutting_down_ = true; | 927 shutting_down_ = true; |
915 registrar_.RemoveAll(); | 928 registrar_.RemoveAll(); |
916 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 929 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
917 if (post_quit_task) | 930 if (post_quit_task) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 if (login_view_->webui_visible()) | 1068 if (login_view_->webui_visible()) |
1056 OnLoginPromptVisible(); | 1069 OnLoginPromptVisible(); |
1057 | 1070 |
1058 wm::SetWindowVisibilityAnimationDuration( | 1071 wm::SetWindowVisibilityAnimationDuration( |
1059 login_window_->GetNativeView(), | 1072 login_window_->GetNativeView(), |
1060 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); | 1073 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); |
1061 wm::SetWindowVisibilityAnimationTransition( | 1074 wm::SetWindowVisibilityAnimationTransition( |
1062 login_window_->GetNativeView(), | 1075 login_window_->GetNativeView(), |
1063 wm::ANIMATE_HIDE); | 1076 wm::ANIMATE_HIDE); |
1064 | 1077 |
| 1078 login_window_->AddRemovalsObserver(this); |
1065 login_window_->SetContentsView(login_view_); | 1079 login_window_->SetContentsView(login_view_); |
1066 | 1080 |
1067 // If WebUI is initialized in hidden state, show it only if we're no | 1081 // If WebUI is initialized in hidden state, show it only if we're no |
1068 // longer waiting for wallpaper animation/user images loading. Otherwise, | 1082 // longer waiting for wallpaper animation/user images loading. Otherwise, |
1069 // always show it. | 1083 // always show it. |
1070 if (!initialize_webui_hidden_ || | 1084 if (!initialize_webui_hidden_ || |
1071 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { | 1085 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { |
1072 LOG(WARNING) << "Login WebUI >> show login wnd on create"; | 1086 LOG(WARNING) << "Login WebUI >> show login wnd on create"; |
1073 login_window_->Show(); | 1087 login_window_->Show(); |
1074 } else { | 1088 } else { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1275 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
1262 new locale_util::SwitchLanguageCallback( | 1276 new locale_util::SwitchLanguageCallback( |
1263 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1277 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
1264 | 1278 |
1265 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1279 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1266 locale_util::SwitchLanguage( | 1280 locale_util::SwitchLanguage( |
1267 locale, true, true /* login_layouts_only */, callback.Pass()); | 1281 locale, true, true /* login_layouts_only */, callback.Pass()); |
1268 } | 1282 } |
1269 | 1283 |
1270 } // namespace chromeos | 1284 } // namespace chromeos |
OLD | NEW |