Geolocation fixes
- Dismiss GeolocationPermissionsPrompt when user navigates
away from the page or when the user responds to a prompt
for the same origin on a different tab.
- Geolocation indicator missing in incognito tabs.
Change-Id: If73bc509a83ad543ed02f723c65dd1507f0d7ac1
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index b7be6a5..7560322 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -392,6 +392,12 @@
mTouchIconLoader = null;
}
+ // Loading a new page voids any ongoing Geolocation permission
+ // requests.
+ if (mGeolocationPermissionsPrompt != null) {
+ mGeolocationPermissionsPrompt.dismiss();
+ }
+
// finally update the UI in the activity if it is in the foreground
mWebViewController.onPageStarted(Tab.this, view, favicon);
@@ -1731,6 +1737,7 @@
.findViewById(R.id.geolocation_permissions_prompt);
mGeolocationPermissionsPrompt = (GeolocationPermissionsPrompt) stub
.inflate();
+ mGeolocationPermissionsPrompt.init(mCurrentState.mIncognito);
}
return mGeolocationPermissionsPrompt;
}