| 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/system/chromeos/power/power_event_observer.h" | 8 #include "ash/system/chromeos/power/power_event_observer.h" |
| 9 #include "ash/wm/lock_state_controller.h" | 9 #include "ash/wm/lock_state_controller.h" |
| 10 #include "ash/wm/lock_state_observer.h" | 10 #include "ash/wm/lock_state_observer.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 //////////////////////////////////////////////////////////////////////////////// | 371 //////////////////////////////////////////////////////////////////////////////// |
| 372 // keyboard::KeyboardControllerObserver: | 372 // keyboard::KeyboardControllerObserver: |
| 373 | 373 |
| 374 void WebUIScreenLocker::OnKeyboardBoundsChanging( | 374 void WebUIScreenLocker::OnKeyboardBoundsChanging( |
| 375 const gfx::Rect& new_bounds) { | 375 const gfx::Rect& new_bounds) { |
| 376 if (new_bounds.IsEmpty()) { | 376 if (new_bounds.IsEmpty()) { |
| 377 // Keyboard has been hidden. | 377 // Keyboard has been hidden. |
| 378 if (GetOobeUI()) { | 378 if (GetOobeUI()) |
| 379 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(true); | 379 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(true); |
| 380 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(false, new_bounds); | |
| 381 } | |
| 382 } else { | 380 } else { |
| 383 // Keyboard has been shown. | 381 // Keyboard has been shown. |
| 384 if (GetOobeUI()) { | 382 if (GetOobeUI()) |
| 385 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false); | 383 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false); |
| 386 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(true, new_bounds); | |
| 387 } | |
| 388 } | 384 } |
| 389 } | 385 } |
| 390 | 386 |
| 391 //////////////////////////////////////////////////////////////////////////////// | 387 //////////////////////////////////////////////////////////////////////////////// |
| 392 // gfx::DisplayObserver: | 388 // gfx::DisplayObserver: |
| 393 | 389 |
| 394 void WebUIScreenLocker::OnDisplayAdded(const gfx::Display& new_display) { | 390 void WebUIScreenLocker::OnDisplayAdded(const gfx::Display& new_display) { |
| 395 } | 391 } |
| 396 | 392 |
| 397 void WebUIScreenLocker::OnDisplayRemoved(const gfx::Display& old_display) { | 393 void WebUIScreenLocker::OnDisplayRemoved(const gfx::Display& old_display) { |
| 398 } | 394 } |
| 399 | 395 |
| 400 void WebUIScreenLocker::OnDisplayMetricsChanged(const gfx::Display& display, | 396 void WebUIScreenLocker::OnDisplayMetricsChanged(const gfx::Display& display, |
| 401 uint32_t changed_metrics) { | 397 uint32_t changed_metrics) { |
| 402 gfx::Display primary_display = | 398 gfx::Display primary_display = |
| 403 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); | 399 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); |
| 404 if (display.id() != primary_display.id() || | 400 if (display.id() != primary_display.id() || |
| 405 !(changed_metrics & DISPLAY_METRIC_BOUNDS)) { | 401 !(changed_metrics & DISPLAY_METRIC_BOUNDS)) { |
| 406 return; | 402 return; |
| 407 } | 403 } |
| 408 | 404 |
| 409 if (GetOobeUI()) { | 405 if (GetOobeUI()) { |
| 410 const gfx::Size& size = primary_display.size(); | 406 const gfx::Size& size = primary_display.size(); |
| 411 GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(), | 407 GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(), |
| 412 size.height()); | 408 size.height()); |
| 413 } | 409 } |
| 414 } | 410 } |
| 415 | 411 |
| 416 } // namespace chromeos | 412 } // namespace chromeos |
| OLD | NEW |