| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 223 } |
| 224 | 224 |
| 225 virtual void ClearNativeFocus() OVERRIDE { | 225 virtual void ClearNativeFocus() OVERRIDE { |
| 226 DCHECK(toplevel_focus_widget_); | 226 DCHECK(toplevel_focus_widget_); |
| 227 gtk_widget_grab_focus(toplevel_focus_widget_); | 227 gtk_widget_grab_focus(toplevel_focus_widget_); |
| 228 } | 228 } |
| 229 | 229 |
| 230 // Sets the widget to move the focus to when clearning the native | 230 // Sets the widget to move the focus to when clearning the native |
| 231 // widget's focus. | 231 // widget's focus. |
| 232 void set_toplevel_focus_widget(GtkWidget* widget) { | 232 void set_toplevel_focus_widget(GtkWidget* widget) { |
| 233 GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); | 233 gtk_widget_set_can_focus(widget, TRUE); |
| 234 toplevel_focus_widget_ = widget; | 234 toplevel_focus_widget_ = widget; |
| 235 } | 235 } |
| 236 | 236 |
| 237 private: | 237 private: |
| 238 // The widget we set focus to when clearning the focus on native | 238 // The widget we set focus to when clearning the focus on native |
| 239 // widget. In screen locker, gdk input is grabbed in GrabWidget, | 239 // widget. In screen locker, gdk input is grabbed in GrabWidget, |
| 240 // and resetting the focus by using gtk_window_set_focus seems to | 240 // and resetting the focus by using gtk_window_set_focus seems to |
| 241 // confuse gtk and doesn't let focus move to native widget under | 241 // confuse gtk and doesn't let focus move to native widget under |
| 242 // GrabWidget. | 242 // GrabWidget. |
| 243 GtkWidget* toplevel_focus_widget_; | 243 GtkWidget* toplevel_focus_widget_; |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 | 1223 |
| 1224 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 1224 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 1225 if (!background_view_->IsScreenSaverVisible()) { | 1225 if (!background_view_->IsScreenSaverVisible()) { |
| 1226 StartScreenSaver(); | 1226 StartScreenSaver(); |
| 1227 return true; | 1227 return true; |
| 1228 } | 1228 } |
| 1229 return false; | 1229 return false; |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 } // namespace chromeos | 1232 } // namespace chromeos |
| OLD | NEW |