From becdd19ff7dafd30fe7e6445f5d2ebcf33cff5bf Mon Sep 17 00:00:00 2001 From: Martyn Haigh Date: Tue, 11 Feb 2014 23:41:05 -0800 Subject: [PATCH] bug 958358 - make webapp capitalisation consistent; r=wesj --HG-- rename : mobile/android/base/WebApp.java.in => mobile/android/base/Webapp.java.in rename : mobile/android/base/WebAppAllocator.java => mobile/android/base/WebappAllocator.java rename : mobile/android/base/WebAppFragmentRepeater.inc => mobile/android/base/WebappFragmentRepeater.inc rename : mobile/android/base/WebAppImpl.java => mobile/android/base/WebappImpl.java rename : mobile/android/base/WebAppManifestFragment.xml.frag.in => mobile/android/base/WebappManifestFragment.xml.frag.in rename : mobile/android/base/WebAppsFragment.java.frag => mobile/android/base/WebappsFragment.java.frag rename : mobile/android/base/webapp/WebAppImpl.java => mobile/android/base/webapp/WebappImpl.java rename : mobile/android/chrome/content/WebAppRT.js => mobile/android/chrome/content/WebappRT.js --- mobile/android/base/AndroidManifest.xml.in | 12 ++-- mobile/android/base/GeckoApp.java | 2 +- mobile/android/base/GeckoAppShell.java | 16 ++--- mobile/android/base/Makefile.in | 6 +- mobile/android/base/WebApps.java.in | 8 +-- .../base/{WebApp.java.in => Webapp.java.in} | 8 +-- ...AppAllocator.java => WebappAllocator.java} | 16 ++--- ...epeater.inc => WebappFragmentRepeater.inc} | 0 .../base/{WebAppImpl.java => WebappImpl.java} | 22 +++---- ....in => WebappManifestFragment.xml.frag.in} | 2 +- ...nt.java.frag => WebappsFragment.java.frag} | 2 +- mobile/android/base/moz.build | 8 +-- mobile/android/base/webapp/Allocator.java | 4 +- mobile/android/base/webapp/ApkResources.java | 6 +- mobile/android/base/webapp/Dispatcher.java | 2 +- mobile/android/base/webapp/EventListener.java | 62 +++++++++---------- mobile/android/base/webapp/InstallHelper.java | 6 +- .../android/base/webapp/InstallListener.java | 2 +- .../base/webapp/UninstallListener.java | 2 +- .../{WebAppImpl.java => WebappImpl.java} | 12 ++-- .../content/{WebAppRT.js => WebappRT.js} | 2 +- mobile/android/chrome/content/browser.js | 14 ++--- mobile/android/chrome/jar.mn | 2 +- mobile/android/modules/WebappManager.jsm | 12 ++-- 24 files changed, 114 insertions(+), 114 deletions(-) rename mobile/android/base/{WebApp.java.in => Webapp.java.in} (67%) rename mobile/android/base/{WebAppAllocator.java => WebappAllocator.java} (90%) rename mobile/android/base/{WebAppFragmentRepeater.inc => WebappFragmentRepeater.inc} (100%) rename mobile/android/base/{WebAppImpl.java => WebappImpl.java} (92%) rename mobile/android/base/{WebAppManifestFragment.xml.frag.in => WebappManifestFragment.xml.frag.in} (93%) rename mobile/android/base/{WebAppsFragment.java.frag => WebappsFragment.java.frag} (56%) rename mobile/android/base/webapp/{WebAppImpl.java => WebappImpl.java} (97%) rename mobile/android/chrome/content/{WebAppRT.js => WebappRT.js} (99%) diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in index 7691899aaa86..6605fde16bb4 100644 --- a/mobile/android/base/AndroidManifest.xml.in +++ b/mobile/android/base/AndroidManifest.xml.in @@ -179,13 +179,13 @@ #endif - @@ -196,13 +196,13 @@ - + WebappAllocator. --> -#define FRAGMENT WebAppManifestFragment.xml.frag.in -#include WebAppFragmentRepeater.inc +#define FRAGMENT WebappManifestFragment.xml.frag.in +#include WebappFragmentRepeater.inc classes to the WebApps class. + * Declare a predefined number of Webapp classes to the Webapps class. * These are used so that each web app can launch in its own process. Keep this - * number in sync with the number of web apps handled in WebAppAllocator. + * number in sync with the number of web apps handled in WebappAllocator. */ public final class WebApps { -#define FRAGMENT WebAppsFragment.java.frag -#include WebAppFragmentRepeater.inc +#define FRAGMENT WebappsFragment.java.frag +#include WebappFragmentRepeater.inc } diff --git a/mobile/android/base/WebApp.java.in b/mobile/android/base/Webapp.java.in similarity index 67% rename from mobile/android/base/WebApp.java.in rename to mobile/android/base/Webapp.java.in index bb050250ae51..e0e87664950b 100644 --- a/mobile/android/base/WebApp.java.in +++ b/mobile/android/base/Webapp.java.in @@ -7,12 +7,12 @@ package @ANDROID_PACKAGE_NAME@; #ifdef MOZ_ANDROID_SYNTHAPKS -import org.mozilla.gecko.webapp.WebAppImpl; +import org.mozilla.gecko.webapp.WebappImpl; #else -import org.mozilla.gecko.WebAppImpl; +import org.mozilla.gecko.WebappImpl; #endif /** - * This class serves only as a namespace wrapper for WebAppImpl. + * This class serves only as a namespace wrapper for WebappImpl. */ -public class WebApp extends WebAppImpl {} +public class Webapp extends WebappImpl {} diff --git a/mobile/android/base/WebAppAllocator.java b/mobile/android/base/WebappAllocator.java similarity index 90% rename from mobile/android/base/WebAppAllocator.java rename to mobile/android/base/WebappAllocator.java index 34385216dbf5..236c4ef28e0c 100644 --- a/mobile/android/base/WebAppAllocator.java +++ b/mobile/android/base/WebappAllocator.java @@ -16,19 +16,19 @@ import android.util.Log; import java.util.ArrayList; -public class WebAppAllocator { - private final String LOGTAG = "GeckoWebAppAllocator"; - // The number of WebApp# and WEBAPP# activites/apps/intents +public class WebappAllocator { + private final String LOGTAG = "GeckoWebappAllocator"; + // The number of Webapp# and WEBAPP# activites/apps/intents private final static int MAX_WEB_APPS = 100; - protected static WebAppAllocator sInstance = null; - public static WebAppAllocator getInstance() { + protected static WebappAllocator sInstance = null; + public static WebappAllocator getInstance() { return getInstance(GeckoAppShell.getContext()); } - public static synchronized WebAppAllocator getInstance(Context cx) { + public static synchronized WebappAllocator getInstance(Context cx) { if (sInstance == null) { - sInstance = new WebAppAllocator(cx); + sInstance = new WebappAllocator(cx); } return sInstance; @@ -36,7 +36,7 @@ public class WebAppAllocator { SharedPreferences mPrefs; - protected WebAppAllocator(Context context) { + protected WebappAllocator(Context context) { mPrefs = context.getSharedPreferences("webapps", Context.MODE_PRIVATE | Context.MODE_MULTI_PROCESS); } diff --git a/mobile/android/base/WebAppFragmentRepeater.inc b/mobile/android/base/WebappFragmentRepeater.inc similarity index 100% rename from mobile/android/base/WebAppFragmentRepeater.inc rename to mobile/android/base/WebappFragmentRepeater.inc diff --git a/mobile/android/base/WebAppImpl.java b/mobile/android/base/WebappImpl.java similarity index 92% rename from mobile/android/base/WebAppImpl.java rename to mobile/android/base/WebappImpl.java index 5254605a7159..4de0ad7ec863 100644 --- a/mobile/android/base/WebAppImpl.java +++ b/mobile/android/base/WebappImpl.java @@ -26,8 +26,8 @@ import android.view.Display; import java.net.URL; import java.io.File; -public class WebAppImpl extends GeckoApp { - private static final String LOGTAG = "GeckoWebAppImpl"; +public class WebappImpl extends GeckoApp { + private static final String LOGTAG = "GeckoWebappImpl"; private URL mOrigin; private TextView mTitlebarText = null; @@ -62,12 +62,12 @@ public class WebAppImpl extends GeckoApp { mTitlebarText = (TextView)findViewById(R.id.webapp_title); mTitlebar = findViewById(R.id.webapp_titlebar); if (!action.startsWith(ACTION_WEBAPP_PREFIX)) { - Log.e(LOGTAG, "WebApp launch, but intent action is " + action + "!"); + Log.e(LOGTAG, "Webapp launch, but intent action is " + action + "!"); return; } - // Try to use the origin stored in the WebAppAllocator first - String origin = WebAppAllocator.getInstance(this).getAppForIndex(getIndex()); + // Try to use the origin stored in the WebappAllocator first + String origin = WebappAllocator.getInstance(this).getAppForIndex(getIndex()); try { mOrigin = new URL(origin); } catch (java.net.MalformedURLException ex) { @@ -90,11 +90,11 @@ public class WebAppImpl extends GeckoApp { protected void loadStartupTab(String uri) { String action = getIntent().getAction(); if (GeckoApp.ACTION_WEBAPP_PREFIX.equals(action)) { - // This action assumes the uri is not an installed WebApp. We will - // use the WebAppAllocator to register the uri with an Android + // This action assumes the uri is not an installed Webapp. We will + // use the WebappAllocator to register the uri with an Android // process so it can run chromeless. - int index = WebAppAllocator.getInstance(this).findAndAllocateIndex(uri, "App", (Bitmap) null); - Intent appIntent = GeckoAppShell.getWebAppIntent(index, uri); + int index = WebappAllocator.getInstance(this).findAndAllocateIndex(uri, "App", (Bitmap) null); + Intent appIntent = GeckoAppShell.getWebappIntent(index, uri); startActivity(appIntent); finish(); } @@ -105,7 +105,7 @@ public class WebAppImpl extends GeckoApp { // get the favicon dominant color, stored when the app was installed int[] colors = new int[2]; - int dominantColor = prefs.getInt(WebAppAllocator.iconKey(getIndex()), -1); + int dominantColor = prefs.getInt(WebappAllocator.iconKey(getIndex()), -1); // now lighten it, to ensure that the icon stands out in the center float[] f = new float[3]; @@ -144,7 +144,7 @@ public class WebAppImpl extends GeckoApp { protected String getDefaultProfileName() { String action = getIntent().getAction(); if (!action.startsWith(ACTION_WEBAPP_PREFIX)) { - Log.e(LOGTAG, "WebApp launch, but intent action is " + action + "!"); + Log.e(LOGTAG, "Webapp launch, but intent action is " + action + "!"); return null; } diff --git a/mobile/android/base/WebAppManifestFragment.xml.frag.in b/mobile/android/base/WebappManifestFragment.xml.frag.in similarity index 93% rename from mobile/android/base/WebAppManifestFragment.xml.frag.in rename to mobile/android/base/WebappManifestFragment.xml.frag.in index 189f000d7e36..b08924fc05be 100644 --- a/mobile/android/base/WebAppManifestFragment.xml.frag.in +++ b/mobile/android/base/WebappManifestFragment.xml.frag.in @@ -2,7 +2,7 @@ android:label="@string/webapp_generic_name" android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize" android:windowSoftInputMode="stateUnspecified|adjustResize" - android:process=":@ANDROID_PACKAGE_NAME@.WebApp@APPNUM@" + android:process=":@ANDROID_PACKAGE_NAME@.Webapp@APPNUM@" android:theme="@style/Gecko.App" #ifdef MOZ_ANDROID_SYNTHAPKS android:launchMode="singleTop" diff --git a/mobile/android/base/WebAppsFragment.java.frag b/mobile/android/base/WebappsFragment.java.frag similarity index 56% rename from mobile/android/base/WebAppsFragment.java.frag rename to mobile/android/base/WebappsFragment.java.frag index c257c018a44c..4ce77fe145e0 100644 --- a/mobile/android/base/WebAppsFragment.java.frag +++ b/mobile/android/base/WebappsFragment.java.frag @@ -1,4 +1,4 @@ -public static class WebApp@APPNUM@ extends WebApp { +public static class WebApp@APPNUM@ extends Webapp { @Override protected int getIndex() { return @APPNUM@; } } diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index 1133aa6d425c..3b22f1a52194 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -349,9 +349,9 @@ gbjar.sources += [ 'webapp/InstallHelper.java', 'webapp/InstallListener.java', 'webapp/UninstallListener.java', - 'webapp/WebAppImpl.java', - 'WebAppAllocator.java', - 'WebAppImpl.java', + 'webapp/WebappImpl.java', + 'WebappAllocator.java', + 'WebappImpl.java', 'widget/ActivityChooserModel.java', 'widget/AllCapsTextView.java', 'widget/AnimatedHeightLayout.java', @@ -385,7 +385,7 @@ android_package_dir = CONFIG['ANDROID_PACKAGE_NAME'].replace('.', '/') # R.java is handled even more specially than the others! gbjar.generated_sources += [ android_package_dir + f for f in [ '/App.java', - '/WebApp.java', + '/Webapp.java', '/WebApps.java', ] ] gbjar.generated_sources += [ diff --git a/mobile/android/base/webapp/Allocator.java b/mobile/android/base/webapp/Allocator.java index 573cd7f97e28..feb5503b57d4 100644 --- a/mobile/android/base/webapp/Allocator.java +++ b/mobile/android/base/webapp/Allocator.java @@ -18,12 +18,12 @@ import android.util.Log; public class Allocator { - private final String LOGTAG = "GeckoWebAppAllocator"; + private final String LOGTAG = "GeckoWebappAllocator"; private static final String PREFIX_ORIGIN = "webapp-origin-"; private static final String PREFIX_PACKAGE_NAME = "webapp-package-name-"; - // The number of WebApp# and WEBAPP# activites/apps/intents + // The number of Webapp# and WEBAPP# activities/apps/intents private final static int MAX_WEB_APPS = 100; protected static Allocator sInstance = null; diff --git a/mobile/android/base/webapp/ApkResources.java b/mobile/android/base/webapp/ApkResources.java index dad7fe17509e..16caa720e88f 100644 --- a/mobile/android/base/webapp/ApkResources.java +++ b/mobile/android/base/webapp/ApkResources.java @@ -21,7 +21,7 @@ import android.os.Environment; import android.util.Log; public class ApkResources { - private static final String LOGTAG = "GeckoWebAppApkResources"; + private static final String LOGTAG = "GeckoWebappApkResources"; private final String mPackageName; private final ApplicationInfo mInfo; private final Context mContext; @@ -58,7 +58,7 @@ public class ApkResources { } public boolean isPackaged() { - return "packaged".equals(getWebAppType()); + return "packaged".equals(getWebappType()); } public boolean isDebuggable() { @@ -94,7 +94,7 @@ public class ApkResources { return info().loadIcon(mContext.getPackageManager()); } - public String getWebAppType() { + public String getWebappType() { return metadata().getString("webapp"); } diff --git a/mobile/android/base/webapp/Dispatcher.java b/mobile/android/base/webapp/Dispatcher.java index 358469119e54..744fe88067fb 100644 --- a/mobile/android/base/webapp/Dispatcher.java +++ b/mobile/android/base/webapp/Dispatcher.java @@ -11,7 +11,7 @@ import android.os.Bundle; import android.util.Log; public class Dispatcher extends Activity { - private static final String LOGTAG = "GeckoWebAppDispatcher"; + private static final String LOGTAG = "GeckoWebappDispatcher"; @Override protected void onCreate(Bundle bundle) { diff --git a/mobile/android/base/webapp/EventListener.java b/mobile/android/base/webapp/EventListener.java index b29473f55519..15a5cde88c0d 100644 --- a/mobile/android/base/webapp/EventListener.java +++ b/mobile/android/base/webapp/EventListener.java @@ -15,7 +15,7 @@ import org.mozilla.gecko.util.EventDispatcher; import org.mozilla.gecko.util.GeckoEventListener; import org.mozilla.gecko.util.GeckoEventResponder; import org.mozilla.gecko.util.ThreadUtils; -import org.mozilla.gecko.WebAppAllocator; +import org.mozilla.gecko.WebappAllocator; import android.app.Activity; import android.app.ActivityManager; @@ -40,7 +40,7 @@ import org.json.JSONObject; public class EventListener implements GeckoEventListener, GeckoEventResponder { - private static final String LOGTAG = "GeckoWebAppEventListener"; + private static final String LOGTAG = "GeckoWebappEventListener"; private EventListener() { } @@ -63,55 +63,55 @@ public class EventListener implements GeckoEventListener, GeckoEventResponder { } public static void registerEvents() { - registerEventListener("WebApps:PreInstall"); - registerEventListener("WebApps:InstallApk"); - registerEventListener("WebApps:PostInstall"); - registerEventListener("WebApps:Open"); - registerEventListener("WebApps:Uninstall"); - registerEventListener("WebApps:GetApkVersions"); + registerEventListener("Webapps:Preinstall"); + registerEventListener("Webapps:InstallApk"); + registerEventListener("Webapps:Postinstall"); + registerEventListener("Webapps:Open"); + registerEventListener("Webapps:Uninstall"); + registerEventListener("Webapps:GetApkVersions"); } public static void unregisterEvents() { - unregisterEventListener("WebApps:PreInstall"); - unregisterEventListener("WebApps:InstallApk"); - unregisterEventListener("WebApps:PostInstall"); - unregisterEventListener("WebApps:Open"); - unregisterEventListener("WebApps:Uninstall"); - unregisterEventListener("WebApps:GetApkVersions"); + unregisterEventListener("Webapps:Preinstall"); + unregisterEventListener("Webapps:InstallApk"); + unregisterEventListener("Webapps:Postinstall"); + unregisterEventListener("Webapps:Open"); + unregisterEventListener("Webapps:Uninstall"); + unregisterEventListener("Webapps:GetApkVersions"); } @Override public void handleMessage(String event, JSONObject message) { try { - if (AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("WebApps:InstallApk")) { + if (AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("Webapps:InstallApk")) { installApk(GeckoAppShell.getGeckoInterface().getActivity(), message.getString("filePath"), message.getString("data")); - } else if (event.equals("WebApps:PostInstall")) { + } else if (event.equals("Webapps:Postinstall")) { if (AppConstants.MOZ_ANDROID_SYNTHAPKS) { - postInstallWebApp(message.getString("apkPackageName"), message.getString("origin")); + postInstallWebapp(message.getString("apkPackageName"), message.getString("origin")); } else { - postInstallWebApp(message.getString("name"), + postInstallWebapp(message.getString("name"), message.getString("manifestURL"), message.getString("origin"), message.getString("iconURL"), message.getString("originalOrigin")); } - } else if (event.equals("WebApps:Open")) { - Intent intent = GeckoAppShell.getWebAppIntent(message.getString("manifestURL"), + } else if (event.equals("Webapps:Open")) { + Intent intent = GeckoAppShell.getWebappIntent(message.getString("manifestURL"), message.getString("origin"), "", null); if (intent == null) { return; } GeckoAppShell.getGeckoInterface().getActivity().startActivity(intent); - } else if (!AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("WebApps:Uninstall")) { - uninstallWebApp(message.getString("origin")); - } else if (!AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("WebApps:PreInstall")) { + } else if (!AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("Webapps:Uninstall")) { + uninstallWebapp(message.getString("origin")); + } else if (!AppConstants.MOZ_ANDROID_SYNTHAPKS && event.equals("Webapps:Preinstall")) { String name = message.getString("name"); String manifestURL = message.getString("manifestURL"); String origin = message.getString("origin"); // preInstallWebapp will return a File object pointing to the profile directory of the webapp - mCurrentResponse = preInstallWebApp(name, manifestURL, origin).toString(); + mCurrentResponse = preInstallWebapp(name, manifestURL, origin).toString(); } else if (event.equals("WebApps:GetApkVersions")) { mCurrentResponse = getApkVersions(GeckoAppShell.getGeckoInterface().getActivity(), message.getJSONArray("packageNames")).toString(); @@ -128,15 +128,15 @@ public class EventListener implements GeckoEventListener, GeckoEventResponder { } // Not used by MOZ_ANDROID_SYNTHAPKS. - public static File preInstallWebApp(String aTitle, String aURI, String aOrigin) { - int index = WebAppAllocator.getInstance(GeckoAppShell.getContext()).findAndAllocateIndex(aOrigin, aTitle, (String) null); + public static File preInstallWebapp(String aTitle, String aURI, String aOrigin) { + int index = WebappAllocator.getInstance(GeckoAppShell.getContext()).findAndAllocateIndex(aOrigin, aTitle, (String) null); GeckoProfile profile = GeckoProfile.get(GeckoAppShell.getContext(), "webapp" + index); return profile.getDir(); } // Not used by MOZ_ANDROID_SYNTHAPKS. - public static void postInstallWebApp(String aTitle, String aURI, String aOrigin, String aIconURL, String aOriginalOrigin) { - WebAppAllocator allocator = WebAppAllocator.getInstance(GeckoAppShell.getContext()); + public static void postInstallWebapp(String aTitle, String aURI, String aOrigin, String aIconURL, String aOriginalOrigin) { + WebappAllocator allocator = WebappAllocator.getInstance(GeckoAppShell.getContext()); int index = allocator.getIndexForApp(aOriginalOrigin); assert aIconURL != null; @@ -151,13 +151,13 @@ public class EventListener implements GeckoEventListener, GeckoEventResponder { } // Used by MOZ_ANDROID_SYNTHAPKS. - public static void postInstallWebApp(String aPackageName, String aOrigin) { + public static void postInstallWebapp(String aPackageName, String aOrigin) { Allocator allocator = Allocator.getInstance(GeckoAppShell.getContext()); int index = allocator.findOrAllocatePackage(aPackageName); allocator.putOrigin(index, aOrigin); } - public static void uninstallWebApp(final String uniqueURI) { + public static void uninstallWebapp(final String uniqueURI) { // On uninstall, we need to do a couple of things: // 1. nuke the running app process. // 2. nuke the profile that was assigned to that webapp @@ -173,7 +173,7 @@ public class EventListener implements GeckoEventListener, GeckoEventResponder { // kill the app if it's running String targetProcessName = GeckoAppShell.getContext().getPackageName(); - targetProcessName = targetProcessName + ":" + targetProcessName + ".WebApp" + index; + targetProcessName = targetProcessName + ":" + targetProcessName + ".Webapp" + index; ActivityManager am = (ActivityManager) GeckoAppShell.getContext().getSystemService(Context.ACTIVITY_SERVICE); List procs = am.getRunningAppProcesses(); diff --git a/mobile/android/base/webapp/InstallHelper.java b/mobile/android/base/webapp/InstallHelper.java index 9652ccd67727..3a084c72c912 100644 --- a/mobile/android/base/webapp/InstallHelper.java +++ b/mobile/android/base/webapp/InstallHelper.java @@ -27,8 +27,8 @@ import android.net.Uri; import android.util.Log; public class InstallHelper implements GeckoEventListener { - private static final String LOGTAG = "GeckoWebAppInstallHelper"; - private static final String[] INSTALL_EVENT_NAMES = new String[] {"WebApps:PostInstall"}; + private static final String LOGTAG = "GeckoWebappInstallHelper"; + private static final String[] INSTALL_EVENT_NAMES = new String[] {"Webapps:Postinstall"}; private final Context mContext; private final InstallCallback mCallback; private final ApkResources mApkResources; @@ -86,7 +86,7 @@ public class InstallHelper implements GeckoEventListener { message.put("title", mApkResources.getAppName()); message.put("manifest", new JSONObject(mApkResources.getManifest(mContext))); - String appType = mApkResources.getWebAppType(); + String appType = mApkResources.getWebappType(); message.putOpt("type", appType); if ("packaged".equals(appType)) { message.putOpt("updateManifest", new JSONObject(mApkResources.getMiniManifest(mContext))); diff --git a/mobile/android/base/webapp/InstallListener.java b/mobile/android/base/webapp/InstallListener.java index 10811ceea711..6a450c333457 100644 --- a/mobile/android/base/webapp/InstallListener.java +++ b/mobile/android/base/webapp/InstallListener.java @@ -24,7 +24,7 @@ import android.util.Log; public class InstallListener extends BroadcastReceiver { - private static String LOGTAG = "GeckoWebAppInstallListener"; + private static String LOGTAG = "GeckoWebappInstallListener"; private JSONObject mData = null; private String mManifestUrl; diff --git a/mobile/android/base/webapp/UninstallListener.java b/mobile/android/base/webapp/UninstallListener.java index ba3a08c559a4..fd26c7930b4f 100644 --- a/mobile/android/base/webapp/UninstallListener.java +++ b/mobile/android/base/webapp/UninstallListener.java @@ -28,7 +28,7 @@ import java.util.ArrayList; public class UninstallListener extends BroadcastReceiver { - private static String LOGTAG = "GeckoWebAppUninstallListener"; + private static String LOGTAG = "GeckoWebappUninstallListener"; @Override public void onReceive(Context context, Intent intent) { diff --git a/mobile/android/base/webapp/WebAppImpl.java b/mobile/android/base/webapp/WebappImpl.java similarity index 97% rename from mobile/android/base/webapp/WebAppImpl.java rename to mobile/android/base/webapp/WebappImpl.java index 92f4dd076bd0..3c838f99c04b 100644 --- a/mobile/android/base/webapp/WebAppImpl.java +++ b/mobile/android/base/webapp/WebappImpl.java @@ -42,8 +42,8 @@ import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.TextView; -public class WebAppImpl extends GeckoApp implements InstallCallback { - private static final String LOGTAG = "GeckoWebAppImpl"; +public class WebappImpl extends GeckoApp implements InstallCallback { + private static final String LOGTAG = "GeckoWebappImpl"; private URL mOrigin; private TextView mTitlebarText = null; @@ -127,7 +127,7 @@ public class WebAppImpl extends GeckoApp implements InstallCallback { } return; } else { - launchWebApp(origin, mApkResources.getManifestUrl(), mApkResources.getAppName()); + launchWebapp(origin, mApkResources.getManifestUrl(), mApkResources.getAppName()); } setTitle(mApkResources.getAppName()); @@ -290,9 +290,9 @@ public class WebAppImpl extends GeckoApp implements InstallCallback { return; } - if (event.equals("WebApps:PostInstall")) { + if (event.equals("Webapps:Postinstall")) { String origin = message.optString("origin"); - launchWebApp(origin, mApkResources.getManifestUrl(), mApkResources.getAppName()); + launchWebapp(origin, mApkResources.getManifestUrl(), mApkResources.getAppName()); } } @@ -301,7 +301,7 @@ public class WebAppImpl extends GeckoApp implements InstallCallback { Log.e(LOGTAG, "Install errored", exception); } - public void launchWebApp(String origin, String manifestUrl, String name) { + public void launchWebapp(String origin, String manifestUrl, String name) { try { mOrigin = new URL(origin); } catch (java.net.MalformedURLException ex) { diff --git a/mobile/android/chrome/content/WebAppRT.js b/mobile/android/chrome/content/WebappRT.js similarity index 99% rename from mobile/android/chrome/content/WebAppRT.js rename to mobile/android/chrome/content/WebappRT.js index fb1568a4bc70..78d4e37391db 100644 --- a/mobile/android/chrome/content/WebAppRT.js +++ b/mobile/android/chrome/content/WebappRT.js @@ -24,7 +24,7 @@ function pref(name, value) { } } -let WebAppRT = { +let WebappRT = { DEFAULT_PREFS_FILENAME: "default-prefs.js", prefs: [ diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 30d0ee11dde1..43e39f4a694f 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -460,9 +460,9 @@ var BrowserApp = { _initRuntime: function(status, url, callback) { let sandbox = {}; - Services.scriptloader.loadSubScript("chrome://browser/content/WebAppRT.js", sandbox); - window.WebAppRT = sandbox.WebAppRT; - WebAppRT.init(status, url, callback); + Services.scriptloader.loadSubScript("chrome://browser/content/WebappRT.js", sandbox); + window.WebappRT = sandbox.WebappRT; + WebappRT.init(status, url, callback); }, initContextMenu: function ba_initContextMenu() { @@ -7116,7 +7116,7 @@ var WebappsUI = { break; case "webapps-uninstall": sendMessageToJava({ - type: "WebApps:Uninstall", + type: "Webapps:Uninstall", origin: data.origin }); break; @@ -7132,7 +7132,7 @@ var WebappsUI = { // Get a profile for the app to be installed in. We'll download everything before creating the icons. let origin = aData.app.origin; let profilePath = sendMessageToJava({ - type: "WebApps:PreInstall", + type: "Webapps:Preinstall", name: manifest.name, manifestURL: aData.app.manifestURL, origin: origin @@ -7164,7 +7164,7 @@ var WebappsUI = { // aData.app.origin may now point to the app: url that hosts this app sendMessageToJava({ - type: "WebApps:PostInstall", + type: "Webapps:Postinstall", name: localeManifest.name, manifestURL: aData.app.manifestURL, originalOrigin: origin, @@ -7232,7 +7232,7 @@ var WebappsUI = { openURL: function openURL(aManifestURL, aOrigin) { sendMessageToJava({ - type: "WebApps:Open", + type: "Webapps:Open", manifestURL: aManifestURL, origin: aOrigin }); diff --git a/mobile/android/chrome/jar.mn b/mobile/android/chrome/jar.mn index 81b02564f7f2..d2152b011ea8 100644 --- a/mobile/android/chrome/jar.mn +++ b/mobile/android/chrome/jar.mn @@ -40,7 +40,7 @@ chrome.jar: content/SelectHelper.js (content/SelectHelper.js) content/SelectionHandler.js (content/SelectionHandler.js) content/dbg-browser-actors.js (content/dbg-browser-actors.js) -* content/WebAppRT.js (content/WebAppRT.js) +* content/WebappRT.js (content/WebappRT.js) content/InputWidgetHelper.js (content/InputWidgetHelper.js) content/WebrtcUI.js (content/WebrtcUI.js) content/MemoryObserver.js (content/MemoryObserver.js) diff --git a/mobile/android/modules/WebappManager.jsm b/mobile/android/modules/WebappManager.jsm index d12b297d0f10..e316974561e2 100644 --- a/mobile/android/modules/WebappManager.jsm +++ b/mobile/android/modules/WebappManager.jsm @@ -85,7 +85,7 @@ this.WebappManager = { } sendMessageToJava({ - type: "WebApps:InstallApk", + type: "Webapps:InstallApk", filePath: filePath, data: JSON.stringify(aMessage), }); @@ -157,7 +157,7 @@ this.WebappManager = { // aData.app.origin may now point to the app: url that hosts this app. sendMessageToJava({ - type: "WebApps:PostInstall", + type: "Webapps:Postinstall", apkPackageName: aData.app.apkPackageName, origin: aData.app.origin, }); @@ -171,7 +171,7 @@ this.WebappManager = { log("launchWebapp: " + manifestURL); sendMessageToJava({ - type: "WebApps:Open", + type: "Webapps:Open", manifestURL: manifestURL, origin: origin }); @@ -285,7 +285,7 @@ this.WebappManager = { // Map APK names to APK versions. let apkNameToVersion = JSON.parse(sendMessageToJava({ - type: "WebApps:GetApkVersions", + type: "Webapps:GetApkVersions", packageNames: installedApps.map(app => app.packageName).filter(packageName => !!packageName) })); @@ -450,11 +450,11 @@ this.WebappManager = { for (let apk of downloadedApks) { let msg = { app: apk.app, - // TODO: figure out why WebApps:InstallApk needs the "from" property. + // TODO: figure out why Webapps:InstallApk needs the "from" property. from: apk.app.installOrigin, }; sendMessageToJava({ - type: "WebApps:InstallApk", + type: "Webapps:InstallApk", filePath: apk.filePath, data: JSON.stringify(msg), });