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

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/ViewportActivity.java

Issue 1468913003: Add android.mojo application. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 1 month 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
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo/shell/JavaApplicationRegistry.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/android/apk/src/org/chromium/mojo/shell/ViewportActivity.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/ViewportActivity.java b/shell/android/apk/src/org/chromium/mojo/shell/ViewportActivity.java
index 29b69a7b5bc785a175f5278bed0f6f03b5ea7098..b087cd0e37809becbf524e0b379924c5a7ac68df 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/ViewportActivity.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/ViewportActivity.java
@@ -19,6 +19,12 @@ import org.chromium.mojo.input.InputServiceImpl;
* Activity for displaying on the screen from the NativeViewportService.
*/
public class ViewportActivity extends Activity {
+ private static Activity sCurrentActivity = null;
+
+ public static Activity getCurrent() {
+ return sCurrentActivity;
+ }
+
/**
* @see Activity#onKeyDown(int, KeyEvent)
*/
@@ -57,4 +63,22 @@ public class ViewportActivity extends Activity {
super.onNewIntent(intent);
new RuntimeException("This activity instance should only ever receive one intent.");
}
+
+ /**
+ * @see Activity#onPause()
+ */
+ @Override
+ protected void onPause() {
+ if (sCurrentActivity == this) sCurrentActivity = null;
+ super.onPause();
+ }
+
+ /**
+ * @see Activity#onResume()
+ */
+ @Override
+ protected void onResume() {
+ super.onResume();
+ sCurrentActivity = this;
+ }
}
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo/shell/JavaApplicationRegistry.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698