Index: chrome/browser/lifetime/browser_keep_alive.h |
diff --git a/chrome/browser/lifetime/browser_keep_alive.h b/chrome/browser/lifetime/browser_keep_alive.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..039819ec20e0373ee28dab02b42b616de735dabf |
--- /dev/null |
+++ b/chrome/browser/lifetime/browser_keep_alive.h |
@@ -0,0 +1,31 @@ |
+// Copyright 2015 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 CHROME_BROWSER_LIFETIME_BROWSER_KEEP_ALIVE_H_ |
+#define CHROME_BROWSER_LIFETIME_BROWSER_KEEP_ALIVE_H_ |
+ |
+namespace browser_lifetime { |
+ |
+// Tells the BrowserList to keep the application alive after the last Browser |
+// closes. This is implemented as a count, so callers should pair their calls |
+// to IncrementKeepAliveCount() with matching calls to DecrementKeepAliveCount() |
+// when they no |
+// longer need to keep the application running. |
+void IncrementKeepAliveCount(); |
sky
2015/10/02 15:44:27
I like factoring this code out into it's file. But
|
+ |
+// Stops keeping the application alive after the last Browser is closed. |
+// Should match a previous call to IncrementKeepAliveCount(). |
+void DecrementKeepAliveCount(); |
+ |
+// Returns true if application will continue running after the last Browser |
+// closes. |
+bool WillKeepAlive(); |
+ |
+// Disable browser shutdown for unit tests. |
+void DisableShutdownForTesting(bool disable_shutdown_for_testing); |
+ |
+} // namespace browser_lifetime |
+ |
+#endif // CHROME_BROWSER_LIFETIME_BROWSER_KEEP_ALIVE_H_ |
+ |