Closed Bug 459413 Opened 16 years ago Closed 16 years ago

Geolocation prompt for SeaMonkey


(SeaMonkey :: UI Design, defect)

Not set


(Not tracked)



(Reporter: kairo, Assigned: kairo)




(1 file, 2 obsolete files)

Bug 444642 Implemented the geolocation notification bars in Firefox, we should get those into SeaMonkey 2 as well. AFAIK, the basic functionality it calls is all toolkit, so it's easy to leverage it.
Here's a rather simple patch to add this notification bar.

Steps for testing:
1) Get a build with this patch up and running.
2) Install - either by downloading it and hacking in SeaMonkey compat into its install.rdf or by switching off extension compat checking via the hidden pref (I did the former and will ask DougT to add SeaMonkey 2.0a2pre to the compatible apps in AMO)
3) Go to the Add-Ons Manager and click "Preferences" on that Add-Ons to set your longitude/latitude
4) Once that's set, go to
5) The notification bar should come up and after allowing it exact position or neighborhood, it should output your location repeatedly (AFAIK, it even should pick up changes you enter with the pref window)
Attachment #342621 - Flags: superreview?(neil)
Attachment #342621 - Flags: review?(neil)
Comment on attachment 342621 [details] [diff] [review]
port geolocation notification bar to SeaMonkey

>+  geolocationService.prompt = function(request) {
Sorry, but you can't set a service callback to a window object, because that will do nasty things when the window closes. It might be possible to use a module, but you're probably better off moving this to suite glue. Either way you'll have to get the bundle manually (i.e. rather than via xbl) unfortunately.

>+    function getChromeWindow(aWindow) {
This is all way too complicated when all you want is the notification box, which you should should be able to get something like this: request.requestingWindow.QI(nsIInterfaceRequestor).gI(nsIWebNavigation).QI(nsIDocShell).chromeEventHandler.parentNode;
Attachment #342621 - Flags: superreview?(neil)
Attachment #342621 - Flags: superreview-
Attachment #342621 - Flags: review?(neil)
Patch looks OK apart from those two points, although I had some issues which apppear to be the default of the the demo geolocation add-in.
I filed bug 459893 on Firefox, which probably is the same problem you are talking about here.
Attached patch nsSuiteGlue version (obsolete) — Splinter Review
Will do our fix based on the new bug 459893 work, which makes this nicer to do.
Depends on: 459893
This is a new patch that builds upon the recent bug 459893 patch, which now makes the geolocation service just look for a prompt implementation, so it's easier for us to implement that.
Attachment #344146 - Flags: superreview?(neil)
Attachment #344146 - Flags: review?(neil)
Attachment #342621 - Attachment is obsolete: true
Attachment #343320 - Attachment is obsolete: true
Comment on attachment 344146 [details] [diff] [review]
patch v2: port based on bug 459893 patch

Looks good but obviously we need to give our implementation a different class ID.
Comment on attachment 344146 [details] [diff] [review]
patch v2: port based on bug 459893 patch

Oh, OK, sure. Make this line:

>diff --git a/suite/common/src/nsSuiteGlue.js b/suite/common/src/nsSuiteGlue.js
>+  classID:          Components.ID("{C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5}"),

this instead:

+  classID:          Components.ID("{450a13bd-0d07-4e5d-a9f0-448c201728b1}"),

Changed locally, I think I don't need to upload another patch for review just for this, right?
Attachment #344146 - Flags: superreview?(neil)
Attachment #344146 - Flags: superreview+
Attachment #344146 - Flags: review?(neil)
Attachment #344146 - Flags: review+
Comment on attachment 344146 [details] [diff] [review]
patch v2: port based on bug 459893 patch

>+  classID:          Components.ID("{C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5}"),
Don't forget ;-)

>+                    .createBundle("chrome://communicator/locale/");
Nice :-)

>+geolocation.exactLocation=Exact Location (within 10 feet)
>+geolocation.neighborhoodLocation=Neighborhood (within 1 mile)
>+geolocation.requestMessage=%S wants to know where you are.  Tell them:
It's more readable if you put the message before the options!
neil, does that work?  


What I was finding that anything less than what I was doing would find the current tab, instead of the tab that contained the window that the geolocation was for.
Pushed as
Closed: 16 years ago
Resolution: --- → FIXED
Blocks: 464774
You need to log in before you can comment on or make changes to this bug.