| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <X11/extensions/XTest.h> | 7 #include <X11/extensions/XTest.h> |
| 8 #include <X11/keysym.h> | 8 #include <X11/keysym.h> |
| 9 #include <gdk/gdkkeysyms.h> | 9 #include <gdk/gdkkeysyms.h> |
| 10 #include <gdk/gdkx.h> | 10 #include <gdk/gdkx.h> |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 // Add the window to its own group so that its grab won't be stolen if | 789 // Add the window to its own group so that its grab won't be stolen if |
| 790 // gtk_grab_add() gets called on behalf on a non-screen-locker widget (e.g. | 790 // gtk_grab_add() gets called on behalf on a non-screen-locker widget (e.g. |
| 791 // a modal dialog) -- see http://crosbug.com/8999. We intentionally do this | 791 // a modal dialog) -- see http://crosbug.com/8999. We intentionally do this |
| 792 // after calling ClearGtkGrab(), as want to be in the default window group | 792 // after calling ClearGtkGrab(), as want to be in the default window group |
| 793 // then so we can break any existing GTK grabs. | 793 // then so we can break any existing GTK grabs. |
| 794 GtkWindowGroup* window_group = gtk_window_group_new(); | 794 GtkWindowGroup* window_group = gtk_window_group_new(); |
| 795 gtk_window_group_add_window(window_group, | 795 gtk_window_group_add_window(window_group, |
| 796 GTK_WINDOW(lock_window_->GetNativeView())); | 796 GTK_WINDOW(lock_window_->GetNativeView())); |
| 797 g_object_unref(window_group); | 797 g_object_unref(window_group); |
| 798 | 798 |
| 799 // Don't let X draw default background, which was causing flash on | |
| 800 // resume. | |
| 801 gdk_window_set_back_pixmap(lock_window_->GetNativeView()->window, | |
| 802 NULL, false); | |
| 803 gdk_window_set_back_pixmap(lock_widget_->GetNativeView()->window, | |
| 804 NULL, false); | |
| 805 lock_window->set_toplevel_focus_widget(lock_widget_->window_contents()); | 799 lock_window->set_toplevel_focus_widget(lock_widget_->window_contents()); |
| 806 | 800 |
| 807 // Create the SystemKeyEventListener so it can listen for system keyboard | 801 // Create the SystemKeyEventListener so it can listen for system keyboard |
| 808 // messages regardless of focus while screen locked. | 802 // messages regardless of focus while screen locked. |
| 809 SystemKeyEventListener::GetInstance(); | 803 SystemKeyEventListener::GetInstance(); |
| 810 } | 804 } |
| 811 | 805 |
| 812 void ScreenLocker::OnLoginFailure(const LoginFailure& error) { | 806 void ScreenLocker::OnLoginFailure(const LoginFailure& error) { |
| 813 DVLOG(1) << "OnLoginFailure"; | 807 DVLOG(1) << "OnLoginFailure"; |
| 814 UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure")); | 808 UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure")); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 | 1182 |
| 1189 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 1183 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 1190 if (!background_view_->IsScreenSaverVisible()) { | 1184 if (!background_view_->IsScreenSaverVisible()) { |
| 1191 StartScreenSaver(); | 1185 StartScreenSaver(); |
| 1192 return true; | 1186 return true; |
| 1193 } | 1187 } |
| 1194 return false; | 1188 return false; |
| 1195 } | 1189 } |
| 1196 | 1190 |
| 1197 } // namespace chromeos | 1191 } // namespace chromeos |
| OLD | NEW |