Chromium Code Reviews| 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 void ScreenLocker::Init() { | 686 void ScreenLocker::Init() { |
| 687 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 687 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
| 688 | 688 |
| 689 gfx::Point left_top(1, 1); | 689 gfx::Point left_top(1, 1); |
| 690 gfx::Rect init_bounds(views::Screen::GetMonitorAreaNearestPoint(left_top)); | 690 gfx::Rect init_bounds(views::Screen::GetMonitorAreaNearestPoint(left_top)); |
| 691 | 691 |
| 692 LockWindow* lock_window = new LockWindow(); | 692 LockWindow* lock_window = new LockWindow(); |
| 693 lock_window_ = lock_window; | 693 lock_window_ = lock_window; |
| 694 lock_window_->Init(NULL, init_bounds); | 694 lock_window_->Init(NULL, init_bounds); |
| 695 | 695 |
| 696 // Disables input method explicitly, because: | |
| 697 // 1. Input method only works when top-level Widget gets keyboard focus. | |
| 698 // 2. Screen Locker shouldn't allow the user to use input method. | |
| 699 lock_window_->native_widget()->ReplaceInputMethod(NULL); | |
|
oshima
2011/03/30 21:51:25
chromeos screen locker doesn't use TextfieldViews.
James Su
2011/03/30 22:46:39
I think we can remove this piece of code if we are
| |
| 700 | |
| 696 g_signal_connect(lock_window_->GetNativeView(), "client-event", | 701 g_signal_connect(lock_window_->GetNativeView(), "client-event", |
| 697 G_CALLBACK(OnClientEventThunk), this); | 702 G_CALLBACK(OnClientEventThunk), this); |
| 698 | 703 |
| 699 // GTK does not like zero width/height. | 704 // GTK does not like zero width/height. |
| 700 if (!unlock_on_input_) { | 705 if (!unlock_on_input_) { |
| 701 screen_lock_view_ = new ScreenLockView(this); | 706 screen_lock_view_ = new ScreenLockView(this); |
| 702 screen_lock_view_->Init(); | 707 screen_lock_view_->Init(); |
| 703 screen_lock_view_->SetEnabled(false); | 708 screen_lock_view_->SetEnabled(false); |
| 704 screen_lock_view_->StartThrobber(); | 709 screen_lock_view_->StartThrobber(); |
| 705 } else { | 710 } else { |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1148 | 1153 |
| 1149 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 1154 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 1150 if (!background_view_->IsScreenSaverVisible()) { | 1155 if (!background_view_->IsScreenSaverVisible()) { |
| 1151 StartScreenSaver(); | 1156 StartScreenSaver(); |
| 1152 return true; | 1157 return true; |
| 1153 } | 1158 } |
| 1154 return false; | 1159 return false; |
| 1155 } | 1160 } |
| 1156 | 1161 |
| 1157 } // namespace chromeos | 1162 } // namespace chromeos |
| OLD | NEW |