| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/chromeos/cros/input_method_library.h" | 22 #include "chrome/browser/chromeos/cros/input_method_library.h" |
| 23 #include "chrome/browser/chromeos/cros/keyboard_library.h" | 23 #include "chrome/browser/chromeos/cros/keyboard_library.h" |
| 24 #include "chrome/browser/chromeos/cros/login_library.h" | 24 #include "chrome/browser/chromeos/cros/login_library.h" |
| 25 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 25 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 26 #include "chrome/browser/chromeos/language_preferences.h" | 26 #include "chrome/browser/chromeos/language_preferences.h" |
| 27 #include "chrome/browser/chromeos/login/authenticator.h" | 27 #include "chrome/browser/chromeos/login/authenticator.h" |
| 28 #include "chrome/browser/chromeos/login/background_view.h" | 28 #include "chrome/browser/chromeos/login/background_view.h" |
| 29 #include "chrome/browser/chromeos/login/login_utils.h" | 29 #include "chrome/browser/chromeos/login/login_utils.h" |
| 30 #include "chrome/browser/chromeos/login/message_bubble.h" | 30 #include "chrome/browser/chromeos/login/message_bubble.h" |
| 31 #include "chrome/browser/chromeos/login/screen_lock_view.h" | 31 #include "chrome/browser/chromeos/login/screen_lock_view.h" |
| 32 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 32 #include "chrome/browser/chromeos/wm_ipc.h" | 33 #include "chrome/browser/chromeos/wm_ipc.h" |
| 33 #include "chrome/browser/metrics/user_metrics.h" | 34 #include "chrome/browser/metrics/user_metrics.h" |
| 34 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/notification_service.h" | 36 #include "chrome/common/notification_service.h" |
| 36 #include "cros/chromeos_wm_ipc_enums.h" | 37 #include "cros/chromeos_wm_ipc_enums.h" |
| 37 #include "googleurl/src/gurl.h" | 38 #include "googleurl/src/gurl.h" |
| 38 #include "grit/generated_resources.h" | 39 #include "grit/generated_resources.h" |
| 39 #include "grit/theme_resources.h" | 40 #include "grit/theme_resources.h" |
| 40 #include "views/screen.h" | 41 #include "views/screen.h" |
| 41 #include "views/widget/root_view.h" | 42 #include "views/widget/root_view.h" |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 lock_window_->SetContentsView(background_view_); | 561 lock_window_->SetContentsView(background_view_); |
| 561 lock_window_->Show(); | 562 lock_window_->Show(); |
| 562 | 563 |
| 563 // Don't let X draw default background, which was causing flash on | 564 // Don't let X draw default background, which was causing flash on |
| 564 // resume. | 565 // resume. |
| 565 gdk_window_set_back_pixmap(lock_window_->GetNativeView()->window, | 566 gdk_window_set_back_pixmap(lock_window_->GetNativeView()->window, |
| 566 NULL, false); | 567 NULL, false); |
| 567 gdk_window_set_back_pixmap(lock_widget_->GetNativeView()->window, | 568 gdk_window_set_back_pixmap(lock_widget_->GetNativeView()->window, |
| 568 NULL, false); | 569 NULL, false); |
| 569 lock_window->set_toplevel_focus_widget(lock_widget_->window_contents()); | 570 lock_window->set_toplevel_focus_widget(lock_widget_->window_contents()); |
| 571 |
| 572 // Create the SystemKeyEventListener so it can listen for system keyboard |
| 573 // messages regardless of focus while screen locked. |
| 574 SystemKeyEventListener::instance(); |
| 570 } | 575 } |
| 571 | 576 |
| 572 void ScreenLocker::OnLoginFailure(const LoginFailure& error) { | 577 void ScreenLocker::OnLoginFailure(const LoginFailure& error) { |
| 573 DVLOG(1) << "OnLoginFailure"; | 578 DVLOG(1) << "OnLoginFailure"; |
| 574 EnableInput(); | 579 EnableInput(); |
| 575 // Don't enable signout button here as we're showing | 580 // Don't enable signout button here as we're showing |
| 576 // MessageBubble. | 581 // MessageBubble. |
| 577 gfx::Rect rect = screen_lock_view_->GetPasswordBoundsRelativeTo( | 582 gfx::Rect rect = screen_lock_view_->GetPasswordBoundsRelativeTo( |
| 578 lock_widget_->GetRootView()); | 583 lock_widget_->GetRootView()); |
| 579 gfx::Rect lock_widget_bounds; | 584 gfx::Rect lock_widget_bounds; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 | 837 |
| 833 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 838 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 834 if (!background_view_->IsScreenSaverVisible()) { | 839 if (!background_view_->IsScreenSaverVisible()) { |
| 835 StartScreenSaver(); | 840 StartScreenSaver(); |
| 836 return true; | 841 return true; |
| 837 } | 842 } |
| 838 return false; | 843 return false; |
| 839 } | 844 } |
| 840 | 845 |
| 841 } // namespace chromeos | 846 } // namespace chromeos |
| OLD | NEW |