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 <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // Make sure there is no gtk grab widget so that gtk simply propagates | 319 // Make sure there is no gtk grab widget so that gtk simply propagates |
320 // an event. This is necessary to allow message bubble and password | 320 // an event. This is necessary to allow message bubble and password |
321 // field, button to process events simultaneously. GTK | 321 // field, button to process events simultaneously. GTK |
322 // maintains grab widgets in a linked-list, so we need to remove | 322 // maintains grab widgets in a linked-list, so we need to remove |
323 // until it's empty. | 323 // until it's empty. |
324 while ((current_grab_window = gtk_grab_get_current()) != NULL) | 324 while ((current_grab_window = gtk_grab_get_current()) != NULL) |
325 gtk_grab_remove(current_grab_window); | 325 gtk_grab_remove(current_grab_window); |
326 } | 326 } |
327 | 327 |
328 virtual gboolean OnKeyEvent(GtkWidget* widget, GdkEventKey* event) { | 328 virtual gboolean OnKeyEvent(GtkWidget* widget, GdkEventKey* event) { |
329 views::KeyEvent key_event(event); | 329 views::KeyEvent key_event(reinterpret_cast<GdkEvent*>(event)); |
330 // This is a hack to workaround the issue crosbug.com/10655 due to | 330 // This is a hack to workaround the issue crosbug.com/10655 due to |
331 // the limitation that a focus manager cannot handle views in | 331 // the limitation that a focus manager cannot handle views in |
332 // TYPE_CHILD WidgetGtk correctly. | 332 // TYPE_CHILD WidgetGtk correctly. |
333 if (signout_link_ && | 333 if (signout_link_ && |
334 event->type == GDK_KEY_PRESS && | 334 event->type == GDK_KEY_PRESS && |
335 (event->keyval == GDK_Tab || | 335 (event->keyval == GDK_Tab || |
336 event->keyval == GDK_ISO_Left_Tab || | 336 event->keyval == GDK_ISO_Left_Tab || |
337 event->keyval == GDK_KP_Tab)) { | 337 event->keyval == GDK_KP_Tab)) { |
338 DCHECK(shutdown_); | 338 DCHECK(shutdown_); |
339 bool reverse = event->state & GDK_SHIFT_MASK; | 339 bool reverse = event->state & GDK_SHIFT_MASK; |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 | 1154 |
1155 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 1155 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
1156 if (!background_view_->IsScreenSaverVisible()) { | 1156 if (!background_view_->IsScreenSaverVisible()) { |
1157 StartScreenSaver(); | 1157 StartScreenSaver(); |
1158 return true; | 1158 return true; |
1159 } | 1159 } |
1160 return false; | 1160 return false; |
1161 } | 1161 } |
1162 | 1162 |
1163 } // namespace chromeos | 1163 } // namespace chromeos |
OLD | NEW |