Bug 683275 - Check the testing pref for geolocation first regardless of which process is requesting the prompt. r=dougt

This commit is contained in:
Josh Matthews 2011-08-30 15:57:04 -04:00
Родитель 6ed7527e17
Коммит 51a03b28f8
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -1044,6 +1044,14 @@ nsGeolocation::WindowOwnerStillExists()
bool
nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
{
if (Preferences::GetBool("geo.prompt.testing", PR_FALSE)) {
nsCOMPtr<nsIRunnable> ev =
new RequestAllowEvent(Preferences::GetBool("geo.prompt.testing.allow",
PR_FALSE), request);
NS_DispatchToMainThread(ev);
return true;
}
if (XRE_GetProcessType() == GeckoProcessType_Content) {
nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mOwner);
if (!window)
@ -1066,14 +1074,6 @@ nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
return true;
}
if (Preferences::GetBool("geo.prompt.testing", PR_FALSE)) {
nsCOMPtr<nsIRunnable> ev =
new RequestAllowEvent(Preferences::GetBool("geo.prompt.testing.allow",
PR_FALSE), request);
NS_DispatchToMainThread(ev);
return true;
}
nsCOMPtr<nsIRunnable> ev = new RequestPromptEvent(request);
NS_DispatchToMainThread(ev);
return true;