| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gdkx.h> | 7 #include <gdk/gdkx.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <X11/extensions/XTest.h> | 10 #include <X11/extensions/XTest.h> |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 //////////////////////////////////////////////////////////////////////////////// | 987 //////////////////////////////////////////////////////////////////////////////// |
| 988 // ScreenLocker, private: | 988 // ScreenLocker, private: |
| 989 | 989 |
| 990 ScreenLocker::~ScreenLocker() { | 990 ScreenLocker::~ScreenLocker() { |
| 991 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); | 991 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); |
| 992 ClearErrors(); | 992 ClearErrors(); |
| 993 if (input_event_observer_.get()) | 993 if (input_event_observer_.get()) |
| 994 MessageLoopForUI::current()->RemoveObserver(input_event_observer_.get()); | 994 MessageLoopForUI::current()->RemoveObserver(input_event_observer_.get()); |
| 995 if (locker_input_event_observer_.get()) { | 995 if (locker_input_event_observer_.get()) { |
| 996 lock_widget_->GetFocusManager()->UnregisterAccelerator( | 996 lock_widget_->GetFocusManager()->UnregisterAccelerator( |
| 997 views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); | 997 views::Accelerator(ui::VKEY_ESCAPE, false, false, false), this); |
| 998 MessageLoopForUI::current()->RemoveObserver( | 998 MessageLoopForUI::current()->RemoveObserver( |
| 999 locker_input_event_observer_.get()); | 999 locker_input_event_observer_.get()); |
| 1000 } | 1000 } |
| 1001 | 1001 |
| 1002 gdk_keyboard_ungrab(GDK_CURRENT_TIME); | 1002 gdk_keyboard_ungrab(GDK_CURRENT_TIME); |
| 1003 gdk_pointer_ungrab(GDK_CURRENT_TIME); | 1003 gdk_pointer_ungrab(GDK_CURRENT_TIME); |
| 1004 | 1004 |
| 1005 DCHECK(lock_window_); | 1005 DCHECK(lock_window_); |
| 1006 VLOG(1) << "~ScreenLocker(): Closing ScreenLocker window."; | 1006 VLOG(1) << "~ScreenLocker(): Closing ScreenLocker window."; |
| 1007 lock_window_->Close(); | 1007 lock_window_->Close(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1022 | 1022 |
| 1023 void ScreenLocker::ScreenLockReady() { | 1023 void ScreenLocker::ScreenLockReady() { |
| 1024 VLOG(1) << "ScreenLockReady: sending completed signal to power manager."; | 1024 VLOG(1) << "ScreenLockReady: sending completed signal to power manager."; |
| 1025 locked_ = true; | 1025 locked_ = true; |
| 1026 base::TimeDelta delta = base::Time::Now() - start_time_; | 1026 base::TimeDelta delta = base::Time::Now() - start_time_; |
| 1027 VLOG(1) << "Screen lock time: " << delta.InSecondsF(); | 1027 VLOG(1) << "Screen lock time: " << delta.InSecondsF(); |
| 1028 UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta); | 1028 UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta); |
| 1029 | 1029 |
| 1030 if (background_view_->ScreenSaverEnabled()) { | 1030 if (background_view_->ScreenSaverEnabled()) { |
| 1031 lock_widget_->GetFocusManager()->RegisterAccelerator( | 1031 lock_widget_->GetFocusManager()->RegisterAccelerator( |
| 1032 views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); | 1032 views::Accelerator(ui::VKEY_ESCAPE, false, false, false), this); |
| 1033 locker_input_event_observer_.reset(new LockerInputEventObserver(this)); | 1033 locker_input_event_observer_.reset(new LockerInputEventObserver(this)); |
| 1034 MessageLoopForUI::current()->AddObserver( | 1034 MessageLoopForUI::current()->AddObserver( |
| 1035 locker_input_event_observer_.get()); | 1035 locker_input_event_observer_.get()); |
| 1036 } else { | 1036 } else { |
| 1037 // Don't enable the password field until we grab all inputs. | 1037 // Don't enable the password field until we grab all inputs. |
| 1038 EnableInput(); | 1038 EnableInput(); |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 bool state = true; | 1041 bool state = true; |
| 1042 NotificationService::current()->Notify( | 1042 NotificationService::current()->Notify( |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 | 1117 |
| 1118 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 1118 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 1119 if (!background_view_->IsScreenSaverVisible()) { | 1119 if (!background_view_->IsScreenSaverVisible()) { |
| 1120 StartScreenSaver(); | 1120 StartScreenSaver(); |
| 1121 return true; | 1121 return true; |
| 1122 } | 1122 } |
| 1123 return false; | 1123 return false; |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 } // namespace chromeos | 1126 } // namespace chromeos |
| OLD | NEW |