Index: sky/shell/android/org/domokit/sky/shell/SkyActivity.java |
diff --git a/sky/shell/android/org/domokit/sky/shell/SkyActivity.java b/sky/shell/android/org/domokit/sky/shell/SkyActivity.java |
index c29e4647e737dbedce9b2715052d5b34e5c40f70..72b33334b73f5ae366e9d53db1036817eedee8fb 100644 |
--- a/sky/shell/android/org/domokit/sky/shell/SkyActivity.java |
+++ b/sky/shell/android/org/domokit/sky/shell/SkyActivity.java |
@@ -11,6 +11,8 @@ import android.view.View; |
import android.view.WindowManager; |
import org.chromium.base.PathUtils; |
+import org.chromium.mojom.sky.EventType; |
+import org.chromium.mojom.sky.InputEvent; |
import org.domokit.activity.ActivityImpl; |
@@ -64,7 +66,9 @@ public class SkyActivity extends Activity { |
@Override |
public void onBackPressed() { |
if (mView != null) { |
- mView.onBackPressed(); |
+ InputEvent event = new InputEvent(); |
+ event.type = EventType.BACK; |
+ mView.getEngine().onInputEvent(event); |
// TODO(abarth): We should have some way to trigger the default |
// back behavior. |
abarth-chromium
2015/07/09 23:45:23
We can delete this comment now.
|
return; |
@@ -72,6 +76,22 @@ public class SkyActivity extends Activity { |
super.onBackPressed(); |
} |
+ @Override |
+ protected void onPause() { |
+ super.onPause(); |
+ if (mView != null) { |
+ mView.getEngine().onActivityPaused(); |
+ } |
+ } |
+ |
+ @Override |
+ protected void onPostResume() { |
+ super.onPostResume(); |
+ if (mView != null) { |
+ mView.getEngine().onActivityResumed(); |
+ } |
+ } |
+ |
/** |
* Override this function to customize startup behavior. |
*/ |
@@ -79,18 +99,18 @@ public class SkyActivity extends Activity { |
File dataDir = new File(PathUtils.getDataDirectory(this)); |
File snapshot = new File(dataDir, SkyApplication.SNAPSHOT); |
if (snapshot.exists()) { |
- mView.loadSnapshot(snapshot.getPath()); |
+ mView.getEngine().runFromSnapshot(snapshot.getPath()); |
return; |
} |
File appBundle = new File(dataDir, SkyApplication.APP_BUNDLE); |
if (appBundle.exists()) { |
- mView.loadBundle(appBundle.getPath()); |
+ mView.getEngine().runFromBundle(appBundle.getPath()); |
return; |
} |
} |
public void loadUrl(String url) { |
- mView.loadUrl(url); |
+ mView.getEngine().runFromNetwork(url); |
} |
public boolean loadBundleByName(String name) { |
@@ -99,7 +119,7 @@ public class SkyActivity extends Activity { |
if (!bundle.exists()) { |
return false; |
} |
- mView.loadBundle(bundle.getPath()); |
+ mView.getEngine().runFromBundle(bundle.getPath()); |
return true; |
} |
} |