| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 ash::Shell::GetScreen()->AddObserver(this); | 73 ash::Shell::GetScreen()->AddObserver(this); |
| 74 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); | 74 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); |
| 75 | 75 |
| 76 if (keyboard::KeyboardController::GetInstance()) { | 76 if (keyboard::KeyboardController::GetInstance()) { |
| 77 keyboard::KeyboardController::GetInstance()->AddObserver(this); | 77 keyboard::KeyboardController::GetInstance()->AddObserver(this); |
| 78 is_observing_keyboard_ = true; | 78 is_observing_keyboard_ = true; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 void WebUIScreenLocker::LockScreen() { | 82 void WebUIScreenLocker::LockScreen() { |
| 83 gfx::Rect bounds = | 83 gfx::Rect bounds = gfx::Screen::GetScreen()->GetPrimaryDisplay().bounds(); |
| 84 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds(); | |
| 85 | 84 |
| 86 lock_time_ = base::TimeTicks::Now(); | 85 lock_time_ = base::TimeTicks::Now(); |
| 87 LockWindow* lock_window = LockWindow::Create(); | 86 LockWindow* lock_window = LockWindow::Create(); |
| 88 lock_window->set_observer(this); | 87 lock_window->set_observer(this); |
| 89 lock_window->set_initially_focused_view(this); | 88 lock_window->set_initially_focused_view(this); |
| 90 lock_window_ = lock_window->GetWidget(); | 89 lock_window_ = lock_window->GetWidget(); |
| 91 lock_window_->AddObserver(this); | 90 lock_window_->AddObserver(this); |
| 92 WebUILoginView::Init(); | 91 WebUILoginView::Init(); |
| 93 content::WebContentsObserver::Observe(webui_login_->GetWebContents()); | 92 content::WebContentsObserver::Observe(webui_login_->GetWebContents()); |
| 94 lock_window_->SetContentsView(this); | 93 lock_window_->SetContentsView(this); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 // gfx::DisplayObserver: | 388 // gfx::DisplayObserver: |
| 390 | 389 |
| 391 void WebUIScreenLocker::OnDisplayAdded(const gfx::Display& new_display) { | 390 void WebUIScreenLocker::OnDisplayAdded(const gfx::Display& new_display) { |
| 392 } | 391 } |
| 393 | 392 |
| 394 void WebUIScreenLocker::OnDisplayRemoved(const gfx::Display& old_display) { | 393 void WebUIScreenLocker::OnDisplayRemoved(const gfx::Display& old_display) { |
| 395 } | 394 } |
| 396 | 395 |
| 397 void WebUIScreenLocker::OnDisplayMetricsChanged(const gfx::Display& display, | 396 void WebUIScreenLocker::OnDisplayMetricsChanged(const gfx::Display& display, |
| 398 uint32_t changed_metrics) { | 397 uint32_t changed_metrics) { |
| 399 gfx::Display primary_display = | 398 gfx::Display primary_display = gfx::Screen::GetScreen()->GetPrimaryDisplay(); |
| 400 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); | |
| 401 if (display.id() != primary_display.id() || | 399 if (display.id() != primary_display.id() || |
| 402 !(changed_metrics & DISPLAY_METRIC_BOUNDS)) { | 400 !(changed_metrics & DISPLAY_METRIC_BOUNDS)) { |
| 403 return; | 401 return; |
| 404 } | 402 } |
| 405 | 403 |
| 406 if (GetOobeUI()) { | 404 if (GetOobeUI()) { |
| 407 const gfx::Size& size = primary_display.size(); | 405 const gfx::Size& size = primary_display.size(); |
| 408 GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(), | 406 GetOobeUI()->GetCoreOobeActor()->SetClientAreaSize(size.width(), |
| 409 size.height()); | 407 size.height()); |
| 410 } | 408 } |
| 411 } | 409 } |
| 412 | 410 |
| 413 } // namespace chromeos | 411 } // namespace chromeos |
| OLD | NEW |