| 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/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/chromeos/power/power_event_observer.h" | 9 #include "ash/system/chromeos/power/power_event_observer.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // WidgetObserver: | 374 // WidgetObserver: |
| 375 | 375 |
| 376 void WebUIScreenLocker::OnWidgetDestroying(views::Widget* widget) { | 376 void WebUIScreenLocker::OnWidgetDestroying(views::Widget* widget) { |
| 377 lock_window_->RemoveObserver(this); | 377 lock_window_->RemoveObserver(this); |
| 378 lock_window_ = NULL; | 378 lock_window_ = NULL; |
| 379 } | 379 } |
| 380 | 380 |
| 381 //////////////////////////////////////////////////////////////////////////////// | 381 //////////////////////////////////////////////////////////////////////////////// |
| 382 // PowerManagerClient::Observer: | 382 // PowerManagerClient::Observer: |
| 383 | 383 |
| 384 void WebUIScreenLocker::LidEventReceived(bool open, | 384 void WebUIScreenLocker::LidEventReceived(PowerManagerClient::LidState state, |
| 385 const base::TimeTicks& time) { | 385 const base::TimeTicks& time) { |
| 386 if (open) { | 386 if (state == PowerManagerClient::LidState::OPEN) { |
| 387 content::BrowserThread::PostTask( | 387 content::BrowserThread::PostTask( |
| 388 content::BrowserThread::UI, FROM_HERE, | 388 content::BrowserThread::UI, FROM_HERE, |
| 389 base::Bind(&WebUIScreenLocker::FocusUserPod, | 389 base::Bind(&WebUIScreenLocker::FocusUserPod, |
| 390 weak_factory_.GetWeakPtr())); | 390 weak_factory_.GetWeakPtr())); |
| 391 } | 391 } |
| 392 } | 392 } |
| 393 | 393 |
| 394 void WebUIScreenLocker::SuspendImminent() { | 394 void WebUIScreenLocker::SuspendImminent() { |
| 395 content::BrowserThread::PostTask( | 395 content::BrowserThread::PostTask( |
| 396 content::BrowserThread::UI, FROM_HERE, | 396 content::BrowserThread::UI, FROM_HERE, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } | 471 } |
| 472 | 472 |
| 473 if (GetOobeUI()) { | 473 if (GetOobeUI()) { |
| 474 const gfx::Size& size = primary_display.size(); | 474 const gfx::Size& size = primary_display.size(); |
| 475 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(), | 475 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(), |
| 476 size.height()); | 476 size.height()); |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace chromeos | 480 } // namespace chromeos |
| OLD | NEW |