New click-to-play state should influence how plugins are sorted in the Add-ons Manager UI

RESOLVED FIXED in mozilla34

Status

()

defect
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Unfocused, Assigned: alexbardas, Mentored)

Tracking

Trunk
mozilla34
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [lang=js])

Attachments

(1 attachment, 1 obsolete attachment)

Not 100% sure we want this, but... 

When add-ons are shown in a list, we sort the enabled ones first and the disabled ones last. With bug 549697, we have a new intermediate state of "ask me". It may make sense to take that into account when sorting plugins - and sort the "ask me" state in between the equivalents of enabled and disabled. With the current patch in bug 549697, they're sorted the same as enabled plugins.
Boriss: Thoughts?
Flags: needinfo?(jboriss)
Vaguely remember some agreement over this.
Flags: needinfo?(jboriss)
Will need to update sortElements() in toolkit/mozapps/extensions/content/extensions.js

Add-ons are of a type, as determined by their 'type' property. Add-on types also have a set of properties, that define how that specific type should behave - you can look this up via AddonManager.addonTypes - which is a hash mapping the type ID (a string) to a AddonType object. An AddonType object has a 'flags' property, which is a bitfield. If it includes TYPE_SUPPORTS_ASK_TO_ACTIVATE, then such an add-on's 'userDisabled' property can have the value STATE_ASK_TO_ACTIVATE.

We want add-ons in the ask-to-activate state to be sorted so they come directly after enabled add-ons.
Mentor: bmcbride
Whiteboard: [lang=js]
Assignee

Updated

5 years ago
Assignee: nobody → abardas
Status: NEW → ASSIGNED
Assignee

Updated

5 years ago
Attachment #8464346 - Attachment description: bug847244_sort_plugins_from_addons_manager.diff → Take into account askToActivate state for plugin Addon objects and add new browser tests
Assignee

Updated

5 years ago
Attachment #8464346 - Flags: review?(bmcbride)
Comment on attachment 8464346 [details] [diff] [review]
Take into account askToActivate state for plugin Addon objects and add new browser tests

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

Awesome, thanks :)

::: toolkit/mozapps/extensions/test/browser/browser_sorting_plugins.js
@@ +72,5 @@
> +  var node = list.firstChild;
> +  var baseId = "@tests.mozilla.org";
> +  while (node) {
> +    var id = node.getAttribute("value");
> +    if (id && id.substring(id.length - baseId.length) == baseId)

Nit: Now days we can use .endsWith(), which makes this a lot cleaner - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
Attachment #8464346 - Flags: review?(bmcbride) → review+
Assignee

Comment 6

5 years ago
Use .endsWith instead of .substring in test files, based on :Unfocused suggestion.
Attachment #8464346 - Attachment is obsolete: true
Attachment #8465615 - Flags: review+
Comment on attachment 8465615 [details] [diff] [review]
Take into account askToActivate state for plugin Addon objects and add new browser tests

I pushed this to try: https://tbpl.mozilla.org/?tree=Try&rev=3063670d0ae7
Try looks OK so far.
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/b5f3d8eaa757

Congrats!
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [lang=js] → [lang=js][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/b5f3d8eaa757
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Whiteboard: [lang=js][fixed-in-fx-team] → [lang=js]
Target Milestone: --- → mozilla34
Depends on: 1050620
You need to log in before you can comment on or make changes to this bug.