| 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/lock/webui_screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/lock_state_controller.h" | 8 #include "ash/wm/lock_state_controller.h" |
| 9 #include "ash/wm/lock_state_observer.h" | 9 #include "ash/wm/lock_state_observer.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 login_display_->set_parent_window(GetNativeWindow()); | 99 login_display_->set_parent_window(GetNativeWindow()); |
| 100 login_display_->Init(screen_locker()->users(), false, true, false); | 100 login_display_->Init(screen_locker()->users(), false, true, false); |
| 101 | 101 |
| 102 GetOobeUI()->ShowSigninScreen( | 102 GetOobeUI()->ShowSigninScreen( |
| 103 LoginScreenContext(), login_display_.get(), login_display_.get()); | 103 LoginScreenContext(), login_display_.get(), login_display_.get()); |
| 104 | 104 |
| 105 registrar_.Add(this, | 105 registrar_.Add(this, |
| 106 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 106 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 107 content::NotificationService::AllSources()); | 107 content::NotificationService::AllSources()); |
| 108 | 108 |
| 109 if (login::LockScrollIntoViewEnabled()) | 109 if (login::LoginScrollIntoViewEnabled()) |
| 110 DisableKeyboardOverscroll(); | 110 DisableKeyboardOverscroll(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void WebUIScreenLocker::ScreenLockReady() { | 113 void WebUIScreenLocker::ScreenLockReady() { |
| 114 UMA_HISTOGRAM_TIMES("LockScreen.LockReady", | 114 UMA_HISTOGRAM_TIMES("LockScreen.LockReady", |
| 115 base::TimeTicks::Now() - lock_time_); | 115 base::TimeTicks::Now() - lock_time_); |
| 116 ScreenLockerDelegate::ScreenLockReady(); | 116 ScreenLockerDelegate::ScreenLockReady(); |
| 117 SetInputEnabled(true); | 117 SetInputEnabled(true); |
| 118 } | 118 } |
| 119 | 119 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { | 174 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { |
| 175 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); | 175 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); |
| 176 is_observing_keyboard_ = false; | 176 is_observing_keyboard_ = false; |
| 177 } | 177 } |
| 178 | 178 |
| 179 ash::Shell::GetInstance()->delegate()-> | 179 ash::Shell::GetInstance()->delegate()-> |
| 180 RemoveVirtualKeyboardStateObserver(this); | 180 RemoveVirtualKeyboardStateObserver(this); |
| 181 | 181 |
| 182 if (login::LockScrollIntoViewEnabled()) | 182 if (login::LoginScrollIntoViewEnabled()) |
| 183 ResetKeyboardOverscrollOverride(); | 183 ResetKeyboardOverscrollOverride(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void WebUIScreenLocker::OnLockWebUIReady() { | 186 void WebUIScreenLocker::OnLockWebUIReady() { |
| 187 VLOG(1) << "WebUI ready; lock window is " | 187 VLOG(1) << "WebUI ready; lock window is " |
| 188 << (lock_ready_ ? "too" : "not"); | 188 << (lock_ready_ ? "too" : "not"); |
| 189 webui_ready_ = true; | 189 webui_ready_ = true; |
| 190 if (lock_ready_) | 190 if (lock_ready_) |
| 191 ScreenLockReady(); | 191 ScreenLockReady(); |
| 192 } | 192 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 381 |
| 382 //////////////////////////////////////////////////////////////////////////////// | 382 //////////////////////////////////////////////////////////////////////////////// |
| 383 // keyboard::KeyboardControllerObserver overrides. | 383 // keyboard::KeyboardControllerObserver overrides. |
| 384 | 384 |
| 385 void WebUIScreenLocker::OnKeyboardBoundsChanging( | 385 void WebUIScreenLocker::OnKeyboardBoundsChanging( |
| 386 const gfx::Rect& new_bounds) { | 386 const gfx::Rect& new_bounds) { |
| 387 if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) { | 387 if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) { |
| 388 // Keyboard has been hidden. | 388 // Keyboard has been hidden. |
| 389 if (GetOobeUI()) { | 389 if (GetOobeUI()) { |
| 390 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(true); | 390 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(true); |
| 391 if (login::LockScrollIntoViewEnabled()) | 391 if (login::LoginScrollIntoViewEnabled()) |
| 392 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(false, new_bounds); | 392 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(false, new_bounds); |
| 393 } | 393 } |
| 394 } else if (!new_bounds.IsEmpty() && keyboard_bounds_.IsEmpty()) { | 394 } else if (!new_bounds.IsEmpty() && keyboard_bounds_.IsEmpty()) { |
| 395 // Keyboard has been shown. | 395 // Keyboard has been shown. |
| 396 if (GetOobeUI()) { | 396 if (GetOobeUI()) { |
| 397 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false); | 397 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false); |
| 398 if (login::LockScrollIntoViewEnabled()) | 398 if (login::LoginScrollIntoViewEnabled()) |
| 399 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(true, new_bounds); | 399 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(true, new_bounds); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 keyboard_bounds_ = new_bounds; | 403 keyboard_bounds_ = new_bounds; |
| 404 } | 404 } |
| 405 | 405 |
| 406 } // namespace chromeos | 406 } // namespace chromeos |
| OLD | NEW |