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

Unified Diff: chrome/android/java/templates/MonochromeApplication.template

Issue 2501153002: Build public monochrome (Closed)
Patch Set: Created 4 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
Index: chrome/android/java/templates/MonochromeApplication.template
diff --git a/chrome/android/java/templates/MonochromeApplication.template b/chrome/android/java/templates/MonochromeApplication.template
new file mode 100644
index 0000000000000000000000000000000000000000..d721fbbab37984262b31019730ef02be9f43c13e
--- /dev/null
+++ b/chrome/android/java/templates/MonochromeApplication.template
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package {{package}};
+
+import android.content.Context;
+
+import com.android.webview.chromium.MonochromeLibraryPreloader;
+
+import org.chromium.base.library_loader.LibraryLoader;
+import org.chromium.base.library_loader.LibraryProcessType;
+import org.chromium.content.browser.ChildProcessCreationParams;
+
+/**
+ * This is Application class for Monochrome.
+ *
+ * You shouldn't add anything else in this file, this class is split off from
+ * normal chrome in order to access Android system API through Android WebView
+ * glue layer and have monochrome specific code.
+ */
+public class {{ monochrome_application_class }} extends {{ super_class }} {
+ private ChildProcessCreationParams mChildProcessCreationParams;
+
+ @Override
+ public ChildProcessCreationParams getChildProcessCreationParams() {
+ return mChildProcessCreationParams;
+ }
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ LibraryLoader.setNativeLibraryPreloader(new MonochromeLibraryPreloader());
+ // ChildProcessCreationParams is only needed for browser process, though it is
+ // created and set in all processes.
+ mChildProcessCreationParams = new ChildProcessCreationParams(getPackageName(),
+ true /* isExternalService */, LibraryProcessType.PROCESS_CHILD);
+ ChildProcessCreationParams.set(mChildProcessCreationParams);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698