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

Unified Diff: chrome/browser/chromeos/login/screen_locker.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/helper.cc ('k') | chrome/browser/chromeos/login/user_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/screen_locker.cc
===================================================================
--- chrome/browser/chromeos/login/screen_locker.cc (revision 85284)
+++ chrome/browser/chromeos/login/screen_locker.cc (working copy)
@@ -198,7 +198,9 @@
// focus/events inside the grab widget.
class LockWindow : public views::WidgetGtk {
public:
- LockWindow() : toplevel_focus_widget_(NULL) {
+ LockWindow()
+ : views::WidgetGtk(new views::Widget),
+ toplevel_focus_widget_(NULL) {
EnableDoubleBuffer(true);
}
@@ -289,7 +291,8 @@
class GrabWidget : public views::WidgetGtk {
public:
explicit GrabWidget(chromeos::ScreenLocker* screen_locker)
- : screen_locker_(screen_locker),
+ : views::WidgetGtk(new views::Widget),
+ screen_locker_(screen_locker),
ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)),
grab_failure_count_(0),
kbd_grab_status_(GDK_GRAB_INVALID_TIME),
@@ -730,9 +733,10 @@
gfx::Rect init_bounds(views::Screen::GetMonitorAreaNearestPoint(left_top));
LockWindow* lock_window = new LockWindow();
- lock_window_ = lock_window;
+ lock_window_ = lock_window->GetWidget();
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
params.bounds = init_bounds;
+ params.native_widget = lock_window;
lock_window_->Init(params);
gtk_widget_modify_bg(
lock_window_->GetNativeView(), GTK_STATE_NORMAL, &kGdkBlack);
@@ -755,12 +759,13 @@
// TryGrabAllInputs() method later. (Nobody else needs to use it, so moving
// its declaration to the header instead of keeping it in an anonymous
// namespace feels a bit ugly.)
- GrabWidget* cast_lock_widget = new GrabWidget(this);
- lock_widget_ = cast_lock_widget;
+ GrabWidget* grab_widget = new GrabWidget(this);
+ lock_widget_ = grab_widget->GetWidget();
views::Widget::InitParams lock_params(
views::Widget::InitParams::TYPE_CONTROL);
lock_params.transparent = true;
lock_params.parent_widget = lock_window_;
+ lock_params.native_widget = grab_widget;
lock_widget_->Init(lock_params);
if (screen_lock_view_) {
GrabWidgetRootView* root_view = new GrabWidgetRootView(screen_lock_view_);
@@ -790,11 +795,11 @@
lock_window_->SetContentsView(background_view_);
lock_window_->Show();
- cast_lock_widget->ClearGtkGrab();
+ grab_widget->ClearGtkGrab();
// Call this after lock_window_->Show(); otherwise the 1st invocation
// of gdk_xxx_grab() will always fail.
- cast_lock_widget->TryGrabAllInputs();
+ grab_widget->TryGrabAllInputs();
// Add the window to its own group so that its grab won't be stolen if
// gtk_grab_add() gets called on behalf on a non-screen-locker widget (e.g.
« no previous file with comments | « chrome/browser/chromeos/login/helper.cc ('k') | chrome/browser/chromeos/login/user_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698