Skip to content

Commit

Permalink
refactor: cleanup typos
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Dec 29, 2024
1 parent 8338a9c commit 19da06e
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion framework/cordova.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def doGetConfigPreference(name, defaultValue) {
}

def doApplyCordovaConfigCustomization() {
// Apply user overide properties that comes from the "--gradleArg=-P" parameters
// Apply user override properties that comes from the "--gradleArg=-P" parameters
if (project.hasProperty('cdvMinSdkVersion')) {
cordovaConfig.MIN_SDK_VERSION = Integer.parseInt('' + cdvMinSdkVersion)
}
Expand Down
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/CallbackMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public synchronized int registerCallback(CordovaPlugin receiver, int requestCode
* obtained from registerCallback()
*
* @param mappedId The request code obtained from registerCallback()
* @return The CordovaPlugin and orignal request code that correspond to the
* @return The CordovaPlugin and original request code that correspond to the
* given mappedCode
*/
public synchronized Pair<CordovaPlugin, Integer> getAndRemoveCallback(int mappedId) {
Expand Down
4 changes: 2 additions & 2 deletions framework/src/org/apache/cordova/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one

import android.app.Activity;

@Deprecated // Use AllowList, CordovaPrefences, etc. directly.
@Deprecated // Use AllowList, CordovaPreferences, etc. directly.
public class Config {
private static final String TAG = "Config";

Expand Down Expand Up @@ -54,7 +54,7 @@ public static String getStartUrl() {
}

public static String getErrorUrl() {
return parser.getPreferences().getString("errorurl", null);
return parser.getPreferences().getString("ErrorUrl", null);
}

public static List<PluginEntry> getPluginEntries() {
Expand Down
10 changes: 5 additions & 5 deletions framework/src/org/apache/cordova/CordovaActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Licensed to the Apache Software Foundation (ASF) under one
public class CordovaActivity extends AppCompatActivity {
public static final String TAG = "CordovaActivity";

// The webview for our app
// The WebView for our app
protected CordovaWebView appView;

private static final int ACTIVITY_STARTING = 0;
Expand Down Expand Up @@ -112,7 +112,7 @@ public void onCreate(Bundle savedInstanceState) {
// need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception
loadConfig();

String logLevel = preferences.getString("loglevel", "ERROR");
String logLevel = preferences.getString("LogLevel", "ERROR");
LOG.setLogLevel(logLevel);

LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting");
Expand Down Expand Up @@ -206,7 +206,7 @@ protected void createViews() {
/**
* Construct the default web view object.
* <p/>
* Override this to customize the webview that is used.
* Override this to customize the WebView that is used.
*/
protected CordovaWebView makeWebView() {
return new CordovaWebViewImpl(makeWebViewEngine());
Expand All @@ -227,7 +227,7 @@ public Object onMessage(String id, Object data) {
}

/**
* Load the url into the webview.
* Load the url into the WebView.
*/
public void loadUrl(String url) {
if (appView == null) {
Expand All @@ -250,7 +250,7 @@ protected void onPause() {

if (this.appView != null) {
// CB-9382 If there is an activity that started for result and main activity is waiting for callback
// result, we shoudn't stop WebView Javascript timers, as activity for result might be using them
// result, we shouldn't stop WebView Javascript timers, as activity for result might be using them
boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null;
this.appView.handlePause(keepRunning);
}
Expand Down
8 changes: 4 additions & 4 deletions framework/src/org/apache/cordova/CordovaPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public Boolean shouldAllowRequest(String url) {

/**
* Hook for blocking navigation by the Cordova WebView. This applies both to top-level and
* iframe navigations.
* iframe navigation.
*
* This will be called when the WebView's needs to know whether to navigate
* to a new page. Return false to block the navigation: if any plugin
Expand Down Expand Up @@ -282,7 +282,7 @@ public Boolean shouldOpenExternalUrl(String url) {
/**
* Allows plugins to handle a link being clicked. Return true here to cancel the navigation.
*
* @param url The URL that is trying to be loaded in the Cordova webview.
* @param url The URL that is trying to be loaded in the Cordova WebView.
* @return true to prevent the URL from loading. Default is false.
*/
public boolean onOverrideUrlLoading(String url) {
Expand Down Expand Up @@ -439,11 +439,11 @@ public CordovaPluginPathHandler getPathHandler() {
}

/**
* Called when the WebView's render process has exited. Can be used to collect information regarding the crash for crashlytics or optionally attempt to gracefully handle/recover the crashed webview by recreating it.
* Called when the WebView's render process has exited. Can be used to collect information regarding the crash for crashlytics or optionally attempt to gracefully handle/recover the crashed WebView by recreating it.
*
* See <a href="https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)">WebViewClient#onRenderProcessGone</a>
*
* Note: A plugin must not attempt to recover a webview that it does not own/manage.
* Note: A plugin must not attempt to recover a WebView that it does not own/manage.
*
* @return true if the host application handled the situation that process has exited,
* otherwise, application will crash if render process crashed, or be killed
Expand Down
6 changes: 3 additions & 3 deletions framework/src/org/apache/cordova/CordovaWebView.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.webkit.WebChromeClient.CustomViewCallback;

/**
* Main interface for interacting with a Cordova webview - implemented by CordovaWebViewImpl.
* Main interface for interacting with a Cordova WebView - implemented by CordovaWebViewImpl.
* This is an interface so that it can be easily mocked in tests.
* Methods may be added to this interface without a major version bump, as plugins & embedders
* are not expected to implement it.
Expand Down Expand Up @@ -92,12 +92,12 @@ public interface CordovaWebView {
void sendJavascript(String statememt);

/**
* Load the specified URL in the Cordova webview or a new browser instance.
* Load the specified URL in the Cordova WebView or a new browser instance.
*
* NOTE: If openExternal is false, only allow listed URLs can be loaded.
*
* @param url The url to load.
* @param openExternal Load url in browser instead of Cordova webview.
* @param openExternal Load url in browser instead of Cordova WebView.
* @param clearHistory Clear the history stack, so new page becomes top of history
* @param params Parameters for new app
*/
Expand Down
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/CordovaWebViewEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void init(CordovaWebView parentWebView, CordovaInterface cordova, Client client,
/** Clean up all resources associated with the WebView. */
void destroy();

/** Add the evaulate Javascript method **/
/** Add the evaluate Javascript method **/
void evaluateJavascript(String js, ValueCallback<String> callback);

/**
Expand Down
18 changes: 9 additions & 9 deletions framework/src/org/apache/cordova/CordovaWebViewImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Licensed to the Apache Software Foundation (ASF) under one
import java.util.Set;

/**
* Main class for interacting with a Cordova webview. Manages plugins, events, and a CordovaWebViewEngine.
* Main class for interacting with a Cordova WebView. Manages plugins, events, and a CordovaWebViewEngine.
* Class uses two-phase initialization. You must call init() before calling any other methods.
*/
public class CordovaWebViewImpl implements CordovaWebView {
Expand Down Expand Up @@ -75,13 +75,13 @@ public class CordovaWebViewImpl implements CordovaWebView {
private final Set<Integer> boundKeyCodes = new HashSet<>();

public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) {
String className = preferences.getString("webview", SystemWebViewEngine.class.getCanonicalName());
String className = preferences.getString("WebView", SystemWebViewEngine.class.getCanonicalName());
try {
Class<?> webViewClass = Class.forName(className);
Constructor<?> constructor = webViewClass.getConstructor(Context.class, CordovaPreferences.class);
return (CordovaWebViewEngine) constructor.newInstance(context, preferences);
} catch (Exception e) {
throw new RuntimeException("Failed to create webview. ", e);
throw new RuntimeException("Failed to create WebView. ", e);
}
}

Expand Down Expand Up @@ -152,7 +152,7 @@ public void loadUrlIntoView(final String url, boolean recreatePlugins) {
stopLoading();
LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!");

// Handle other errors by passing them to the webview in JS
// Handle other errors by passing them to the WebView in JS
JSONObject data = new JSONObject();
try {
data.put("errorCode", -6);
Expand Down Expand Up @@ -213,7 +213,7 @@ public void showWebPage(String url, boolean openExternal, boolean clearHistory,
engine.clearHistory();
}

// If loading into our webview
// If loading into our WebView
if (!openExternal) {
// Make sure url is in allow list
if (pluginManager.shouldAllowNavigation(url)) {
Expand All @@ -222,7 +222,7 @@ public void showWebPage(String url, boolean openExternal, boolean clearHistory,
loadUrlIntoView(url, true);
return;
} else {
LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the <allow-navigation> allow list. URL=" + url);
LOG.w(TAG, "showWebPage: Refusing to load URL into WebView since it is not in the <allow-navigation> allow list. URL=" + url);
return;
}
}
Expand Down Expand Up @@ -481,7 +481,7 @@ public void handlePause(boolean keepRunning) {

// If app doesn't want to run in background
if (!keepRunning) {
// Pause JavaScript timers. This affects all webviews within the app!
// Pause JavaScript timers. This affects all WebViews within the app!
engine.setPaused(true);
}
}
Expand All @@ -491,7 +491,7 @@ public void handleResume(boolean keepRunning) {
return;
}

// Resume JavaScript timers. This affects all webviews within the app!
// Resume JavaScript timers. This affects all WebViews within the app!
engine.setPaused(false);
this.pluginManager.onResume(keepRunning);

Expand Down Expand Up @@ -531,7 +531,7 @@ public void handleDestroy() {
// We should use a blank data: url instead so it's more obvious
this.loadUrl("about:blank");

// TODO: Should not destroy webview until after about:blank is done loading.
// TODO: Should not destroy WebView until after about:blank is done loading.
engine.destroy();
hideCustomView();
}
Expand Down
10 changes: 5 additions & 5 deletions framework/src/org/apache/cordova/CoreAndroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void pluginInitialize() {
* Executes the request and returns PluginResult.
*
* @param action The action to execute.
* @param args JSONArry of arguments for the plugin.
* @param args JSONArray of arguments for the plugin.
* @param callbackContext The callback context from which we were invoked.
*
* @return A PluginResult object with a status and message.
Expand All @@ -82,9 +82,9 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
this.clearCache();
}
else if (action.equals("show")) {
// This gets called from JavaScript onCordovaReady to show the webview.
// This gets called from JavaScript onCordovaReady to show the WebView.
// I recommend we change the name of the Message as spinner/stop is not
// indicative of what this actually does (shows the webview).
// indicative of what this actually does (shows the WebView).
cordova.getActivity().runOnUiThread(() -> webView.getPluginManager().postMessage("spinner", "stop"));
}
else if (action.equals("loadUrl")) {
Expand Down Expand Up @@ -143,7 +143,7 @@ public void clearCache() {
}

/**
* Load the url into the webview.
* Load the url into the WebView.
*
* @param url
* @param props Properties that can be passed in to the Cordova activity (i.e. loadingDialog, wait, ...)
Expand Down Expand Up @@ -273,7 +273,7 @@ public void exitApp() {
private void initTelephonyReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
//final CordovaInterface mycordova = this.cordova;
//final CordovaInterface myCordova = this.cordova;
this.telephonyReceiver = new BroadcastReceiver() {

@Override
Expand Down
6 changes: 3 additions & 3 deletions framework/src/org/apache/cordova/NativeToJsMessageQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ void buildJsMessage(StringBuilder sb) {
case PluginResult.MESSAGE_TYPE_MULTIPART:
int size = pluginResult.getMultipartMessagesSize();
for (int i=0; i<size; i++) {
PluginResult subresult = pluginResult.getMultipartMessage(i);
JsMessage submessage = new JsMessage(subresult, jsPayloadOrCallbackId);
submessage.buildJsMessage(sb);
PluginResult subResult = pluginResult.getMultipartMessage(i);
JsMessage subMessage = new JsMessage(subResult, jsPayloadOrCallbackId);
subMessage.buildJsMessage(sb);
if (i < (size-1)) {
sb.append(",");
}
Expand Down
14 changes: 7 additions & 7 deletions framework/src/org/apache/cordova/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void setPluginEntries(Collection<PluginEntry> pluginEntries) {
}

/**
* Init when loading a new HTML page into webview.
* Init when loading a new HTML page into WebView.
*/
public void init() {
LOG.d(TAG, "init()");
Expand Down Expand Up @@ -388,7 +388,7 @@ private String getLaunchUrlPrefix() {
}

/**
* Called when the webview is going to request an external resource.
* Called when the WebView is going to request an external resource.
*
* This delegates to the installed plugins, and returns true/false for the
* first plugin to provide a non-null result. If no plugins respond, then
Expand Down Expand Up @@ -420,15 +420,15 @@ public boolean shouldAllowRequest(String url) {
return true;
}
if (url.startsWith("file://")) {
//This directory on WebKit/Blink based webviews contains SQLite databases!
//This directory on WebKit/Blink based WebViews contains SQLite databases!
//DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
return !url.contains("/app_webview/");
}
return false;
}

/**
* Called when the webview is going to change the URL of the loaded content.
* Called when the WebView is going to change the URL of the loaded content.
*
* This delegates to the installed plugins, and returns true/false for the
* first plugin to provide a non-null result. If no plugins respond, then
Expand Down Expand Up @@ -457,7 +457,7 @@ public boolean shouldAllowNavigation(String url) {


/**
* Called when the webview is requesting the exec() bridge be enabled.
* Called when the WebView is requesting the exec() bridge be enabled.
*/
public boolean shouldAllowBridgeAccess(String url) {
synchronized (this.entryMap) {
Expand All @@ -477,7 +477,7 @@ public boolean shouldAllowBridgeAccess(String url) {
}

/**
* Called when the webview is going not going to navigate, but may launch
* Called when the WebView is going not going to navigate, but may launch
* an Intent for an URL.
*
* This delegates to the installed plugins, and returns true/false for the
Expand Down Expand Up @@ -506,7 +506,7 @@ public Boolean shouldOpenExternalUrl(String url) {
}

/**
* Called when the URL of the webview changes.
* Called when the URL of the WebView changes.
*
* @param url The URL that is being changed to.
* @return Return false to allow the URL to load, return true to prevent the URL from loading.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class SystemWebChromeClient extends WebChromeClient {

private static final int FILECHOOSER_RESULTCODE = 5173;
private static final int FILE_CHOOSER_RESULT_CODE = 5173;
private static final String LOG_TAG = "SystemWebChromeClient";
private final long MAX_QUOTA = 100 * 1024 * 1024;
protected final SystemWebViewEngine parentEngine;
Expand Down Expand Up @@ -197,7 +197,7 @@ public View getVideoLoadingProgressView() {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
layout.setLayoutParams(layoutParams);
// the proress bar
// the progress bar
ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
barLayoutParams.gravity = Gravity.CENTER;
Expand Down Expand Up @@ -294,7 +294,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
}
filePathsCallback.onReceiveValue(result);
}
}, chooserIntent, FILECHOOSER_RESULTCODE);
}, chooserIntent, FILE_CHOOSER_RESULT_CODE);
} catch (ActivityNotFoundException e) {
LOG.w(LOG_TAG, "No activity found to handle file chooser intent.", e);
filePathsCallback.onReceiveValue(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void onReceivedClientCertRequest (WebView view, ClientCertRequest request
* one time for the main frame. This also means that onPageStarted will not be called when the contents of an
* embedded frame changes, i.e. clicking a link whose target is an iframe.
*
* @param view The webview initiating the callback.
* @param view The WebView initiating the callback.
* @param url The url of the page.
*/
@Override
Expand All @@ -216,7 +216,7 @@ public void onPageStarted(WebView view, String url, Bitmap favicon) {
* This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet.
*
*
* @param view The webview initiating the callback.
* @param view The WebView initiating the callback.
* @param url The url of the page.
*/
@Override
Expand Down
Loading

0 comments on commit 19da06e

Please sign in to comment.