Use present tense for GeckoView interface method names

RESOLVED FIXED in Firefox 55

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jchen, Assigned: nitishplus98, Mentored)

Tracking

({good-first-bug})

unspecified
Firefox 55
All
Android
good-first-bug
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
`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.
(Reporter)

Comment 1

2 years ago
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
Comment hidden (mozreview-request)
(Assignee)

Updated

2 years ago
Attachment #8848717 - Flags: review?(nchen)
(Assignee)

Updated

2 years ago
Flags: needinfo?(nchen)
(Reporter)

Comment 3

2 years ago
mozreview-review
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-
(Reporter)

Updated

2 years ago
Assignee: nobody → nitishplus98
Status: NEW → ASSIGNED
Flags: needinfo?(nchen)
Comment hidden (mozreview-request)
(Assignee)

Updated

2 years ago
Attachment #8848717 - Flags: review?(nchen)
(Assignee)

Comment 5

2 years ago
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)?
(Assignee)

Comment 6

2 years ago
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.
(Assignee)

Comment 7

2 years ago
Sorry. The comment came twice due to a poor internet connection.
(Reporter)

Comment 8

2 years ago
mozreview-review
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+
(Assignee)

Comment 9

2 years ago
Hi Jim, I was away for a while. Is there any other change to be made before the try server run?
(Reporter)

Comment 10

2 years ago
No, your patch is good.
(Assignee)

Comment 11

2 years ago
Could you land the patch?

Comment 12

2 years ago
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

Comment 13

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1ec9038f1b16
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
You need to log in before you can comment on or make changes to this bug.