Closed Bug 745995 Opened 12 years ago Closed 12 years ago

Natively-installed webapps should use the app's icon for their taskbar and system menu icons

Categories

(Firefox Graveyard :: Web Apps, defect)

x86
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 14

People

(Reporter: TimAbraldes, Assigned: TimAbraldes)

References

Details

Attachments

(1 file, 3 obsolete files)

XULRunner apps have the icons for their windows in "${AppDir}\chrome\icons\default".  We will want to use a similar approach for natively-installed webapps, placing the icon for the app in a subdirectory of the app's install directory and loading it at runtime.  As mentioned in bug 725408, two possible approaches are:
  1) Modify nsXREDirProvider to return the natively-installed app's application directory when NS_APP_CHROME_DIR_LIST is requested
  2) Modify nsWindow::SetIcon to use the embedded icon of the running EXE if it does not find a suitable .ico file
This patch modifies nsXREDirProvider to return the User Data directory when NS_APP_CHROME_DIR_LIST is requested (and only when this code is being run in the webapprt stub).  This works because the User Data directory and the natively-installed app directory happen to be the same directory.  However, it would be nice to explicitly specify the app's directory and not use the User Data directory here.
This patch modifies the WebappRT directory service provider to return the natively-installed-webapp's application directory when asked for NS_APP_CHROME_DIR_LIST.  As long as we place our icons at "${AppDir}/icons/default/${windowNameOrDefault}.ico" this patch will make icons work correctly in natively-installed webapps.
Attachment #615529 - Attachment is obsolete: true
Attached patch Patch v2 - Append chrome dir (obsolete) — Splinter Review
Slight change; "${AppDir}\chrome\icons\default" instead of "${AppDir}\icons\default"

This makes natively-installed webapps more like XUL apps.

Benjamin: I hate to pile another review on your plate, but since you reviewed bug 725408 I think you're the right person for this review?
Attachment #616041 - Attachment is obsolete: true
Attachment #616048 - Flags: review?(benjamin)
Comment on attachment 616048 [details] [diff] [review]
Patch v2 - Append chrome dir

Nit, unsnuggle "if("

Your enumerator is rather complicated for a single element, it could be:

return {
  _done: false,
  QueryInterface:...,
  hasMoreElements: function() {
    return !this._done;
  },
  getNext: function () {
    return FileUtils.getDir("AppRegD", ["chrome"], false);
    this._done = true;
  }
};

Up to you if you want to make that change.
Attachment #616048 - Flags: review?(benjamin) → review+
[Approval Request Comment]

This is part of the webapps work which is targeted for Firefox 14.  Without this patch, the Windows taskbar will show the Windows default icon for any running webapps.  With this patch, the Windows taskbar will show the correct icon for each running webapp.

Risk for Fennec: none, the code here affects only webapprt/WebappRTDirectoryProvider.js
Attachment #616048 - Attachment is obsolete: true
Attachment #616244 - Flags: review+
Attachment #616244 - Flags: approval-mozilla-central?
Patch v2 from this bug is included in this tryserver run:
  https://tbpl.mozilla.org/?tree=Try&rev=0d5309c488f4
Attachment #616244 - Flags: approval-mozilla-central? → approval-mozilla-central+
Target Milestone: --- → Firefox 14
https://hg.mozilla.org/mozilla-central/rev/0c61704a02ea
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 731054
Verified that this feature has landed. Followup bugs will be tracked in the webapps component separately.
Status: RESOLVED → VERIFIED
No longer blocks: 731054
Flags: in-moztrap?(jsmith)
Flags: in-moztrap?(jsmith) → in-moztrap+
QA Contact: jsmith
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: