1 // Copyright 2012 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.
5 #ifndef IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_
6 #define IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_
10 #import <UIKit/UIKit.h>
12 // Key in the UserDefaults for toggling exit on suspend.
13 extern NSString
* const kExitsOnSuspend
;
15 // WARNING: This is intended for non AppStore builds, since it's not allowed to
16 // quit an app programmatically. Internally we call exit(0).
17 @interface
UIApplication (ExitsOnSuspend
)
19 // When the app goes in background, terminate the app when all background tasks
20 // have finished. Use this in -applicationDidEnterBackground:.
21 - (void)cr_terminateWhenDoneWithBackgroundTasks
;
23 // Cancel termination. Use this in -applicationWillEnterForeground:.
24 - (void)cr_cancelTermination
;
28 #endif // !defined(NDEBUG)
30 #endif // IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_