Bug 1348415 - Use present tense for method names and remove redundant public modifiers for GeckoView interface method names draft
authorNitish <nitishplus98@gmail.com>
Sat, 18 Mar 2017 12:56:00 +0530
changeset 501900 94e25803070472d3c0d25ed6bc5cf11908ff4983
parent 496710 8e024ee109742306f00b43ecf7a63a0a95deeeb6
child 550038 aeea89fdd1f078316b3a9a344e4221d4105ff25e
push id50155
push userbmo:nitishplus98@gmail.com
push dateTue, 21 Mar 2017 06:11:21 +0000
bugs1348415
milestone55.0a1
Bug 1348415 - Use present tense for method names and remove redundant public modifiers for GeckoView interface method names MozReview-Commit-ID: 3B82Gn7yBzZ
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
@@ -164,17 +164,17 @@ public class GeckoView extends LayerView
         public void handleMessage(final String event, final GeckoBundle message,
                                   final EventCallback callback) {
             if (DEBUG) {
                 Log.d(LOGTAG, "handleMessage: event = " + event);
             }
 
             if ("GeckoView:DOMTitleChanged".equals(event)) {
                 if (mContentListener != null) {
-                    mContentListener.onTitleChanged(GeckoView.this, message.getString("title"));
+                    mContentListener.onTitleChange(GeckoView.this, message.getString("title"));
                 }
             } else if ("GeckoView:LocationChange".equals(event)) {
                 if (mNavigationListener == null) {
                     // We shouldn't be getting this event.
                     mEventDispatcher.dispatch("GeckoViewNavigation:Inactive", null);
                 } else {
                     mNavigationListener.onLocationChange(GeckoView.this, message.getString("uri"));
                     mNavigationListener.onCanGoBack(GeckoView.this, message.getBoolean("canGoBack"));
@@ -185,17 +185,17 @@ public class GeckoView extends LayerView
                     mProgressListener.onPageStart(GeckoView.this, message.getString("uri"));
                 }
             } else if ("GeckoView:PageStop".equals(event)) {
                 if (mProgressListener != null) {
                     mProgressListener.onPageStop(GeckoView.this, message.getBoolean("success"));
                 }
             } else if ("GeckoView:SecurityChanged".equals(event)) {
                 if (mProgressListener != null) {
-                    mProgressListener.onSecurityChanged(GeckoView.this, message.getInt("status"));
+                    mProgressListener.onSecurityChange(GeckoView.this, message.getInt("status"));
                 }
             }
         }
     }
 
     protected Window window;
     private boolean stateSaved;
     private final Listener listener = new Listener();
