Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(843)

Side by Side Diff: chrome/browser/chromeos/login/screen_locker.cc

Issue 7227027: GTK: More 2.18 goodness. Move from macros to real accessor functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove views/ Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/native_dialog_window.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 223
224 virtual void ClearNativeFocus() OVERRIDE { 224 virtual void ClearNativeFocus() OVERRIDE {
225 DCHECK(toplevel_focus_widget_); 225 DCHECK(toplevel_focus_widget_);
226 gtk_widget_grab_focus(toplevel_focus_widget_); 226 gtk_widget_grab_focus(toplevel_focus_widget_);
227 } 227 }
228 228
229 // Sets the widget to move the focus to when clearning the native 229 // Sets the widget to move the focus to when clearning the native
230 // widget's focus. 230 // widget's focus.
231 void set_toplevel_focus_widget(GtkWidget* widget) { 231 void set_toplevel_focus_widget(GtkWidget* widget) {
232 GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); 232 gtk_widget_set_can_focus(widget, TRUE);
233 toplevel_focus_widget_ = widget; 233 toplevel_focus_widget_ = widget;
234 } 234 }
235 235
236 private: 236 private:
237 // The widget we set focus to when clearning the focus on native 237 // The widget we set focus to when clearning the focus on native
238 // widget. In screen locker, gdk input is grabbed in GrabWidget, 238 // widget. In screen locker, gdk input is grabbed in GrabWidget,
239 // and resetting the focus by using gtk_window_set_focus seems to 239 // and resetting the focus by using gtk_window_set_focus seems to
240 // confuse gtk and doesn't let focus move to native widget under 240 // confuse gtk and doesn't let focus move to native widget under
241 // GrabWidget. 241 // GrabWidget.
242 GtkWidget* toplevel_focus_widget_; 242 GtkWidget* toplevel_focus_widget_;
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 1222
1223 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { 1223 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) {
1224 if (!background_view_->IsScreenSaverVisible()) { 1224 if (!background_view_->IsScreenSaverVisible()) {
1225 StartScreenSaver(); 1225 StartScreenSaver();
1226 return true; 1226 return true;
1227 } 1227 }
1228 return false; 1228 return false;
1229 } 1229 }
1230 1230
1231 } // namespace chromeos 1231 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/native_dialog_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698