Closed
Bug 469739
Opened 16 years ago
Closed 16 years ago
Add support for displaying Vista UAC shield icon
Categories
(Core :: Graphics: ImageLib, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: rain1, Assigned: rain1)
References
Details
(Keywords: fixed1.9.1)
Attachments
(2 files, 1 obsolete file)
3.92 KB,
image/png
|
Details | |
8.52 KB,
patch
|
joe
:
review+
vlad
:
superreview+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
According to the Windows Vista UX guidelines [1], at every UAC entry point one is supposed to display a UAC shield icon. Currently, Mozilla products don't follow this guideline as there isn't support in libpr0n to display such an icon. This patch adds support to display UAC icons using a standard moz-icon URL. The URL is moz-icon://stock/uac-shield. Since the Windows version of nsIconChannel didn't have any support for displaying stock icons, I've added generic support for it, and decoupled the file:// specific and the generic hIcon code. More parameters can easily be added as needed. Most of the patch will require the Vista SDK, as SHGetStockIconInfo and SHSTOCKICONID are both new to Vista. People who don't compile using the Vista SDK shouldn't see a difference. Stuart: are you an appropriate person to ask for review here? Is the parameter name fine? I also have no idea where this would be documented. [1] http://msdn.microsoft.com/en-us/library/aa511445.aspx#guidelines
Attachment #353120 -
Flags: review?(pavlov)
Assignee | ||
Comment 1•16 years ago
|
||
Comment on attachment 353120 [details] [diff] [review] proposed patch, v1 Changing r/sr? per stuart.
Attachment #353120 -
Flags: superreview?(pavlov)
Attachment #353120 -
Flags: review?(pavlov)
Attachment #353120 -
Flags: review?(joe)
Assignee | ||
Comment 2•16 years ago
|
||
This is how a button looks with the shield icon.
Assignee | ||
Comment 3•16 years ago
|
||
Oops, missed the FreeLibrary. Also fixed a couple of style issues.
Attachment #353120 -
Attachment is obsolete: true
Attachment #353207 -
Flags: superreview?(pavlov)
Attachment #353207 -
Flags: review?(joe)
Attachment #353120 -
Flags: superreview?(pavlov)
Attachment #353120 -
Flags: review?(joe)
Comment 4•16 years ago
|
||
Comment on attachment 353207 [details] [diff] [review] proposed patch, v1.01, added FreeLibrary [Checkin: Comment 7] >+ nsCAutoString stockIcon; >+ iconURI->GetStockIcon(stockIcon); >+ if (!stockIcon.IsEmpty()) >+ rv = GetStockHIcon(iconURI, &hIcon); >+ else >+#endif >+ rv = GetHIconFromFile(&hIcon); Is there any possibility that GetHIconFromFile will return a result when GetStockHIcon can't? If so, I'd rather this fall back rather than being an else condition. >+#include <windows.h> I am 80% sure that including windows.h in a Mozilla .h file is frowned upon, but am willing to be shown to be wrong. r+ as long as windows.h in a Mozilla header is okay; r- otherwise.
Attachment #353207 -
Flags: superreview?(vladimir)
Attachment #353207 -
Flags: superreview?(pavlov)
Attachment #353207 -
Flags: review?(joe)
Attachment #353207 -
Flags: review+
Assignee | ||
Comment 5•16 years ago
|
||
Thanks for reviewing! (In reply to comment #4) > Is there any possibility that GetHIconFromFile will return a result when > GetStockHIcon can't? If so, I'd rather this fall back rather than being an else > condition. No, I don't think so. According to the moz-icon "spec" <http://mxr.mozilla.org/mozilla-central/source/modules/libpr0n/decoders/icon/nsIIconURI.idl>, a url can be one of the two, not both. > > >+#include <windows.h> > > I am 80% sure that including windows.h in a Mozilla .h file is frowned upon, > but am willing to be shown to be wrong. > > r+ as long as windows.h in a Mozilla header is okay; r- otherwise. FWIW: <http://mxr.mozilla.org/mozilla-central/search?string=%3Cwindows.h%3E&find=.*\.h&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central>
Attachment #353207 -
Flags: superreview?(vladimir) → superreview+
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•16 years ago
|
||
Joe clarified that the patch was r+ him, as the header file touched in the patch is Windows only.
Comment 7•16 years ago
|
||
Comment on attachment 353207 [details] [diff] [review] proposed patch, v1.01, added FreeLibrary [Checkin: Comment 7] http://hg.mozilla.org/mozilla-central/rev/1a6d5321e253
Attachment #353207 -
Attachment description: proposed patch, v1.01, added FreeLibrary → proposed patch, v1.01, added FreeLibrary
[Checkin: Comment 7]
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Assignee | ||
Comment 8•16 years ago
|
||
Comment on attachment 353207 [details] [diff] [review] proposed patch, v1.01, added FreeLibrary [Checkin: Comment 7] Pretty low risk, no effect on existing code, and this + adding the shield to the updater button will be a nice visual integration win.
Attachment #353207 -
Flags: approval1.9.1?
Updated•16 years ago
|
Attachment #353207 -
Flags: approval1.9.1? → approval1.9.1+
Comment 9•16 years ago
|
||
Comment on attachment 353207 [details] [diff] [review] proposed patch, v1.01, added FreeLibrary [Checkin: Comment 7] a191=beltzner
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Whiteboard: [checkin-needed to 1.9.1]
Comment 10•16 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/43db05dac257
Keywords: checkin-needed → fixed1.9.1
Whiteboard: [checkin-needed to 1.9.1]
You need to log in
before you can comment on or make changes to this bug.
Description
•