Closed Bug 965264 Opened 10 years ago Closed 10 years ago

Opening a new window shows original provider buttons, not updated ones

Categories

(Firefox Graveyard :: SocialAPI, defect)

defect
Not set
normal

Tracking

(firefox30 verified)

VERIFIED FIXED
Firefox 30
Tracking Status
firefox30 --- verified

People

(Reporter: standard8, Assigned: florian)

References

Details

Attachments

(1 file, 1 obsolete file)

STR:

1. Have a provider with a default button (e.g. Talkilla)
2. Sign-in, so that the icon changes from the default
3. Open a new window

=> The new window has the default icons, not the new icons seen in step 2 (original window stays unchanged).
Attached patch FixSplinter Review
This patch fixes the problem and seems harmless, but I'm not completely sure why it's needed.

I think the code at http://hg.mozilla.org/mozilla-central/annotate/25c361f6661f/browser/base/content/browser-social.js#l1016 :
1016   onWidgetAdded: function(aWidgetId, aArea, aPosition) {
1017     let origin = this._getNodeOrigin(aWidgetId);
1018     if (origin)
1019       SocialStatus.updateButton(origin);
1020   },

was expected to do exactly what my patch is doing. I added a dump in there and couldn't see it called. Shane, do you know when this code is called, and if we expect it to be called when opening a new window?
Attachment #8367979 - Flags: review?(mixedpuppy)
Maybe @mconley knows why onWidgetAdded is not called per window.  Assuming that it is not supposed to be called per window I'd give my r+, but lets see what he says first.
Flags: needinfo?(mconley)
It's not called per window because onWidgetAdded is fired when a widget is added to an area. An area is something that exists globally... it's like this abstract thing. *waves hands*.

A window might have a node registered to represent that area. If so, CustomizableUI does the job of making sure that node accurately represents that area.

So I guess that's my hand-wavey answer - onWidgetAdded is not called per window because the widget is really only added once.

onWidgetBeforeDOMChange and onWidgetAfterDOMChange are, however, fired per DOM change, as you'd expect - so those fire per-window.
Flags: needinfo?(mconley)
Comment on attachment 8367979 [details] [diff] [review]
Fix

call updateButton from the loop in ToolbarHelper.populatePalette, that should fix both the status and marks  button.  I'd r+ with that change.
Attached patch Patch v2 (obsolete) — Splinter Review
SocialMarks doesn't have an updateButton method. I added one and tried to do something that makes sense, but I'm not fully satisfied with the changes in this patch (I was tempted to change ToolbarHelper to take only one parameter: either SocialStatus or SocialMarks; and use the methods there directly, which would avoid the issues with the value of 'this').
Attachment #8367979 - Attachment is obsolete: true
Attachment #8367979 - Flags: review?(mixedpuppy)
Attachment #8370159 - Flags: review?(mixedpuppy)
Attachment #8367979 - Flags: review+
Comment on attachment 8370159 [details] [diff] [review]
Patch v2

Sorry, I think the original patch is simpler and gets the job done, rather than forcing marks into the same model when it is probably unnecessary.
Attachment #8370159 - Flags: review?(mixedpuppy) → review-
Comment on attachment 8367979 [details] [diff] [review]
Fix

Removing the 'obsolete' flag, as we are actually moving forward with this patch.
Attachment #8367979 - Attachment is obsolete: false
Attachment #8370159 - Attachment is obsolete: true
Assignee: nobody → florian
https://hg.mozilla.org/mozilla-central/rev/e94372b0ea08
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
Keywords: verifyme
Reproduced in Nightly 2014-01-27.
Verified fixed 30.0a1 (2014-03-10), Win 7 x64.
Note that the widget also changes in private browsing mode.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: