Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ios / chrome / app / UIApplication+ExitsOnSuspend.h
blob019e21fc5875a15fd0a8fdad61729fe214f85ba8
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_
8 #if !defined(NDEBUG)
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;
26 @end
28 #endif // !defined(NDEBUG)
30 #endif // IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_