| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 //////////////////////////////////////////////////////////////////////////////// | 711 //////////////////////////////////////////////////////////////////////////////// |
| 712 // ScreenLocker, private: | 712 // ScreenLocker, private: |
| 713 | 713 |
| 714 ScreenLocker::~ScreenLocker() { | 714 ScreenLocker::~ScreenLocker() { |
| 715 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); | 715 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); |
| 716 ClearErrors(); | 716 ClearErrors(); |
| 717 if (input_event_observer_.get()) | 717 if (input_event_observer_.get()) |
| 718 MessageLoopForUI::current()->RemoveObserver(input_event_observer_.get()); | 718 MessageLoopForUI::current()->RemoveObserver(input_event_observer_.get()); |
| 719 if (locker_input_event_observer_.get()) { | 719 if (locker_input_event_observer_.get()) { |
| 720 lock_widget_->GetFocusManager()->UnregisterAccelerator( | 720 lock_widget_->GetFocusManager()->UnregisterAccelerator( |
| 721 views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); | 721 views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); |
| 722 MessageLoopForUI::current()->RemoveObserver( | 722 MessageLoopForUI::current()->RemoveObserver( |
| 723 locker_input_event_observer_.get()); | 723 locker_input_event_observer_.get()); |
| 724 } | 724 } |
| 725 | 725 |
| 726 gdk_keyboard_ungrab(GDK_CURRENT_TIME); | 726 gdk_keyboard_ungrab(GDK_CURRENT_TIME); |
| 727 gdk_pointer_ungrab(GDK_CURRENT_TIME); | 727 gdk_pointer_ungrab(GDK_CURRENT_TIME); |
| 728 | 728 |
| 729 DCHECK(lock_window_); | 729 DCHECK(lock_window_); |
| 730 LOG(INFO) << "~ScreenLocker(): Closing ScreenLocker window"; | 730 LOG(INFO) << "~ScreenLocker(): Closing ScreenLocker window"; |
| 731 lock_window_->Close(); | 731 lock_window_->Close(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 743 void ScreenLocker::SetAuthenticator(Authenticator* authenticator) { | 743 void ScreenLocker::SetAuthenticator(Authenticator* authenticator) { |
| 744 authenticator_ = authenticator; | 744 authenticator_ = authenticator; |
| 745 } | 745 } |
| 746 | 746 |
| 747 void ScreenLocker::ScreenLockReady() { | 747 void ScreenLocker::ScreenLockReady() { |
| 748 LOG(INFO) << "ScreenLockReady: sending completed signal to power manager."; | 748 LOG(INFO) << "ScreenLockReady: sending completed signal to power manager."; |
| 749 // Don't show the password field until we grab all inputs. | 749 // Don't show the password field until we grab all inputs. |
| 750 lock_widget_->GetRootView()->SetVisible(true); | 750 lock_widget_->GetRootView()->SetVisible(true); |
| 751 if (background_view_->ScreenSaverEnabled()) { | 751 if (background_view_->ScreenSaverEnabled()) { |
| 752 lock_widget_->GetFocusManager()->RegisterAccelerator( | 752 lock_widget_->GetFocusManager()->RegisterAccelerator( |
| 753 views::Accelerator(app::VKEY_ESCAPE, false, false, false), this); | 753 views::Accelerator(base::VKEY_ESCAPE, false, false, false), this); |
| 754 locker_input_event_observer_.reset(new LockerInputEventObserver(this)); | 754 locker_input_event_observer_.reset(new LockerInputEventObserver(this)); |
| 755 MessageLoopForUI::current()->AddObserver( | 755 MessageLoopForUI::current()->AddObserver( |
| 756 locker_input_event_observer_.get()); | 756 locker_input_event_observer_.get()); |
| 757 StartScreenSaver(); | 757 StartScreenSaver(); |
| 758 } else { | 758 } else { |
| 759 EnableInput(); | 759 EnableInput(); |
| 760 } | 760 } |
| 761 | 761 |
| 762 bool state = true; | 762 bool state = true; |
| 763 NotificationService::current()->Notify( | 763 NotificationService::current()->Notify( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 | 809 |
| 810 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { | 810 bool ScreenLocker::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 811 if (!background_view_->IsScreenSaverVisible()) { | 811 if (!background_view_->IsScreenSaverVisible()) { |
| 812 StartScreenSaver(); | 812 StartScreenSaver(); |
| 813 return true; | 813 return true; |
| 814 } | 814 } |
| 815 return false; | 815 return false; |
| 816 } | 816 } |
| 817 | 817 |
| 818 } // namespace chromeos | 818 } // namespace chromeos |
| OLD | NEW |