@@ -575,98 +575,98 @@ public class GeckoView extends LayerView
     public interface ChromeDelegate {
         /**
         * Tell the host application to display an alert dialog.
         * @param view The GeckoView that initiated the callback.
         * @param message The string to display in the dialog.
         * @param result A PromptResult used to send back the result without blocking.
         * Defaults to cancel requests.
         */
-        public void onAlert(GeckoView view, String message, GeckoView.PromptResult result);
+        void onAlert(GeckoView view, String message, GeckoView.PromptResult result);
 
         /**
         * Tell the host application to display a confirmation dialog.
         * @param view The GeckoView that initiated the callback.
         * @param message The string to display in the dialog.
         * @param result A PromptResult used to send back the result without blocking.
         * Defaults to cancel requests.
         */
-        public void onConfirm(GeckoView view, String message, GeckoView.PromptResult result);
+        void onConfirm(GeckoView view, String message, GeckoView.PromptResult result);
 
         /**
         * Tell the host application to display an input prompt dialog.
         * @param view The GeckoView that initiated the callback.
         * @param message The string to display in the dialog.
         * @param defaultValue The string to use as default input.
         * @param result A PromptResult used to send back the result without blocking.
         * Defaults to cancel requests.
         */
-        public void onPrompt(GeckoView view, String message, String defaultValue, GeckoView.PromptResult result);
+        void onPrompt(GeckoView view, String message, String defaultValue, GeckoView.PromptResult result);
 
         /**
         * Tell the host application to display a remote debugging request dialog.
         * @param view The GeckoView that initiated the callback.
         * @param result A PromptResult used to send back the result without blocking.
         * Defaults to cancel requests.
         */
-        public void onDebugRequest(GeckoView view, GeckoView.PromptResult result);
+        void onDebugRequest(GeckoView view, GeckoView.PromptResult result);
     }
 
     public interface ProgressListener {
         static final int STATE_IS_BROKEN = 1;
         static final int STATE_IS_SECURE = 2;
         static final int STATE_IS_INSECURE = 4;
 
         /**
         * A View has started loading content from the network.
         * @param view The GeckoView that initiated the callback.
         * @param url The resource being loaded.
         */
-        public void onPageStart(GeckoView view, String url);
+        void onPageStart(GeckoView view, String url);
 
         /**
         * A View has finished loading content from the network.
         * @param view The GeckoView that initiated the callback.
         * @param success Whether the page loaded successfully or an error occurred.
         */
-        public void onPageStop(GeckoView view, boolean success);
+        void onPageStop(GeckoView view, boolean success);
 
         /**
         * The security status has been updated.
         * @param view The GeckoView that initiated the callback.
         * @param status The new security status.
         */
-        public void onSecurityChanged(GeckoView view, int status);
+        void onSecurityChange(GeckoView view, int status);
     }
 
     public interface ContentListener {
         /**
         * A page title was discovered in the content or updated after the content
         * loaded.
         * @param view The GeckoView that initiated the callback.
         * @param title The title sent from the content.
         */
-        public void onTitleChanged(GeckoView view, String title);
+        void onTitleChange(GeckoView view, String title);
     }
 
     public interface NavigationListener {
         /**
         * A view has started loading content from the network.
         * @param view The GeckoView that initiated the callback.
         * @param url The resource being loaded.
         */
-        public void onLocationChange(GeckoView view, String url);
+        void onLocationChange(GeckoView view, String url);
 
         /**
         * The view's ability to go back has changed.
         * @param view The GeckoView that initiated the callback.
         * @param canGoBack The new value for the ability.
         */
-        public void onCanGoBack(GeckoView view, boolean canGoBack);
+        void onCanGoBack(GeckoView view, boolean canGoBack);
 
         /**
         * The view's ability to go forward has changed.
         * @param view The GeckoView that initiated the callback.
         * @param canGoForward The new value for the ability.
         */
-        public void onCanGoForward(GeckoView view, boolean canGoForward);
+        void onCanGoForward(GeckoView view, boolean canGoForward);
     }
 }
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
+++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ -87,34 +87,34 @@ public class GeckoViewActivity extends A
         public void onDebugRequest(GeckoView view, GeckoView.PromptResult result) {
             Log.i(LOGTAG, "Remote Debug!");
             result.confirm();
         }
     }
 
     private class MyGeckoViewContent implements GeckoView.ContentListener {
         @Override
-        public void onTitleChanged(GeckoView view, String title) {
+        public void onTitleChange(GeckoView view, String title) {
             Log.i(LOGTAG, "Content title changed to " + title);
         }
     }
 
     private class MyGeckoViewProgress implements GeckoView.ProgressListener {
         @Override
         public void onPageStart(GeckoView view, String url) {
             Log.i(LOGTAG, "Starting to load page at " + url);
         }
 
         @Override
         public void onPageStop(GeckoView view, boolean success) {
             Log.i(LOGTAG, "Stopping page load " + (success ? "successfully" : "unsuccessfully"));
         }
 
         @Override
-        public void onSecurityChanged(GeckoView view, int status) {
+        public void onSecurityChange(GeckoView view, int status) {
             String statusString;
             if ((status & STATE_IS_BROKEN) != 0) {
                 statusString = "broken";
             } else if ((status & STATE_IS_SECURE) != 0) {
                 statusString = "secure";
             } else if ((status & STATE_IS_INSECURE) != 0) {
                 statusString = "insecure";
             } else {