зеркало из https://github.com/mozilla/gecko-dev.git
Bug 683275 - Check the testing pref for geolocation first regardless of which process is requesting the prompt. r=dougt
This commit is contained in:
Родитель
6ed7527e17
Коммит
51a03b28f8
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче