Index: content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java |
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java b/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java |
index 039bef5808cb9f54f94bd30a7bd2dddbca0fbc0a..40b92d11aea37fddd2a7ae4e8389099033a0ba66 100644 |
--- a/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java |
+++ b/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java |
@@ -99,6 +99,22 @@ public class ContentShellActivity extends Activity { |
} |
} |
+ @Override |
+ protected void onPause() { |
+ ContentView view = getActiveContentView(); |
+ if (view != null) view.onActivityPause(); |
+ |
+ super.onPause(); |
+ } |
+ |
+ @Override |
+ protected void onResume() { |
+ super.onResume(); |
+ |
+ ContentView view = getActiveContentView(); |
+ if (view != null) view.onActivityResume(); |
+ } |
+ |
private static String getUrlFromIntent(Intent intent) { |
return intent != null ? intent.getDataString() : null; |
} |
@@ -118,6 +134,15 @@ public class ContentShellActivity extends Activity { |
return mShellManager != null ? mShellManager.getActiveShell() : null; |
} |
+ /** |
+ * @return The {@link ContentView} owned by the currently visible {@link Shell} or null if one |
+ * is not showing. |
+ */ |
+ public ContentView getActiveContentView() { |
+ Shell shell = getActiveShell(); |
+ return shell != null ? shell.getContentView() : null; |
+ } |
+ |
private void initializeContentViewResources() { |
AppResource.DIMENSION_LINK_PREVIEW_OVERLAY_RADIUS = R.dimen.link_preview_overlay_radius; |
AppResource.DRAWABLE_LINK_PREVIEW_POPUP_OVERLAY = R.drawable.popup_zoomer_overlay; |