OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/power/suspend_observer.h" | 5 #include "chrome/browser/chromeos/power/suspend_observer.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/user_activity_detector.h" | 8 #include "ash/wm/user_activity_detector.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/chromeos/login/user_manager.h" | 10 #include "chrome/browser/chromeos/login/user_manager.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 void SuspendObserver::ScreenIsLocked() { | 51 void SuspendObserver::ScreenIsLocked() { |
52 screen_locked_ = true; | 52 screen_locked_ = true; |
53 | 53 |
54 // Stop blocking suspend after the screen is locked. | 54 // Stop blocking suspend after the screen is locked. |
55 if (!screen_lock_callback_.is_null()) { | 55 if (!screen_lock_callback_.is_null()) { |
56 LOG(WARNING) << "Locking screen due to suspend."; | 56 LOG(WARNING) << "Locking screen due to suspend."; |
57 // Run the callback asynchronously. ScreenIsLocked() is currently | 57 // Run the callback asynchronously. ScreenIsLocked() is currently |
58 // called asynchronously after RequestLockScreen(), but this guards | 58 // called asynchronously after RequestLockScreen(), but this guards |
59 // against it being made synchronous later. | 59 // against it being made synchronous later. |
60 MessageLoop::current()->PostTask(FROM_HERE, screen_lock_callback_); | 60 base::MessageLoop::current()->PostTask(FROM_HERE, screen_lock_callback_); |
61 screen_lock_callback_.Reset(); | 61 screen_lock_callback_.Reset(); |
62 } else { | 62 } else { |
63 LOG(WARNING) << "Locking screen without suspend."; | 63 LOG(WARNING) << "Locking screen without suspend."; |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 void SuspendObserver::ScreenIsUnlocked() { | 67 void SuspendObserver::ScreenIsUnlocked() { |
68 screen_locked_ = false; | 68 screen_locked_ = false; |
69 } | 69 } |
70 | 70 |
71 } // namespace chromeos | 71 } // namespace chromeos |
OLD | NEW |