Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
| index eae1698e3363a4e38e8cade7ff987bec1a9a5139..0a0059a104541e91bdc5a7344e1964229dbf75fd 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
| @@ -429,10 +429,13 @@ public class ChildProcessLauncher { |
| sBindingManager.determinedVisibility(pid); |
| } |
| + private static boolean sApplicationInForeground = true; |
|
Ted C
2015/03/09 22:35:03
move this up with the other variables (i.e. right
no sievers
2015/03/09 22:38:37
Done.
|
| + |
| /** |
| * Called when the embedding application is sent to background. |
| */ |
| public static void onSentToBackground() { |
| + sApplicationInForeground = false; |
| sBindingManager.onSentToBackground(); |
| } |
| @@ -440,10 +443,18 @@ public class ChildProcessLauncher { |
| * Called when the embedding application is brought to foreground. |
| */ |
| public static void onBroughtToForeground() { |
| + sApplicationInForeground = true; |
| sBindingManager.onBroughtToForeground(); |
| } |
| /** |
| + * Returns whether the application is currently in the foreground. |
| + */ |
| + static boolean isApplicationInForeground() { |
| + return sApplicationInForeground; |
| + } |
| + |
| + /** |
| * Should be called early in startup so the work needed to spawn the child process can be done |
| * in parallel to other startup work. Must not be called on the UI thread. Spare connection is |
| * created in sandboxed child process. |