| 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 #include "ui/gfx/display.h" | 80 #include "ui/gfx/display.h" |
| 81 #include "ui/gfx/rect.h" | 81 #include "ui/gfx/rect.h" |
| 82 #include "ui/gfx/screen.h" | 82 #include "ui/gfx/screen.h" |
| 83 #include "ui/gfx/size.h" | 83 #include "ui/gfx/size.h" |
| 84 #include "ui/gfx/transform.h" | 84 #include "ui/gfx/transform.h" |
| 85 #include "ui/keyboard/keyboard_controller.h" | 85 #include "ui/keyboard/keyboard_controller.h" |
| 86 #include "ui/keyboard/keyboard_util.h" | 86 #include "ui/keyboard/keyboard_util.h" |
| 87 #include "ui/views/focus/focus_manager.h" | 87 #include "ui/views/focus/focus_manager.h" |
| 88 #include "ui/views/widget/widget.h" | 88 #include "ui/views/widget/widget.h" |
| 89 #include "ui/views/widget/widget_delegate.h" | 89 #include "ui/views/widget/widget_delegate.h" |
| 90 #include "ui/wm/core/window_animations.h" | |
| 91 #include "url/gurl.h" | 90 #include "url/gurl.h" |
| 92 | 91 |
| 93 #if !defined(USE_ATHENA) | 92 #if !defined(USE_ATHENA) |
| 94 #include "ash/audio/sounds.h" | 93 #include "ash/audio/sounds.h" |
| 95 #include "ash/desktop_background/desktop_background_controller.h" | 94 #include "ash/desktop_background/desktop_background_controller.h" |
| 96 #include "ash/desktop_background/user_wallpaper_delegate.h" | 95 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 97 #include "ash/shell.h" | 96 #include "ash/shell.h" |
| 98 #include "ash/shell_window_ids.h" | 97 #include "ash/shell_window_ids.h" |
| 99 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" | 98 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" |
| 100 #endif | 99 #endif |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 #endif | 1096 #endif |
| 1098 login_window_ = new views::Widget; | 1097 login_window_ = new views::Widget; |
| 1099 params.delegate = new LoginWidgetDelegate(login_window_); | 1098 params.delegate = new LoginWidgetDelegate(login_window_); |
| 1100 login_window_->Init(params); | 1099 login_window_->Init(params); |
| 1101 | 1100 |
| 1102 login_view_ = new WebUILoginView(); | 1101 login_view_ = new WebUILoginView(); |
| 1103 login_view_->Init(); | 1102 login_view_->Init(); |
| 1104 if (login_view_->webui_visible()) | 1103 if (login_view_->webui_visible()) |
| 1105 OnLoginPromptVisible(); | 1104 OnLoginPromptVisible(); |
| 1106 | 1105 |
| 1107 wm::SetWindowVisibilityAnimationDuration( | 1106 login_window_->SetVisibilityAnimationDuration( |
| 1108 login_window_->GetNativeView(), | |
| 1109 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); | 1107 base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); |
| 1110 wm::SetWindowVisibilityAnimationTransition( | 1108 login_window_->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); |
| 1111 login_window_->GetNativeView(), | |
| 1112 wm::ANIMATE_HIDE); | |
| 1113 | 1109 |
| 1114 login_window_->AddRemovalsObserver(this); | 1110 login_window_->AddRemovalsObserver(this); |
| 1115 login_window_->SetContentsView(login_view_); | 1111 login_window_->SetContentsView(login_view_); |
| 1116 | 1112 |
| 1117 // If WebUI is initialized in hidden state, show it only if we're no | 1113 // If WebUI is initialized in hidden state, show it only if we're no |
| 1118 // longer waiting for wallpaper animation/user images loading. Otherwise, | 1114 // longer waiting for wallpaper animation/user images loading. Otherwise, |
| 1119 // always show it. | 1115 // always show it. |
| 1120 if (!initialize_webui_hidden_ || | 1116 if (!initialize_webui_hidden_ || |
| 1121 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { | 1117 (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { |
| 1122 VLOG(1) << "Login WebUI >> show login wnd on create"; | 1118 VLOG(1) << "Login WebUI >> show login wnd on create"; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1317 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1322 new locale_util::SwitchLanguageCallback( | 1318 new locale_util::SwitchLanguageCallback( |
| 1323 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1319 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1324 | 1320 |
| 1325 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1321 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1326 locale_util::SwitchLanguage( | 1322 locale_util::SwitchLanguage( |
| 1327 locale, true, true /* login_layouts_only */, callback.Pass()); | 1323 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1328 } | 1324 } |
| 1329 | 1325 |
| 1330 } // namespace chromeos | 1326 } // namespace chromeos |
| OLD | NEW |