Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1609)

Unified Diff: ios/chrome/app/UIApplication+ExitsOnSuspend.h

Issue 1110133002: [iOS] Upstream code in //ios/chrome/app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/app/UIApplication+ExitsOnSuspend.h
diff --git a/ios/chrome/app/UIApplication+ExitsOnSuspend.h b/ios/chrome/app/UIApplication+ExitsOnSuspend.h
new file mode 100644
index 0000000000000000000000000000000000000000..019e21fc5875a15fd0a8fdad61729fe214f85ba8
--- /dev/null
+++ b/ios/chrome/app/UIApplication+ExitsOnSuspend.h
@@ -0,0 +1,30 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_
+#define IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_
+
+#if !defined(NDEBUG)
sdefresne 2015/04/28 14:57:25 Why !defined(NDEBUG) instead of !defined(GOOGLE_CH
droger 2015/04/29 08:53:25 I don't know, I'd like to not change this as part
+
+#import <UIKit/UIKit.h>
+
+// Key in the UserDefaults for toggling exit on suspend.
+extern NSString* const kExitsOnSuspend;
+
+// WARNING: This is intended for non AppStore builds, since it's not allowed to
+// quit an app programmatically. Internally we call exit(0).
+@interface UIApplication (ExitsOnSuspend)
+
+// When the app goes in background, terminate the app when all background tasks
+// have finished. Use this in -applicationDidEnterBackground:.
+- (void)cr_terminateWhenDoneWithBackgroundTasks;
+
+// Cancel termination. Use this in -applicationWillEnterForeground:.
+- (void)cr_cancelTermination;
+
+@end
+
+#endif // !defined(NDEBUG)
+
+#endif // IOS_CHROME_APP_UIAPPLICATION_EXITSONSUSPEND_H_

Powered by Google App Engine
This is Rietveld 408576698