OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_TODAY_EXTENSION_LOCK_SCREEN_STATE_H_ |
| 6 #define IOS_CHROME_TODAY_EXTENSION_LOCK_SCREEN_STATE_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 @protocol LockScreenStateDelegate; |
| 11 |
| 12 // A shared object to track screen lock state. Object is statically allocated |
| 13 // to get notification even when widget is not displayed. |
| 14 @interface LockScreenState : NSObject |
| 15 |
| 16 + (instancetype)sharedInstance; |
| 17 |
| 18 // Whether or not the screen is currently locked. |
| 19 // The value can be temporary |NO| on lock screen if the widget is allocated |
| 20 // in the 10 seconds following the lock. |
| 21 @property(nonatomic, readonly) BOOL isScreenLocked; |
| 22 |
| 23 // Sets the delegate to receive future |lockScreenStateDidChange:| |
| 24 // notifications. |
| 25 - (void)setDelegate:(id<LockScreenStateDelegate>)delegate; |
| 26 |
| 27 @end |
| 28 |
| 29 @protocol LockScreenStateDelegate<NSObject> |
| 30 |
| 31 - (void)lockScreenStateDidChange:(LockScreenState*)lockScreenState; |
| 32 |
| 33 @end |
| 34 |
| 35 #endif // IOS_CHROME_TODAY_EXTENSION_LOCK_SCREEN_STATE_H_ |
OLD | NEW |