Closed Bug 1348415 Opened 7 years ago Closed 7 years ago

Use present tense for GeckoView interface method names

Categories

(GeckoView :: General, enhancement)

All
Android
enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jchen, Assigned: nitishplus98, Mentored)

References

Details

Attachments

(1 file)

`onTitleChanged` should be `onTitleChange` in `ContentListener` and `onSecurityChanged` should be `onSecurityChange` in `ProgressListener`, to match other method names like `onPageStart` that use a verb's present tense.
Also, `public` is redundant for a method in an interface, so we should remove the 'public' keyword from method definitions in GeckoView interfaces.
Mentor: nchen
Keywords: good-first-bug
Attachment #8848717 - Flags: review?(nchen)
Flags: needinfo?(nchen)
Comment on attachment 8848717 [details]
Bug 1348415 - Use present tense for method names and remove redundant public modifiers for GeckoView interface method names

https://reviewboard.mozilla.org/r/121622/#review124046

Thanks for the patch! There are just a couple other places that need to be updated.

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java:172
(Diff revision 1)
>                  Log.d(LOGTAG, "handleMessage: event = " + event);
>              }
>  
>              if ("GeckoView:DOMTitleChanged".equals(event)) {
>                  if (mContentListener != null) {
>                      mContentListener.onTitleChanged(GeckoView.this, message.getString("title"));

Please update this line.

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java:193
(Diff revision 1)
>                  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"));

Please update this line.
Attachment #8848717 - Flags: review?(nchen) → review-
Assignee: nobody → nitishplus98
Status: NEW → ASSIGNED
Flags: needinfo?(nchen)
Attachment #8848717 - Flags: review?(nchen)
Are changes required in the event messages "GeckoView:DOMTitleChanged" and "GeckoView:SecurityChanged". If so, then where are these messages passed as parameter 'event' to GeckoView.java:handleMessage(final String event, final GeckoBundle message,final EventCallback callback)?
Are changes required in the event messages "GeckoView:DOMTitleChanged" and "GeckoView:SecurityChanged". If so, then where are these messages passed as parameter 'event' to GeckoView.java:handleMessage(final String event, final GeckoBundle message,final EventCallback callback)?
Thanks.
Sorry. The comment came twice due to a poor internet connection.
Comment on attachment 8848717 [details]
Bug 1348415 - Use present tense for method names and remove redundant public modifiers for GeckoView interface method names

https://reviewboard.mozilla.org/r/121622/#review124514

Thanks for your patch!

(In reply to Nitish from comment #5)
> Are changes required in the event messages "GeckoView:DOMTitleChanged" and
> "GeckoView:SecurityChanged". If so, then where are these messages passed as
> parameter 'event' to GeckoView.java:handleMessage(final String event, final
> GeckoBundle message,final EventCallback callback)?

You don't have to change that.
Attachment #8848717 - Flags: review?(nchen) → review+
Hi Jim, I was away for a while. Is there any other change to be made before the try server run?
No, your patch is good.
Could you land the patch?
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1ec9038f1b16
Use present tense for method names and remove redundant public modifiers for GeckoView interface method names r=jchen
https://hg.mozilla.org/mozilla-central/rev/1ec9038f1b16
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Product: Firefox for Android → GeckoView
Keywords: good-first-bug
Target Milestone: Firefox 55 → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: