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

Unified Diff: sky/shell/android/org/domokit/sky/shell/SkyApplication.java

Issue 1213203008: Make it possible to load Sky demos from local bundles (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: re-upload Created 5 years, 6 months 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 | « sky/shell/android/org/domokit/sky/shell/SkyActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/android/org/domokit/sky/shell/SkyApplication.java
diff --git a/sky/shell/android/org/domokit/sky/shell/SkyApplication.java b/sky/shell/android/org/domokit/sky/shell/SkyApplication.java
index a20da1e14b81e1c4476c8f4de82eaeb77a789c92..eabb6608a4abe246de933371083aeac9ef9ce70c 100644
--- a/sky/shell/android/org/domokit/sky/shell/SkyApplication.java
+++ b/sky/shell/android/org/domokit/sky/shell/SkyApplication.java
@@ -41,7 +41,25 @@ public class SkyApplication extends BaseChromiumApplication {
initJavaUtils();
initResources();
initNative();
- initServiceRegistry();
+ onServiceRegistryAvailable(ServiceRegistry.SHARED);
+ }
+
+ /**
+ * Override this function to add more resources for extraction.
+ */
+ protected void onBeforeResourceExtraction(ResourceExtractor extractor) {
+ extractor.addResources(SKY_RESOURCES);
+ }
+
+ /**
+ * Override this function to register more services.
+ */
+ protected void onServiceRegistryAvailable(ServiceRegistry registry) {
+ registry.register(NetworkService.MANAGER.getName(), new ServiceFactory() {
+ public void connectToService(Context context, Core core, MessagePipeHandle pipe) {
+ new NetworkServiceImpl(context, core, pipe);
+ }
+ });
}
private void initJavaUtils() {
@@ -51,7 +69,7 @@ public class SkyApplication extends BaseChromiumApplication {
private void initResources() {
mResourceExtractor = new ResourceExtractor(getApplicationContext());
- mResourceExtractor.addResources(SKY_RESOURCES);
+ onBeforeResourceExtraction(mResourceExtractor);
mResourceExtractor.start();
}
@@ -63,12 +81,4 @@ public class SkyApplication extends BaseChromiumApplication {
throw new RuntimeException(e);
}
}
-
- private void initServiceRegistry() {
- ServiceRegistry.SHARED.register(NetworkService.MANAGER.getName(), new ServiceFactory() {
- public void connectToService(Context context, Core core, MessagePipeHandle pipe) {
- new NetworkServiceImpl(context, core, pipe);
- }
- });
- }
}
« no previous file with comments | « sky/shell/android/org/domokit/sky/shell/SkyActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698