Closed Bug 1332463 Opened 7 years ago Closed 7 years ago

Separate progress-related functionality out of ContentDelegate into ProgressDelegate

Categories

(Core Graveyard :: Embedding: APIs, defect)

defect
Not set
normal

Tracking

(firefox54 fixed)

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: droeh, Assigned: droeh)

References

Details

Attachments

(1 file, 1 obsolete file)

onPageStart, onPageProgress, onPageStop, and possibly onSecurityChanged should be moved out of ContentDelegate and into ProgressDelegate.
Attached patch GeckoView ProgressListener (obsolete) — Splinter Review
This implements ProgressListener (with onPageStart, onPageStop, and onSecurityChanged) and updates the example app to log those events.
Assignee: nobody → droeh
Attachment #8834572 - Flags: review?(nchen)
Comment on attachment 8834572 [details] [diff] [review]
GeckoView ProgressListener

Review of attachment 8834572 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/chrome/content/geckoview.js
@@ +33,5 @@
>  function startup() {
>    dump("zerdatime " + Date.now() + " - geckoview chrome startup finished.");
>  
>    content = new GeckoViewContent(window, document.getElementById("content"), WindowEventDispatcher);
> +  progress = new GeckoViewProgress(window, document.getElementById("content"), WindowEventDispatcher);

Put `document.getElementById("content")` in a variable so you can reuse it

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java
@@ +529,5 @@
> +        * 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);

Please define constants for `status`

::: mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ +110,5 @@
> +
> +        @Override
> +        public void onSecurityChanged(GeckoView view, int status) {
> +            String statusString;
> +            if ((status & 1) > 0) {

Use constants

@@ +117,5 @@
> +                statusString = "secure";
> +            } else if ((status & 4) > 0) {
> +                statusString = "insecure";
> +            } else {
> +                statusString = "what?";

"unknown"

::: mobile/android/modules/moz.build
@@ +33,5 @@
>  
>  # GeckoView-sepcific modules added separately.
>  EXTRA_JS_MODULES += [
> +    'GeckoViewContent.jsm',
> +    'GeckoViewProgress.jsm'

Your patch doesn't include GeckoViewProgress.jsm
Attachment #8834572 - Flags: review?(nchen) → review+
Updated with Jim's suggested changes and rebased around Eugen's patch for bug 1322592; carrying over Jim's r+.
Attachment #8834572 - Attachment is obsolete: true
Attachment #8836251 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/f88c8fc68103
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Depends on: 1345966
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: